diff --git a/.cloudbuild/samples_build.yaml b/.cloudbuild/samples_build.yaml new file mode 100644 index 0000000000..06f87c837e --- /dev/null +++ b/.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/.github/.OwlBot-hermetic.yaml b/.github/.OwlBot-hermetic.yaml new file mode 100644 index 0000000000..40c7b4332b --- /dev/null +++ b/.github/.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: +- "/grpc-google-.*/src" +- "/proto-google-.*/src" + +deep-preserve-regex: +- "/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/bigtable/(v\\d)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-bigtable-$1/src" +- source: "/google/bigtable/(v\\d)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-bigtable-$1/src" +- source: "/google/bigtable/(v\\d)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-bigtable/src" +- source: "/google/bigtable/admin/(v\\d)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/$1/proto-google-cloud-bigtable-admin-$1/src" +- source: "/google/bigtable/admin/(v\\d)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/$1/grpc-google-cloud-bigtable-admin-$1/src" +- source: "/google/bigtable/admin/(v\\d)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/$1/google-cloud-bigtable/src" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7c4d9ac88e..e1f4bd0e65 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,9 +4,19 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -# The @googleapis/api-bigtable is the default owner for changes in this repo -* @googleapis/yoshi-java @googleapis/api-bigtable -**/*.java @googleapis/api-bigtable +# The @googleapis/bigtable-team is the default owner for changes in this repo +* @googleapis/cloud-sdk-java-team @googleapis/bigtable-team + +# for handwritten libraries, keep codeowner_team in .repo-metadata.json as owner +**/*.java @googleapis/bigtable-team @googleapis/cloud-sdk-java-team + # The java-samples-reviewers team is the default owner for samples changes samples/**/*.java @googleapis/java-samples-reviewers + +# Generated snippets should not be owned by samples reviewers +samples/snippets/generated/ @googleapis/cloud-sdk-java-team + +# Admin Module (Cloud Java Team ownership) +**/com/google/cloud/bigtable/admin/** @googleapis/bigtable-team @googleapis/cloud-sdk-java-team +**/com/google/bigtable/admin/** @googleapis/bigtable-team @googleapis/cloud-sdk-java-team diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4238681315..9d229e0370 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,5 +3,10 @@ Thank you for opening a Pull Request! Before submitting your PR, there are a few - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) +- [ ] Rollback plan is reviewed and LGTMed +- [ ] All new data plane features have a completed end to end testing plan Fixes # ☕️ + +If you write sample code, please follow the [samples format]( +https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/.github/readme/synth.py b/.github/auto-label.yaml similarity index 73% rename from .github/readme/synth.py rename to .github/auto-label.yaml index 7b48cc28d3..4caef688b7 100644 --- a/.github/readme/synth.py +++ b/.github/auto-label.yaml @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# 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. @@ -11,9 +11,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -"""This script is used to synthesize generated the README for this library.""" - -from synthtool.languages import java - -java.custom_templates(["java_library/README.md"]) +requestsize: + enabled: true diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 1a23ea42b1..2176b05432 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,5 +1,5 @@ # Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss assign_prs_by: - labels: - samples diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..203f9eaccf --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for Maven dependencies + # we use renovate-bot as well as shared-dependencies BOM to update maven dependencies. + ignore: + - dependency-name: "*" + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for pip dependencies + # If a security vulnerability comes in, we will be notified about + # it via template in the synthtool repository. + ignore: + - dependency-name: "*" diff --git a/.github/flakybot.yaml b/.github/flakybot.yaml new file mode 100644 index 0000000000..cb83375f98 --- /dev/null +++ b/.github/flakybot.yaml @@ -0,0 +1 @@ +issuePriority: p2 diff --git a/.github/generated-files-bot.yml b/.github/generated-files-bot.yml index 47c2ba132e..e58cdcbad6 100644 --- a/.github/generated-files-bot.yml +++ b/.github/generated-files-bot.yml @@ -6,6 +6,8 @@ externalManifests: file: '.github/readme/synth.metadata/synth.metadata' jsonpath: '$.generatedFiles[*]' ignoreAuthors: +- 'cloud-java-bot' - 'renovate-bot' - 'yoshi-automation' - 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/.github/readme/synth.metadata/synth.metadata b/.github/readme/synth.metadata/synth.metadata index 6a4237f671..4737824ebc 100644 --- a/.github/readme/synth.metadata/synth.metadata +++ b/.github/readme/synth.metadata/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "04bc9e69f670b4b28e0bd84ba5d4a4074588b0ce" + "sha": "c1681b1e6e76d7620041b6c712334d480113b171" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "0199c79b8324fba66476300824aa931788c47e2d" + "sha": "17ee6e5c08f2eb47029beee4776ce990e56b3925" } } ] diff --git a/.github/release-please.yml b/.github/release-please.yml index dce2c84509..64a2f5f5db 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,98 @@ +bumpMinorPreMajor: true +handleGHRelease: true releaseType: java-yoshi -bumpMinorPreMajor: true \ No newline at end of file +extraFiles: + - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +branches: + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-lts + branch: 1.22.0-sp + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: java7 + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.2.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: v2.6.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.16.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.23.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.25.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.30.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.39.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.54.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.61.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-backport + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: 2.60.x + - bumpMinorPreMajor: true + handleGHRelease: true + releaseType: java-yoshi + extraFiles: + - >- + google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java + branch: protobuf-4.x-rc + manifest: true diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 0000000000..3fe5f7245a --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1,2 @@ +enabled: true +multiScmName: java-bigtable diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh new file mode 100644 index 0000000000..74d0e6cc41 --- /dev/null +++ b/.github/scripts/update_generation_config.sh @@ -0,0 +1,187 @@ +#!/bin/bash +set -ex +# This script should be run at the root of the repository. +# This script is used to update googleapis_commitish, gapic_generator_version, +# and libraries_bom_version in generation configuration at the time of running +# and create a pull request. + +# The following commands need to be installed before running the script: +# 1. git +# 2. gh +# 3. jq + +# Utility functions +# Get the latest released version of a Maven artifact. +function get_latest_released_version() { + local group_id=$1 + local artifact_id=$2 + group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")" + url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml" + xml_content=$(curl -s --fail "${url}") + + # 1. Extract all version tags + # 2. Strip the XML tags to leave just the version numbers + # 3. Filter for strictly numbers.numbers.numbers (e.g., 2.54.0) + # 4. Sort by version (V) and take the last one (tail -n 1) + latest=$(echo "${xml_content}" \ + | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' \ + | sed -E 's/<[^>]+>//g' \ + | sort -V \ + | tail -n 1) + + if [[ -z "${latest}" ]]; then + echo "The latest version of ${group_id}:${artifact_id} is empty." + echo "The returned json from maven.org is invalid: ${json_content}" + exit 1 + else + echo "${latest}" + fi +} + +# Update a key to a new value in the generation config. +function update_config() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" +} + +# Update an action to a new version in GitHub action. +function update_action() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + # use a different delimiter because the key_word contains "/". + sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}" +} + +# The parameters of this script is: +# 1. base_branch, the base branch of the result pull request. +# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java +# 3. [optional] generation_config, the path to the generation configuration, +# the default value is generation_config.yaml in the repository root. +# 4. [optional] workflow, the library generation workflow file, +# the default value is .github/workflows/hermetic_library_generation.yaml. +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --base_branch) + base_branch="$2" + shift + ;; + --repo) + repo="$2" + shift + ;; + --generation_config) + generation_config="$2" + shift + ;; + --workflow) + workflow="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${base_branch}" ]; then + echo "missing required argument --base_branch" + exit 1 +fi + +if [ -z "${repo}" ]; then + echo "missing required argument --repo" + exit 1 +fi + +if [ -z "${generation_config}" ]; then + generation_config="generation_config.yaml" + echo "Use default generation config: ${generation_config}" +fi + +if [ -z "${workflow}" ]; then + workflow=".github/workflows/hermetic_library_generation.yaml" + echo "Use default library generation workflow file: ${workflow}" +fi + +current_branch="generate-libraries-${base_branch}" +title="chore: Update generation configuration at $(date)" + +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch +pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") +# Create a branch if there's no open pull request associated with the +# branch; otherwise checkout the pull request. +if [ -z "${pr_num}" ]; then + git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" +else + gh pr checkout "${pr_num}" +fi + +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + +mkdir tmp-googleapis +# Use partial clone because only commit history is needed. +git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis +pushd tmp-googleapis +git pull +latest_commit=$(git rev-parse HEAD) +popd +rm -rf tmp-googleapis +update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" + +# Update gapic-generator-java version to the latest +latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") +update_config "gapic_generator_version" "${latest_version}" "${generation_config}" + +# Update composite action version to latest gapic-generator-java version +update_action "googleapis/sdk-platform-java/.github/scripts" \ + "${latest_version}" \ + "${workflow}" + +# Update libraries-bom version to the latest +latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") +update_config "libraries_bom_version" "${latest_version}" "${generation_config}" + +git add "${generation_config}" "${workflow}" +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" == "" ]]; then + echo "The latest generation config is not changed." + echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" + exit 0 +fi + +if [ -z "${pr_num}" ]; then + git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" + git fetch -q remote_repo + git push -f remote_repo "${current_branch}" + gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" +else + git push + gh pr edit "${pr_num}" --title "${title}" --body "${title}" +fi diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6bddd18eac..1005971cae 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -1,49 +1,228 @@ - -# Whether or not rebase-merging is enabled on this repository. -# Defaults to `true` rebaseMergeAllowed: false - -# Whether or not squash-merging is enabled on this repository. -# Defaults to `true` squashMergeAllowed: true - -# Whether or not PRs are merged with a merge commit on this repository. -# Defaults to `false` mergeCommitAllowed: false - -# Rules for master branch protection branchProtectionRules: -# Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `master` -- pattern: master - # Can admins overwrite branch protection. - # Defaults to `true` - isAdminEnforced: true - # Number of approving reviews required to update matching branches. - # Defaults to `1` - requiredApprovingReviewCount: 1 - # Are reviews from code owners required to update matching branches. - # Defaults to `false` - requiresCodeOwnerReviews: true - # Require up to date branches - requiresStrictStatusChecks: false - # List of required status check contexts that must pass for commits to be accepted to matching branches. - requiredStatusCheckContexts: - - "dependencies (8)" - - "dependencies (11)" - - "linkage-monitor" - - "lint" - - "clirr" - - "units (7)" - - "units (8)" - - "units (11)" - - "Kokoro - Test: Integration" - - "cla/google" -# List of explicit permissions to add (additive only) + - pattern: main + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image A' + - 'Kokoro - Test: Java GraalVM Native Image B' + - 'Kokoro - Test: Java GraalVM Native Image C' + - javadoc + - conformance + - library_generation + - unmanaged_dependency_check + - pattern: 1.22.0-sp + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - pattern: java7 + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - pattern: 2.2.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - pattern: v2.6.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - pattern: 2.16.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (8) + - dependencies (11) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - pattern: 2.23.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - pattern: 2.25.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - pattern: 2.30.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - javadoc + - conformance + - pattern: 2.39.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - javadoc + - conformance + - pattern: 2.54.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - javadoc + - conformance + - library_generation + - unmanaged_dependency_check + - pattern: 2.61.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (8) + - units (11) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image A' + - 'Kokoro - Test: Java GraalVM Native Image B' + - 'Kokoro - Test: Java GraalVM Native Image C' + - javadoc + - conformance + - library_generation + - unmanaged_dependency_check + - pattern: 2.60.x + isAdminEnforced: true + requiredApprovingReviewCount: 1 + requiresCodeOwnerReviews: true + requiresStrictStatusChecks: false + requiredStatusCheckContexts: + - dependencies (17) + - lint + - clirr + - units (11) + - units (17) + - units (21) + - units (24) + - 'Kokoro - Test: Integration' + - cla/google + - 'Kokoro - Test: Java GraalVM Native Image A' + - 'Kokoro - Test: Java GraalVM Native Image B' + - 'Kokoro - Test: Java GraalVM Native Image C' + - javadoc + - conformance + - library_generation + - unmanaged_dependency_check permissionRules: -- team: yoshi-admins - permission: admin -- team: yoshi-java-admins - permission: admin -- team: yoshi-java - permission: push \ No newline at end of file + - team: yoshi-admins + permission: admin + - team: yoshi-java-admins + permission: admin + - team: cloud-sdk-java-team + permission: push diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml index f247d5c789..88d3ac9bf1 100644 --- a/.github/trusted-contribution.yml +++ b/.github/trusted-contribution.yml @@ -1,2 +1,9 @@ trustedContributors: -- renovate-bot \ No newline at end of file +- renovate-bot +- gcf-owl-bot[bot] + +annotations: +- type: comment + text: "/gcbrun" +- type: label + text: "kokoro:force-run" diff --git a/.github/workflows/approve-readme.yaml b/.github/workflows/approve-readme.yaml index 7513acaebc..59f00b8eb6 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: pull_request: name: auto-merge-readme @@ -6,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v3 + - uses: actions/github-script@v7 with: github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} script: | diff --git a/.github/workflows/auto-release.yaml b/.github/workflows/auto-release.yaml deleted file mode 100644 index 7c8816a7d7..0000000000 --- a/.github/workflows/auto-release.yaml +++ /dev/null @@ -1,88 +0,0 @@ -on: - pull_request: -name: auto-release -jobs: - approve: - runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') - steps: - - uses: actions/github-script@v3 - with: - github-token: ${{secrets.YOSHI_APPROVER_TOKEN}} - debug: true - script: | - // only approve PRs from release-please[bot] - if (context.payload.pull_request.user.login !== "release-please[bot]") { - return; - } - - // only approve PRs like "chore(master): release " - if ( !context.payload.pull_request.title.startsWith("chore(master): release") ) { - return; - } - - // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.pulls.listFiles.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - }); - const changed_files = await github.paginate(filesPromise) - - if ( changed_files.length < 1 ) { - console.log( "Not proceeding since PR is empty!" ) - return; - } - - if ( !changed_files.some(v => v.filename.includes("pom")) || !changed_files.some(v => v.filename.includes("versions.txt")) ) { - console.log( "PR file changes do not have pom.xml or versions.txt -- something is wrong. PTAL!" ) - return; - } - - // trigger auto-release when - // 1) it is a SNAPSHOT release (auto-generated post regular release) - // 2) there are dependency updates only - // 3) there are no open dependency update PRs in this repo (to avoid multiple releases) - if ( - context.payload.pull_request.body.includes("Fix") || - context.payload.pull_request.body.includes("Build") || - context.payload.pull_request.body.includes("Documentation") || - context.payload.pull_request.body.includes("BREAKING CHANGES") || - context.payload.pull_request.body.includes("Features") - ) { - console.log( "Not auto-releasing since it is not a dependency-update-only release." ); - return; - } - - const promise = github.pulls.list.endpoint({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open' - }); - const open_pulls = await github.paginate(promise) - - if ( open_pulls.length > 1 && !context.payload.pull_request.title.includes("SNAPSHOT") ) { - for ( const pull of open_pulls ) { - if ( pull.title.startsWith("deps: update dependency") ) { - console.log( "Not auto-releasing yet since there are dependency update PRs open in this repo." ); - return; - } - } - } - - // approve release PR - await github.pulls.createReview({ - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Rubber stamped release!', - pull_number: context.payload.pull_request.number, - event: 'APPROVE' - }); - - // attach kokoro:force-run and automerge labels - await github.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.payload.pull_request.number, - labels: ['kokoro:force-run', 'automerge'] - }); diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index def8b3a2c8..b9b8be0c36 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,34 +1,72 @@ +# 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: - - master + - main pull_request: name: ci jobs: units: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - java: [7, 8, 11] + java: [11, 17, 21, 25] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - 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 - - name: coverage - uses: codecov/codecov-action@v1 - with: - name: actions ${{matrix.java}} + units-java8: + # 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: 8 + 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" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - run: .kokoro/build.sh + env: + JOB_TYPE: test windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -38,34 +76,35 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11] + java: [17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh - linkage-monitor: + javadoc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - java-version: 8 + distribution: temurin + java-version: 17 - run: java -version - - name: Install artifacts to local Maven repository - run: .kokoro/build.sh - shell: bash - - name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release) - uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - java-version: 8 + distribution: temurin + java-version: 17 - run: java -version - run: .kokoro/build.sh env: @@ -73,11 +112,12 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.sh env: - JOB_TYPE: clirr \ No newline at end of file + JOB_TYPE: clirr diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml new file mode 100644 index 0000000000..6e0b50a569 --- /dev/null +++ b/.github/workflows/conformance.yaml @@ -0,0 +1,41 @@ +# 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: conformance +jobs: + conformance: + 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: 8 + - uses: actions/setup-go@v5 + with: + go-version: '>=1.20.2' + - run: java -version + - run: go version + - run: .kokoro/conformance.sh diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml new file mode 100644 index 0000000000..b75ed7afad --- /dev/null +++ b/.github/workflows/hermetic_library_generation.yaml @@ -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 +# +# 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. +name: Hermetic library generation upon generation config change through pull requests +on: + pull_request: + +env: + REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} + GITHUB_REPOSITORY: ${{ github.repository }} +jobs: + library_generation: + runs-on: ubuntu-latest + steps: + - name: Determine whether the pull request comes from a fork + run: | + if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then + echo "This PR comes from a fork. Skip library generation." + echo "SHOULD_RUN=false" >> $GITHUB_ENV + else + echo "SHOULD_RUN=true" >> $GITHUB_ENV + fi + - uses: actions/checkout@v4 + if: env.SHOULD_RUN == 'true' + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - uses: googleapis/sdk-platform-java/.github/scripts@v2.68.0 + if: env.SHOULD_RUN == 'true' + with: + base_ref: ${{ github.base_ref }} + head_ref: ${{ github.head_ref }} + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} diff --git a/.github/workflows/renovate_config_check.yaml b/.github/workflows/renovate_config_check.yaml new file mode 100644 index 0000000000..47b9e87c98 --- /dev/null +++ b/.github/workflows/renovate_config_check.yaml @@ -0,0 +1,25 @@ +name: Renovate Bot Config Validation + +on: + pull_request: + paths: + - 'renovate.json' + +jobs: + renovate_bot_config_validation: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install Renovate and Config Validator + run: | + npm install -g npm@latest + npm install --global renovate + renovate-config-validator diff --git a/.github/workflows/samples.yaml b/.github/workflows/samples.yaml index c46230a78c..186fd8bcfc 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -1,3 +1,18 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Github action job to test core java library features on +# downstream client libraries before they are released. on: pull_request: name: samples @@ -5,10 +20,11 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - java-version: 8 + distribution: temurin + java-version: 17 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check working-directory: samples/snippets diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml new file mode 100644 index 0000000000..fa2fca7f1d --- /dev/null +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -0,0 +1,19 @@ +on: + pull_request: +name: Unmanaged dependency check +jobs: + unmanaged_dependency_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + - name: Install modules + shell: bash + run: .kokoro/build.sh + - name: Unmanaged dependency check + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.58.0 + with: + bom-path: google-cloud-bigtable-bom/pom.xml diff --git a/.github/workflows/update_generation_config.yaml b/.github/workflows/update_generation_config.yaml new file mode 100644 index 0000000000..8de9d67eae --- /dev/null +++ b/.github/workflows/update_generation_config.yaml @@ -0,0 +1,47 @@ +# 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. +# GitHub action job to test core java library features on +# downstream client libraries before they are released. +name: Update generation configuration +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +jobs: + update-generation-config: + runs-on: ubuntu-24.04 + env: + # the branch into which the pull request is merged + base_branch: main + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} + - name: Install Dependencies + shell: bash + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + - name: Update params in generation config to latest + shell: bash + run: | + set -x + [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" + bash .github/scripts/update_generation_config.sh \ + --base_branch "${base_branch}" \ + --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }} + diff --git a/.gitignore b/.gitignore index dbde6a740b..4a670f8c53 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ api_key artman-genfiles .flattened-pom.xml +dependency-reduced-pom.xml diff --git a/.kokoro/build.bat b/.kokoro/build.bat index 05826ad93f..067cf4a4c4 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,3 +1,18 @@ +:: Copyright 2022 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. :: See documentation in type-shell-output.bat "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 429232f651..63ae42ebf8 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -1,11 +1,11 @@ #!/bin/bash -# Copyright 2019 Google LLC +# 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 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -23,8 +23,8 @@ cd ${scriptDir}/.. # include common functions source ${scriptDir}/common.sh -# Print out Java version -java -version +# Print out Maven & Java version +mvn -version echo ${JOB_TYPE} # attempt to install 3 times with exponential backoff (starting with 10 seconds) @@ -37,25 +37,27 @@ retry_with_backoff 3 10 \ -Dgcloud.download.skip=true \ -T 1C -# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it +# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS}) fi + RETURN_CODE=0 set +e case ${JOB_TYPE} in test) - mvn test -B -Dclirr.skip=true -Denforcer.skip=true + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + mvn test -B -ntp -Dfmt.skip=true -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} RETURN_CODE=$? ;; lint) - mvn com.coveo:fmt-maven-plugin:check + mvn com.spotify.fmt:fmt-maven-plugin:check -B -ntp RETURN_CODE=$? ;; javadoc) - mvn javadoc:javadoc javadoc:test-javadoc + mvn javadoc:javadoc javadoc:test-javadoc -B -ntp -Dfmt.skip=true RETURN_CODE=$? ;; integration) @@ -65,10 +67,18 @@ integration) -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ + -Dcheckstyle.skip=true \ + -DskipUnitTests=true \ + -Dfmt.skip=true \ -fae \ verify RETURN_CODE=$? ;; +graalvm) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test -Dfmt.skip=true + RETURN_CODE=$? + ;; samples) SAMPLES_DIR=samples # only run ITs in snapshot/ on presubmit PRs. run ITs in all 3 samples/ subdirectories otherwise. @@ -79,13 +89,18 @@ samples) if [[ -f ${SAMPLES_DIR}/pom.xml ]] then + for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do + [[ -f "$FILE" ]] || continue + source "$FILE" + done + pushd ${SAMPLES_DIR} mvn -B \ - -Penable-samples \ -ntp \ -DtrimStackTrace=false \ -Dclirr.skip=true \ -Denforcer.skip=true \ + -Dfmt.skip=true \ -fae \ verify RETURN_CODE=$? @@ -95,7 +110,7 @@ samples) fi ;; clirr) - mvn -B -Denforcer.skip=true clirr:check + mvn -B -ntp -Dfmt.skip=true -Denforcer.skip=true clirr:check RETURN_CODE=$? ;; *) @@ -110,7 +125,7 @@ fi # fix output location of logs bash .kokoro/coerce_logs.sh -if [[ "${ENABLE_BUILD_COP}" == "true" ]] +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] then chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-bigtable diff --git a/.kokoro/coerce_logs.sh b/.kokoro/coerce_logs.sh index 5cf7ba49e6..46edbf7f2f 100755 --- a/.kokoro/coerce_logs.sh +++ b/.kokoro/coerce_logs.sh @@ -28,7 +28,6 @@ job=$(basename ${KOKORO_JOB_NAME}) echo "coercing sponge logs..." for xml in `find . -name *-sponge_log.xml` do - echo "processing ${xml}" class=$(basename ${xml} | cut -d- -f2) dir=$(dirname ${xml})/${job}/${class} text=$(dirname ${xml})/${class}-sponge_log.txt diff --git a/.kokoro/common.sh b/.kokoro/common.sh index ace89f45a9..f8f957af11 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -55,4 +55,6 @@ function retry_with_backoff { ## Helper functionss function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; } function msg() { println "$*" >&2; } -function println() { printf '%s\n' "$(now) $*"; } \ No newline at end of file +function println() { printf '%s\n' "$(now) $*"; } + +## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/.kokoro/conformance.sh b/.kokoro/conformance.sh new file mode 100755 index 0000000000..4f0a7d4999 --- /dev/null +++ b/.kokoro/conformance.sh @@ -0,0 +1,89 @@ +#!/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} + +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -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 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 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 ../../test-proxy/known_failures.txt`'" + returnCode=$? + popd + + # Stop the proxy + kill ${proxyPID} + + 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/continuous/readme.cfg b/.kokoro/continuous/readme.cfg deleted file mode 100644 index 5b59996afa..0000000000 --- a/.kokoro/continuous/readme.cfg +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/readme.sh" -} - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - regex: "**/*sponge_log.log" - } -} - -# The github token is stored here. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - # TODO(theacodes): remove this after secrets have globally propagated - backend_type: FASTCONFIGPUSH - } - } -} - -# Common env vars for all repositories and builds. -env_vars: { - key: "GITHUB_USER" - value: "yoshi-automation" -} -env_vars: { - key: "GITHUB_EMAIL" - value: "yoshi-automation@google.com" -} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index 0fb8c8436c..bd8960246f 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -14,6 +14,7 @@ # limitations under the License. set -eo pipefail +shopt -s nullglob ## Get the directory of the build script scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) @@ -27,63 +28,32 @@ source ${scriptDir}/common.sh java -version echo $JOB_TYPE -export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" +function determineMavenOpts() { + local javaVersion=$( + # filter down to the version line, then pull out the version between quotes, + # then trim the version number down to its minimal number (removing any + # update or suffix number). + java -version 2>&1 | grep "version" \ + | sed -E 's/^.*"(.*?)".*$/\1/g' \ + | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' + ) + + if [[ $javaVersion == 17* ]] + then + # MaxPermSize is no longer supported as of jdk 17 + echo -n "-Xmx1024m" + else + echo -n "-Xmx1024m -XX:MaxPermSize=128m" + fi +} + +export MAVEN_OPTS=$(determineMavenOpts) # this should run maven enforcer retry_with_backoff 3 10 \ mvn install -B -V -ntp \ -DskipTests=true \ + -Dmaven.javadoc.skip=true \ -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true - -echo "****************** DEPENDENCY LIST COMPLETENESS CHECK *******************" -## Run dependency list completeness check -function completenessCheck() { - # Output dep list with compile scope generated using the original pom - # Running mvn dependency:list on Java versions that support modules will also include the module of the dependency. - # This is stripped from the output as it is not present in the flattened pom. - # Only dependencies with 'compile' or 'runtime' scope are included from original dependency list. - msg "Generating dependency list using original pom..." - mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt - - # Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes) - msg "Generating dependency list using flattened pom..." - mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt - - # Compare two dependency lists - msg "Comparing dependency lists..." - diff .org-list.txt .new-list.txt >.diff.txt - if [[ $? == 0 ]] - then - msg "Success. No diff!" - else - msg "Diff found. See below: " - msg "You can also check .diff.txt file located in $1." - cat .diff.txt - return 1 - fi -} - -# Allow failures to continue running the script -set +e - -error_count=0 -for path in $(find -name ".flattened-pom.xml") -do - # Check flattened pom in each dir that contains it for completeness - dir=$(dirname "$path") - pushd "$dir" - completenessCheck "$dir" - error_count=$(($error_count + $?)) - popd -done - -if [[ $error_count == 0 ]] -then - msg "All checks passed." - exit 0 -else - msg "Errors found. See log statements above." - exit 1 -fi diff --git a/.kokoro/nightly/integration.cfg b/.kokoro/nightly/integration.cfg index 6f27f37c29..bbb1d6468b 100644 --- a/.kokoro/nightly/integration.cfg +++ b/.kokoro/nightly/integration.cfg @@ -8,7 +8,7 @@ env_vars: { env_vars: { key: "INTEGRATION_TEST_ARGS" - value: "-P bigtable-emulator-it,bigtable-prod-it -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests" + 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: { diff --git a/.kokoro/nightly/java11-integration.cfg b/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 0000000000..6a6ef94eff --- /dev/null +++ b/.kokoro/nightly/java11-integration.cfg @@ -0,0 +1,38 @@ +# 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/java11014" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# 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: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + diff --git a/.kokoro/presubmit/graalvm-native-a.cfg b/.kokoro/presubmit/graalvm-native-a.cfg new file mode 100644 index 0000000000..de4ac9dbfa --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-a.cfg @@ -0,0 +1,38 @@ +# 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.58.0" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# 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" +} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-b.cfg b/.kokoro/presubmit/graalvm-native-b.cfg new file mode 100644 index 0000000000..d8ae3b3222 --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-b.cfg @@ -0,0 +1,38 @@ +# 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_b:3.58.0" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# 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" +} \ No newline at end of file diff --git a/.kokoro/presubmit/graalvm-native-c.cfg b/.kokoro/presubmit/graalvm-native-c.cfg new file mode 100644 index 0000000000..0e9d1203a7 --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-c.cfg @@ -0,0 +1,38 @@ +# 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_c:3.58.0" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# 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" +} \ No newline at end of file diff --git a/.kokoro/presubmit/integration-dp.cfg b/.kokoro/presubmit/integration-dp.cfg new file mode 100644 index 0000000000..0b01a0db0e --- /dev/null +++ b/.kokoro/presubmit/integration-dp.cfg @@ -0,0 +1,38 @@ +# 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/java8" +} + +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" +} + +# 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" +} diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg index 850ea7e579..75fe18007c 100644 --- a/.kokoro/presubmit/integration.cfg +++ b/.kokoro/presubmit/integration.cfg @@ -8,7 +8,7 @@ env_vars: { env_vars: { key: "INTEGRATION_TEST_ARGS" - value: "-P bigtable-emulator-it,bigtable-prod-it -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests" + 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: { diff --git a/.kokoro/readme.sh b/.kokoro/readme.sh deleted file mode 100755 index 7f33fff9d0..0000000000 --- a/.kokoro/readme.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -cd ${KOKORO_ARTIFACTS_DIR}/github/java-bigtable - -# Disable buffering, so that the logs stream through. -export PYTHONUNBUFFERED=1 - -# Kokoro exposes this as a file, but the scripts expect just a plain variable. -export GITHUB_TOKEN=$(cat ${KOKORO_KEYSTORE_DIR}/73713_yoshi-automation-github-key) - -# Setup git credentials -echo "https://${GITHUB_TOKEN}:@github.com" >> ~/.git-credentials -git config --global credential.helper 'store --file ~/.git-credentials' - -python3.6 -m pip install git+https://github.com/googleapis/synthtool.git#egg=gcp-synthtool - -set +e -python3.6 -m autosynth.synth \ - --repository=googleapis/java-bigtable \ - --synth-file-name=.github/readme/synth.py \ - --metadata-path=.github/readme/synth.metadata \ - --pr-title="chore: regenerate README" \ - --branch-suffix="readme" - -# autosynth returns 28 to signal there are no changes -RETURN_CODE=$? -if [[ ${RETURN_CODE} -ne 0 && ${RETURN_CODE} -ne 28 ]] -then - exit ${RETURN_CODE} -fi diff --git a/.kokoro/release/bump_snapshot.cfg b/.kokoro/release/bump_snapshot.cfg deleted file mode 100644 index 010d4b38fa..0000000000 --- a/.kokoro/release/bump_snapshot.cfg +++ /dev/null @@ -1,53 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-bigtable/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/bump_snapshot.sh" -} - -# tokens used by release-please to keep an up-to-date release PR. -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-key-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-token-release-please" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "github-magic-proxy-url-release-please" - } - } -} diff --git a/.kokoro/release/bump_snapshot.sh b/.kokoro/release/bump_snapshot.sh deleted file mode 100755 index 5bfbdfa0c5..0000000000 --- a/.kokoro/release/bump_snapshot.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# 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. - -set -eo pipefail - -export NPM_CONFIG_PREFIX=/home/node/.npm-global - -if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then - # Groom the snapshot release PR immediately after publishing a release - npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ - --repo-url=googleapis/java-bigtable \ - --package-name="google-cloud-bigtable" \ - --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ - --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ - --snapshot \ - --release-type=java-auth-yoshi -fi diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg deleted file mode 100644 index 40fa8799b9..0000000000 --- a/.kokoro/release/common.cfg +++ /dev/null @@ -1,49 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "java-bigtable/.kokoro/trampoline.sh" - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java8" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - } -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 70247 - keyname: "sonatype-credentials" - } - } -} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh deleted file mode 100755 index 6e3f65999b..0000000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2018 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. - -set -eo pipefail - -# Get secrets from keystore and set and environment variables -setup_environment_secrets() { - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - export GPG_TTY=$(tty) - export GPG_HOMEDIR=/gpg - mkdir $GPG_HOMEDIR - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg - export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') -} - -create_settings_xml_file() { - echo " - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - sonatype-nexus-snapshots - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - -" > $1 -} \ No newline at end of file diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg deleted file mode 100644 index 0eeb645725..0000000000 --- a/.kokoro/release/drop.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/drop.sh" -} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh deleted file mode 100755 index 5c4551efa2..0000000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Copyright 2018 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. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:drop -B \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg deleted file mode 100644 index 0e93aade6b..0000000000 --- a/.kokoro/release/promote.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/promote.sh" -} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh deleted file mode 100755 index 1fa95fa537..0000000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright 2018 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. - -set -eo pipefail - -# STAGING_REPOSITORY_ID must be set -if [ -z "${STAGING_REPOSITORY_ID}" ]; then - echo "Missing STAGING_REPOSITORY_ID environment variable" - exit 1 -fi - -source $(dirname "$0")/common.sh - -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml \ - -DstagingRepositoryId=${STAGING_REPOSITORY_ID} diff --git a/.kokoro/release/publish_javadoc.cfg b/.kokoro/release/publish_javadoc.cfg deleted file mode 100644 index 36a374da31..0000000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,29 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/doc-templates/" - -env_vars: { - key: "STAGING_BUCKET" - value: "docs-staging" -} - -# cloud-rad staging -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2-staging" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/publish_javadoc.sh" -} - - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} \ No newline at end of file diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index 8d29687e46..0000000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -# 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. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET}" ]]; then - echo "Need to set STAGING_BUCKET environment variable" - exit 1 -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install gcp-docuploader - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-bigtable -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# build the docs -mvn site -B -q - -pushd target/site/apidocs - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET} - -popd - -# V2 due to problems w/ the released javadoc plugin doclava, Java 8 is required. Beware of accidental updates. - -mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/" - -pushd target/devsite/reference - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload docs to staging bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} diff --git a/.kokoro/release/publish_javadoc11.cfg b/.kokoro/release/publish_javadoc11.cfg deleted file mode 100644 index a7d1ceb84c..0000000000 --- a/.kokoro/release/publish_javadoc11.cfg +++ /dev/null @@ -1,30 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# cloud-rad production -env_vars: { - key: "STAGING_BUCKET_V2" - value: "docs-staging-v2" -} - -# Configure the docker image for kokoro-trampoline -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/publish_javadoc11.sh" -} - -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "docuploader_service_account" - } - } -} - -# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/ -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx" diff --git a/.kokoro/release/publish_javadoc11.sh b/.kokoro/release/publish_javadoc11.sh deleted file mode 100755 index 9ff2a5a70b..0000000000 --- a/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# Copyright 2021 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. - -set -eo pipefail - -if [[ -z "${CREDENTIALS}" ]]; then - CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account -fi - -if [[ -z "${STAGING_BUCKET_V2}" ]]; then - echo "Need to set STAGING_BUCKET_V2 environment variable" - exit 1 -fi - -# work from the git root directory -pushd $(dirname "$0")/../../ - -# install docuploader package -python3 -m pip install gcp-docuploader - -# compile all packages -mvn clean install -B -q -DskipTests=true - -export NAME=google-cloud-bigtable -export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3) - -# V3 generates docfx yml from javadoc -# generate yml -mvn clean site -B -q -P docFX - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --language java - -# upload yml to production bucket -python3 -m docuploader upload . \ - --credentials ${CREDENTIALS} \ - --staging-bucket ${STAGING_BUCKET_V2} \ - --destination-prefix docfx- diff --git a/.kokoro/release/snapshot.cfg b/.kokoro/release/snapshot.cfg deleted file mode 100644 index 204b0ddaa4..0000000000 --- a/.kokoro/release/snapshot.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/snapshot.sh" -} \ No newline at end of file diff --git a/.kokoro/release/snapshot.sh b/.kokoro/release/snapshot.sh deleted file mode 100755 index 098168a737..0000000000 --- a/.kokoro/release/snapshot.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# 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. - -set -eo pipefail - -source $(dirname "$0")/common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -# ensure we're trying to push a snapshot (no-result returns non-zero exit code) -grep SNAPSHOT versions.txt - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -mvn clean install deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg deleted file mode 100644 index 2ab56e7b0a..0000000000 --- a/.kokoro/release/stage.cfg +++ /dev/null @@ -1,19 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/java-bigtable/.kokoro/release/stage.sh" -} - -# Need to save the properties file -action { - define_artifacts { - regex: "github/java-bigtable/target/nexus-staging/staging/*.properties" - strip_prefix: "github/java-bigtable" - } -} - -env_vars: { - key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh deleted file mode 100755 index 16126d2eb5..0000000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# Copyright 2018 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. - -set -eo pipefail - -# Start the releasetool reporter -python3 -m pip install gcp-releasetool -python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script - -source $(dirname "$0")/common.sh -source $(dirname "$0")/../common.sh -MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml -pushd $(dirname "$0")/../../ - -setup_environment_secrets -create_settings_xml_file "settings.xml" - -# attempt to stage 3 times with exponential backoff (starting with 10 seconds) -retry_with_backoff 3 10 \ - mvn clean install deploy -B \ - --settings ${MAVEN_SETTINGS_FILE} \ - -DskipTests=true \ - -DperformRelease=true \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} - -if [[ -n "${AUTORELEASE_PR}" ]] -then - mvn nexus-staging:release -B \ - -DperformRelease=true \ - --settings=settings.xml -fi \ No newline at end of file diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index 9da0f83987..8b69b793c9 100644 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google Inc. +# 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. diff --git a/.readme-partials.yml b/.readme-partials.yml index dd804349e4..1dc60bd7a7 100644 --- a/.readme-partials.yml +++ b/.readme-partials.yml @@ -1,7 +1,7 @@ custom_content: | ## About Cloud Bigtable - [Cloud Bigtable][cloud-bigtable] is Google's NoSQL Big Data database service. It's + [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. @@ -115,207 +115,80 @@ custom_content: | TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). - ## Client request tracing: OpenCensus Tracing - - Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/), - which gives insight into the client internals and aids in debugging production issues. - By default, the functionality is disabled. For example to enable tracing using - [Google Stackdriver](https://cloud.google.com/trace/docs/): - - [//]: # (TODO: figure out how to keep opencensus version in sync with pom.xml) - - If you are using Maven, add this to your pom.xml file - ```xml - - io.opencensus - opencensus-impl - 0.24.0 - runtime - - - io.opencensus - opencensus-exporter-trace-stackdriver - 0.24.0 - - - io.grpc - * - - - com.google.auth - * - - - - ``` - If you are using Gradle, add this to your dependencies - ```Groovy - compile 'io.opencensus:opencensus-impl:0.24.0' - compile 'io.opencensus:opencensus-exporter-trace-stackdriver:0.24.0' - ``` - If you are using SBT, add this to your dependencies - ```Scala - libraryDependencies += "io.opencensus" % "opencensus-impl" % "0.24.0" - libraryDependencies += "io.opencensus" % "opencensus-exporter-trace-stackdriver" % "0.24.0" - ``` + ## Client side metrics - At the start of your application configure the exporter: + 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. - ```java - import io.opencensus.exporter.trace.stackdriver.StackdriverTraceConfiguration; - import io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter; + 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. - StackdriverTraceExporter.createAndRegister( - StackdriverTraceConfiguration.builder() - .setProjectId("YOUR_PROJECT_ID") - .build()); - ``` + 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. - You can view the traces on the Google Cloud Platform Console - [Trace](https://console.cloud.google.com/traces) page. + ### Opt-out client side metrics - By default traces are [sampled](https://opencensus.io/tracing/sampling) at a rate of about 1/10,000. - You can configure a higher rate by updating the active tracing params: + You can opt-out client side metrics with the following settings: ```java - import io.opencensus.trace.Tracing; - import io.opencensus.trace.samplers.Samplers; - - Tracing.getTraceConfig().updateActiveTraceParams( - Tracing.getTraceConfig().getActiveTraceParams().toBuilder() - .setSampler(Samplers.probabilitySampler(0.01)) - .build() - ); + BigtableDataSettings settings = BigtableDataSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .build(); ``` - ## Enabling Cloud Bigtable Metrics: OpenCensus Stats - - Cloud Bigtable client supports [Opencensus Metrics](https://opencensus.io/stats/), - which gives insight into the client internals and aids in debugging production issues. - All Cloud Bigtable Metrics are prefixed with `cloud.google.com/java/bigtable/`. The - metrics will be tagged with: - * `bigtable_project_id`: the project that contains the target Bigtable instance. - Please note that this id could be different from project that the client is running - in and different from the project where the metrics are exported to. - * `bigtable_instance_id`: the instance id of the target Bigtable instance - * `bigtable_app_profile_id`: the app profile id that is being used to access the target - Bigtable instance - - ### Available operation level metric views: - - * `cloud.google.com/java/bigtable/op_latency`: A distribution of latency of - each client method call, across all of it's RPC attempts. Tagged by - operation name and final response status. - - * `cloud.google.com/java/bigtable/completed_ops`: The total count of - method invocations. Tagged by operation name and final response status. - - * `cloud.google.com/java/bigtable/read_rows_first_row_latency`: A - distribution of the latency of receiving the first row in a ReadRows - operation. - - * `cloud.google.com/java/bigtable/attempt_latency`: A distribution of latency of - each client RPC, tagged by operation name and the attempt status. Under normal - circumstances, this will be identical to op_latency. However, when the client - receives transient errors, op_latency will be the sum of all attempt_latencies - and the exponential delays. - - * `cloud.google.com/java/bigtable/attempts_per_op`: A distribution of attempts that - each operation required, tagged by operation name and final operation status. - Under normal circumstances, this will be 1. - - ### GFE metric views: - * `cloud.google.com/java/bigtable/gfe_latency`: A distribution of the latency - between Google's network receives an RPC and reads back the first byte of - the response. - - * `cloud.google.com/java/bigtable/gfe_header_missing_count`: A counter of the - number of RPC responses received without the server-timing header, which - indicates that the request probably never reached Google's network. - - By default, the functionality is disabled. For example to enable metrics using - [Google Stackdriver](https://cloud.google.com/monitoring/docs/): - - - [//]: # (TODO: figure out how to keep opencensus version in sync with pom.xml) - - If you are using Maven, add this to your pom.xml file - ```xml - - io.opencensus - opencensus-impl - 0.24.0 - runtime - - - io.opencensus - opencensus-exporter-stats-stackdriver - 0.24.0 - - - io.grpc - * - - - com.google.auth - * - - - - ``` - If you are using Gradle, add this to your dependencies - ```Groovy - compile 'io.opencensus:opencensus-impl:0.24.0' - compile 'io.opencensus:opencensus-exporter-stats-stackdriver:0.24.0' - ``` - If you are using SBT, add this to your dependencies - ```Scala - libraryDependencies += "io.opencensus" % "opencensus-impl" % "0.24.0" - libraryDependencies += "io.opencensus" % "opencensus-exporter-stats-stackdriver" % "0.24.0" - ``` + ### Use a custom OpenTelemetry instance - At the start of your application configure the exporter and enable the Bigtable stats views: + 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. - ```java - import io.opencensus.exporter.stats.stackdriver.StackdriverStatsConfiguration; - import io.opencensus.exporter.stats.stackdriver.StackdriverStatsExporter; + ### Disable Bigtbale traces - StackdriverStatsExporter.createAndRegister( - StackdriverStatsConfiguration.builder() - .setProjectId("YOUR_PROJECT_ID") - .build() - ); + If your application already has tracing integration and you want to disable Bigtable + traces, you can do the following: - BigtableDataSettings.enableOpenCensusStats(); - // Enable GFE metric views - BigtableDataSettings.enableGfeOpenCensusStats(); + ```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"; + } + } ``` - You can view the metrics on the Google Cloud Platform Console - [Metrics explorer](https://console.cloud.google.com/monitoring/metrics-explorer) - page. - - You can configure how frequently metrics are pushed to StackDriver and the - [Monitored resource type](https://cloud.google.com/monitoring/api/resources) by - updating `StackdriverStatsConfiguration`: - - ``` java - // Example: configuring export interval and monitored resource type - StackdriverStatsExporter.createAndRegister( - StackdriverStatsConfiguration.builder() - .setProjectId("YOUR_PROJECT_ID") - // Exporting metrics every 10 seconds - .setExportInterval(Duration.create(10, 0)) - // Configure monitored resource type. A common practice is to use the - // monitored resource objects that represent the physical resources - // where your application code is running. See the full list of - // monitored resource type here: - // https://cloud.google.com/monitoring/api/resources - .setMonitoredResource(MonitoredResource.newBuilder() - .setType("global") - .putLabels("project_id", "YOUR_PROJECT_ID") - .build()) - .build() + And use this sampler in your trace config: + ```java + Tracing.getTraceConfig().updateActiveTraceParams( + Tracing.getTraceConfig().getActiveTraceParams().toBuilder() + .setSampler(new MySampler(Samplers.probabilitySampler(0.1))) + .build() ); ``` diff --git a/.repo-metadata.json b/.repo-metadata.json index 238d7852fc..8ac2726bf0 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -1,14 +1,21 @@ { - "name": "bigtable", + "api_shortname": "bigtable", "name_pretty": "Cloud Bigtable", "product_documentation": "https://cloud.google.com/bigtable", - "client_documentation": "https://googleapis.dev/java/google-cloud-bigtable/latest/index.html", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", - "release_level": "ga", + "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/java-bigtable", "repo_short": "java-bigtable", "distribution_name": "com.google.cloud:google-cloud-bigtable", - "codeowner_team": "@googleapis/api-bigtable", - "api_id": "bigtable.googleapis.com" -} + "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/CHANGELOG.md b/CHANGELOG.md index 03f6c7818e..f753300e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,2093 @@ # Changelog +## [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) + + +### 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) + + +### 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) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 48b0fa29b0..02aed7c1d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,6 +15,14 @@ You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again. +## Developing + +This project relocates some of its internal dependencies. Since IDEs can't resolve the relocated symbols on their own, +a workaround is: + +1. Install the shaded module `mvn install -pl google-cloud-bigtable-stats` +2. Disable the `with-shaded` profile to force IDEs to resolve the relocated dependencies from the local repository + ## Code reviews All submissions, including submissions by project members, require review. We @@ -30,8 +38,10 @@ This project follows ## Running Tests +### Integration Tests + Bigtable integration tests can either be run against an emulator or a real Bigtable instance. -The target environment can be selected by setting a maven profile. By default it is set to +The target environment can be selected by setting a maven profile. By default it is set to `bigtable-emulator-it` and other options are `bigtable-prod-it` and `bigtable-directpath-it`. To use the `bigtable-prod-it` and `bigtable-directpath-it` environments: @@ -39,7 +49,7 @@ To use the `bigtable-prod-it` and `bigtable-directpath-it` environments: 1. Set up the target table using scripts/setup-test-table.sh 2. Download the JSON service account credentials file from the Google Developer's Console. 3. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the credentials file -4. Enable the profile and the system properties `bigtable.project`, `bigtable.instance` +4. Enable the profile and the system properties `bigtable.project`, `bigtable.instance` and `bigtable.table` to created earlier. Example: ```bash mvn verify \ @@ -60,4 +70,29 @@ mvn install -DskipUnitTests # To skip all tests mvn install -DskipTests -``` \ No newline at end of file +``` + +### Conformance Tests + +Bigtable Conformance Tests test the correctness of the client behavior and must be run for all code changes. +When adding a new feature, conformance tests must be run with the feature enabled. + +Refer to the [Test Proxy](https://github.com/googleapis/java-bigtable/tree/main/test-proxy#cbt-java-test-proxy) page +on how to run conformance tests. + +## Formatting the code + +To auto-format any code changes, run ``mvn com.spotify.fmt:fmt-maven-plugin:format``. + +## Native Image Testing +Native Image testing is enabled for tests that follow a particular naming +convention (`IT*` or `*ClientTest`). Unit tests that use Mockito or EasyMock +have been excluded for the time being as they are not compatible with native +image compilation. + +## Rollback plan + +A rollback plan is required for all new features. The rollback plan should include: + +1. How to disable this feature from the server side. +2. For features that are strictly client side, what the risks are, and what tests are done. diff --git a/README.md b/README.md index 05a04d22fd..d19eb5e2e5 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,18 @@ Java idiomatic client for [Cloud Bigtable][product-docs]. - [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 +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + ```xml com.google.cloud libraries-bom - 18.0.0 + 26.69.0 pom import @@ -32,45 +34,53 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file ``` -If you are using Maven without BOM, add this to your dependencies: +If you are using Maven without the BOM, add this to your dependencies: + ```xml com.google.cloud google-cloud-bigtable - 1.20.1 + 2.67.0 ``` -If you are using Gradle 5.x or later, add this to your dependencies +If you are using Gradle 5.x or later, add this to your dependencies: + ```Groovy -implementation platform('com.google.cloud:libraries-bom:18.0.0') +implementation platform('com.google.cloud:libraries-bom:26.79.0') -compile 'com.google.cloud:google-cloud-bigtable' +implementation 'com.google.cloud:google-cloud-bigtable' ``` -If you are using Gradle without BOM, add this to your dependencies +If you are using Gradle without BOM, add this to your dependencies: + ```Groovy -compile 'com.google.cloud:google-cloud-bigtable:1.20.1' +implementation 'com.google.cloud:google-cloud-bigtable:2.76.0' ``` -If you are using SBT, add this to your dependencies +If you are using SBT, add this to your dependencies: + ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "1.20.1" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.76.0" ``` ## 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 SDK][cloud-sdk] and running the following commands in command line: +[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 @@ -81,7 +91,7 @@ to add `google-cloud-bigtable` as a dependency in your code. ## About Cloud Bigtable -[Cloud Bigtable][product-docs] +[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. @@ -89,7 +99,7 @@ use this Cloud Bigtable Client Library. ## About Cloud Bigtable -[Cloud Bigtable][cloud-bigtable] is Google's NoSQL Big Data database service. It's +[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. @@ -203,207 +213,80 @@ try { TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). -## Client request tracing: OpenCensus Tracing +## Client side metrics -Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/), -which gives insight into the client internals and aids in debugging production issues. -By default, the functionality is disabled. For example to enable tracing using -[Google Stackdriver](https://cloud.google.com/trace/docs/): +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. -[//]: # (TODO: figure out how to keep opencensus version in sync with pom.xml) +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. -If you are using Maven, add this to your pom.xml file -```xml - - io.opencensus - opencensus-impl - 0.24.0 - runtime - - - io.opencensus - opencensus-exporter-trace-stackdriver - 0.24.0 - - - io.grpc - * - - - com.google.auth - * - - - -``` -If you are using Gradle, add this to your dependencies -```Groovy -compile 'io.opencensus:opencensus-impl:0.24.0' -compile 'io.opencensus:opencensus-exporter-trace-stackdriver:0.24.0' -``` -If you are using SBT, add this to your dependencies -```Scala -libraryDependencies += "io.opencensus" % "opencensus-impl" % "0.24.0" -libraryDependencies += "io.opencensus" % "opencensus-exporter-trace-stackdriver" % "0.24.0" -``` +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. -At the start of your application configure the exporter: +### Opt-out client side metrics -```java -import io.opencensus.exporter.trace.stackdriver.StackdriverTraceConfiguration; -import io.opencensus.exporter.trace.stackdriver.StackdriverTraceExporter; - -StackdriverTraceExporter.createAndRegister( - StackdriverTraceConfiguration.builder() - .setProjectId("YOUR_PROJECT_ID") - .build()); -``` - -You can view the traces on the Google Cloud Platform Console -[Trace](https://console.cloud.google.com/traces) page. - -By default traces are [sampled](https://opencensus.io/tracing/sampling) at a rate of about 1/10,000. -You can configure a higher rate by updating the active tracing params: +You can opt-out client side metrics with the following settings: ```java -import io.opencensus.trace.Tracing; -import io.opencensus.trace.samplers.Samplers; - -Tracing.getTraceConfig().updateActiveTraceParams( - Tracing.getTraceConfig().getActiveTraceParams().toBuilder() - .setSampler(Samplers.probabilitySampler(0.01)) - .build() -); +BigtableDataSettings settings = BigtableDataSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .build(); ``` -## Enabling Cloud Bigtable Metrics: OpenCensus Stats - -Cloud Bigtable client supports [Opencensus Metrics](https://opencensus.io/stats/), -which gives insight into the client internals and aids in debugging production issues. -All Cloud Bigtable Metrics are prefixed with `cloud.google.com/java/bigtable/`. The -metrics will be tagged with: - * `bigtable_project_id`: the project that contains the target Bigtable instance. - Please note that this id could be different from project that the client is running - in and different from the project where the metrics are exported to. -* `bigtable_instance_id`: the instance id of the target Bigtable instance -* `bigtable_app_profile_id`: the app profile id that is being used to access the target - Bigtable instance +### Use a custom OpenTelemetry instance -### Available operation level metric views: +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. -* `cloud.google.com/java/bigtable/op_latency`: A distribution of latency of - each client method call, across all of it's RPC attempts. Tagged by - operation name and final response status. +### Disable Bigtbale traces -* `cloud.google.com/java/bigtable/completed_ops`: The total count of - method invocations. Tagged by operation name and final response status. - -* `cloud.google.com/java/bigtable/read_rows_first_row_latency`: A - distribution of the latency of receiving the first row in a ReadRows - operation. - -* `cloud.google.com/java/bigtable/attempt_latency`: A distribution of latency of - each client RPC, tagged by operation name and the attempt status. Under normal - circumstances, this will be identical to op_latency. However, when the client - receives transient errors, op_latency will be the sum of all attempt_latencies - and the exponential delays. - -* `cloud.google.com/java/bigtable/attempts_per_op`: A distribution of attempts that - each operation required, tagged by operation name and final operation status. - Under normal circumstances, this will be 1. - -### GFE metric views: -* `cloud.google.com/java/bigtable/gfe_latency`: A distribution of the latency -between Google's network receives an RPC and reads back the first byte of -the response. - -* `cloud.google.com/java/bigtable/gfe_header_missing_count`: A counter of the -number of RPC responses received without the server-timing header, which -indicates that the request probably never reached Google's network. - -By default, the functionality is disabled. For example to enable metrics using -[Google Stackdriver](https://cloud.google.com/monitoring/docs/): - - -[//]: # (TODO: figure out how to keep opencensus version in sync with pom.xml) - -If you are using Maven, add this to your pom.xml file -```xml - - io.opencensus - opencensus-impl - 0.24.0 - runtime - - - io.opencensus - opencensus-exporter-stats-stackdriver - 0.24.0 - - - io.grpc - * - - - com.google.auth - * - - - -``` -If you are using Gradle, add this to your dependencies -```Groovy -compile 'io.opencensus:opencensus-impl:0.24.0' -compile 'io.opencensus:opencensus-exporter-stats-stackdriver:0.24.0' -``` -If you are using SBT, add this to your dependencies -```Scala -libraryDependencies += "io.opencensus" % "opencensus-impl" % "0.24.0" -libraryDependencies += "io.opencensus" % "opencensus-exporter-stats-stackdriver" % "0.24.0" -``` - -At the start of your application configure the exporter and enable the Bigtable stats views: +If your application already has tracing integration and you want to disable Bigtable +traces, you can do the following: ```java -import io.opencensus.exporter.stats.stackdriver.StackdriverStatsConfiguration; -import io.opencensus.exporter.stats.stackdriver.StackdriverStatsExporter; - -StackdriverStatsExporter.createAndRegister( - StackdriverStatsConfiguration.builder() - .setProjectId("YOUR_PROJECT_ID") - .build() -); - -BigtableDataSettings.enableOpenCensusStats(); -// Enable GFE metric views -BigtableDataSettings.enableGfeOpenCensusStats(); +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"; + } +} ``` -You can view the metrics on the Google Cloud Platform Console -[Metrics explorer](https://console.cloud.google.com/monitoring/metrics-explorer) -page. - -You can configure how frequently metrics are pushed to StackDriver and the -[Monitored resource type](https://cloud.google.com/monitoring/api/resources) by -updating `StackdriverStatsConfiguration`: - -``` java -// Example: configuring export interval and monitored resource type -StackdriverStatsExporter.createAndRegister( - StackdriverStatsConfiguration.builder() - .setProjectId("YOUR_PROJECT_ID") - // Exporting metrics every 10 seconds - .setExportInterval(Duration.create(10, 0)) - // Configure monitored resource type. A common practice is to use the - // monitored resource objects that represent the physical resources - // where your application code is running. See the full list of - // monitored resource type here: - // https://cloud.google.com/monitoring/api/resources - .setMonitoredResource(MonitoredResource.newBuilder() - .setType("global") - .putLabels("project_id", "YOUR_PROJECT_ID") - .build()) - .build() +And use this sampler in your trace config: +```java +Tracing.getTraceConfig().updateActiveTraceParams( + Tracing.getTraceConfig().getActiveTraceParams().toBuilder() + .setSampler(new MySampler(Samplers.probabilitySampler(0.1))) + .build() ); ``` @@ -458,21 +341,33 @@ see [Assign CPU Resources to Containers](https://kubernetes.io/docs/tasks/config ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/java-bigtable/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/java-bigtable/tree/main/samples) directory. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Filters | [source code](https://github.com/googleapis/java-bigtable/blob/master/samples/snippets/src/main/java/com/example/bigtable/Filters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Filters.java) | -| Reads | [source code](https://github.com/googleapis/java-bigtable/blob/master/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Reads.java) | -| Write Batch | [source code](https://github.com/googleapis/java-bigtable/blob/master/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java) | -| Write Conditionally | [source code](https://github.com/googleapis/java-bigtable/blob/master/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java) | -| Write Increment | [source code](https://github.com/googleapis/java-bigtable/blob/master/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java) | -| Write Simple | [source code](https://github.com/googleapis/java-bigtable/blob/master/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java) | -| Hello World | [source code](https://github.com/googleapis/java-bigtable/blob/master/samples/snippets/src/main/java/com/m/examples/bigtable/HelloWorld.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/m/examples/bigtable/HelloWorld.java) | -| Instance Admin Example | [source code](https://github.com/googleapis/java-bigtable/blob/master/samples/snippets/src/main/java/com/m/examples/bigtable/InstanceAdminExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/m/examples/bigtable/InstanceAdminExample.java) | -| Quickstart | [source code](https://github.com/googleapis/java-bigtable/blob/master/samples/snippets/src/main/java/com/m/examples/bigtable/Quickstart.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/m/examples/bigtable/Quickstart.java) | -| Table Admin Example | [source code](https://github.com/googleapis/java-bigtable/blob/master/samples/snippets/src/main/java/com/m/examples/bigtable/TableAdminExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/m/examples/bigtable/TableAdminExample.java) | +| Authorized View Example | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java) | +| Configure Connection Pool | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java) | +| Filters | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/Filters.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Filters.java) | +| Hello World | [source code](https://github.com/googleapis/java-bigtable/blob/main/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java) | +| Instance Admin Example | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java) | +| Key Salting | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/KeySalting.java) | +| Quickstart | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Quickstart.java) | +| Reads | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/Reads.java) | +| Schema Bundle Example | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java) | +| Table Admin Example | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java) | +| Write Aggregate | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java) | +| Write Batch | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java) | +| Write Conditionally | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java) | +| Write Increment | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java) | +| Write Simple | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java) | +| Batch Delete Example | [source code](https://github.com/googleapis/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&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/java-bigtable/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/java-bigtable&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java) | @@ -480,9 +375,53 @@ has instructions for running the samples. To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. -## Java Versions +## Transport + +Cloud Bigtable uses gRPC for the transport layer. -Java 7 or above is required for using this client. +## 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 @@ -490,6 +429,7 @@ Java 7 or above is required for using this client. This library follows [Semantic Versioning](http://semver.org/). + ## Contributing @@ -501,46 +441,36 @@ Please note that this project is released with a Contributor Code of Conduct. By 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. -## CI Status - -Java Version | Status ------------- | ------ -Java 7 | [![Kokoro CI][kokoro-badge-image-1]][kokoro-badge-link-1] -Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] -Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] -Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] -Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] - Java is a registered trademark of Oracle and/or its affiliates. [product-docs]: https://cloud.google.com/bigtable -[javadocs]: https://googleapis.dev/java/google-cloud-bigtable/latest/index.html -[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java7.svg -[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java7.html -[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java8.svg -[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java8.html -[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java8-osx.svg -[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java8-osx.html -[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java8-win.svg -[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java8-win.html -[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.svg -[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-bigtable/java11.html -[stability-image]: https://img.shields.io/badge/stability-ga-green +[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://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-bigtable&core=gav +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-bigtable/2.76.0 [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-sdk]: https://cloud.google.com/sdk/ -[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting -[contributing]: https://github.com/googleapis/java-bigtable/blob/master/CONTRIBUTING.md -[code-of-conduct]: https://github.com/googleapis/java-bigtable/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct -[license]: https://github.com/googleapis/java-bigtable/blob/master/LICENSE - +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-bigtable/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-bigtable/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-bigtable/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/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..8b58ae9c01 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/generation_config.yaml b/generation_config.yaml new file mode 100644 index 0000000000..e52d30a27e --- /dev/null +++ b/generation_config.yaml @@ -0,0 +1,38 @@ +gapic_generator_version: 2.68.0 +googleapis_commitish: cd090841ab172574e740c214c99df00aef9c0dee +libraries_bom_version: 26.79.0 +template_excludes: + - .gitignore + - .kokoro/presubmit/integration.cfg + - .kokoro/presubmit/graalvm-native.cfg + - .kokoro/presubmit/graalvm-native-17.cfg + - .kokoro/nightly/integration.cfg + - .kokoro/presubmit/samples.cfg + - .kokoro/nightly/samples.cfg + - .github/ISSUE_TEMPLATE/bug_report.md + - .github/PULL_REQUEST_TEMPLATE.md + - .github/trusted-contribution.yml + - CONTRIBUTING.md + - codecov.yaml + - .github/release-please.yml + - renovate.json + - .kokoro/requirements.in + - .kokoro/requirements.txt +libraries: +- 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/google-cloud-bigtable-bom/pom.xml b/google-cloud-bigtable-bom/pom.xml index e024c17cc0..2232a1aebc 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -1,126 +1,122 @@ - + 4.0.0 com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom com.google.cloud - google-cloud-shared-config - 0.10.0 + sdk-platform-java-config + 3.59.0 + Google Cloud Bigtable BOM https://github.com/googleapis/java-bigtable - BOM for Google Cloud Bigtable + BOM for Google Cloud Bigtable - Google LLC + Google LLC - - chingor13 - Jeff Ching - chingor@google.com - Google LLC - - Developer - - - - igorberstein - Igor Bernstein - igorbernstein@google.com - Google LLC - - Developer - - + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + igorberstein + Igor Bernstein + igorbernstein@google.com + Google LLC + + Developer + + - scm:git:https://github.com/googleapis/java-bigtable.git - scm:git:git@github.com:googleapis/java-bigtable.git - https://github.com/googleapis/java-bigtable + scm:git:https://github.com/googleapis/java-bigtable.git + scm:git:git@github.com:googleapis/java-bigtable.git + https://github.com/googleapis/java-bigtable - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + - - - com.google.cloud - google-cloud-bigtable - 1.20.2-SNAPSHOT - - - com.google.cloud - google-cloud-bigtable-emulator - 0.129.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-bigtable-admin-v2 - 1.20.2-SNAPSHOT - - - com.google.api.grpc - grpc-google-cloud-bigtable-v2 - 1.20.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-bigtable-admin-v2 - 1.20.2-SNAPSHOT - - - com.google.api.grpc - proto-google-cloud-bigtable-v2 - 1.20.2-SNAPSHOT - - + + + com.google.cloud + google-cloud-bigtable + 2.76.0 + + + com.google.cloud + google-cloud-bigtable-emulator + 0.213.0 + + + com.google.cloud + google-cloud-bigtable-emulator-core + 0.213.0 + + + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + 2.76.0 + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + 2.76.0 + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + 2.76.0 + + + com.google.api.grpc + proto-google-cloud-bigtable-v2 + 2.76.0 + + - - - org.apache.maven.plugins - maven-checkstyle-plugin - - true - - + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + - - - org.apache.maven.plugins - maven-site-plugin + + + org.apache.maven.plugins + maven-site-plugin - - false - - - + + false + + + - \ No newline at end of file + diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index ef7ac258a2..00c88e1c63 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -6,15 +6,17 @@ com.google.cloud - google-cloud-shared-config - 0.10.0 + sdk-platform-java-config + 3.59.0 + com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 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 @@ -51,16 +53,6 @@ https://github.com/googleapis/java-bigtable - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - @@ -70,35 +62,28 @@ - - 1.7.4 - - + com.google.cloud - google-cloud-shared-dependencies - 0.20.0 + gapic-libraries-bom + 1.82.0 pom import - - - - com.google.auto.value - auto-value - ${autovalue.version} - - com.google.auto.value - auto-value-annotations - ${autovalue.version} + com.google.cloud + google-cloud-shared-dependencies + ${google-cloud-shared-dependencies.version} + pom + import + - com.google.errorprone - error_prone_annotations - 2.5.1 + io.opencensus + opencensus-contrib-resource-util + 0.31.1 diff --git a/google-cloud-bigtable-emulator-core/pom.xml b/google-cloud-bigtable-emulator-core/pom.xml new file mode 100644 index 0000000000..e1c6a14801 --- /dev/null +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + + google-cloud-bigtable-parent + com.google.cloud + 2.76.0 + + Google Cloud Java - Bigtable Emulator Core + + google-cloud-bigtable-emulator-core + 0.213.0 + + + 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/google-cloud-bigtable-emulator-core/src/main/java/com/google/cloud/bigtable/emulator/core/EmulatorController.java b/google-cloud-bigtable-emulator-core/src/main/java/com/google/cloud/bigtable/emulator/core/EmulatorController.java new file mode 100644 index 0000000000..960581483b --- /dev/null +++ b/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; + } + } + Thread stdoutThread = pipeStreamToLog(process.getInputStream(), Level.INFO); + Thread 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/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index 35e9b56f7e..314f0c6eb0 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.129.2-SNAPSHOT + 0.213.0 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 1.20.2-SNAPSHOT + 2.76.0 scm:git:git@github.com:googleapis/java-bigtable.git @@ -41,7 +41,7 @@ com.google.cloud google-cloud-gcloud-maven-plugin - 0.1.2 + 0.1.5 @@ -52,8 +52,9 @@ - bigtable-darwin-x86 + bigtable-darwin-arm bigtable-darwin-x86_64 + bigtable-linux-arm bigtable-linux-x86 bigtable-linux-x86_64 bigtable-windows-x86 @@ -68,8 +69,8 @@ org.apache.maven.plugins maven-dependency-plugin - - io.grpc:grpc-netty-shaded + + com.google.api:gax-grpc @@ -80,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import @@ -95,16 +96,29 @@ - + + com.google.cloud + google-cloud-bigtable-emulator-core + 0.213.0 + + com.google.api api-common + + + com.google.guava + guava + io.grpc grpc-api - - provided + + + + com.google.api + gax-grpc @@ -150,12 +164,14 @@ com.google.truth truth test - - - - io.grpc - grpc-netty-shaded - test + + + + + org.checkerframework + checker-qual + + diff --git a/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java b/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java index 3cfbc981ab..32f028f1f0 100644 --- a/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java +++ b/google-cloud-bigtable-emulator/src/main/java/com/google/cloud/bigtable/emulator/v2/Emulator.java @@ -16,26 +16,18 @@ 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.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.ServerSocket; -import java.net.Socket; import java.nio.file.Path; -import java.util.Locale; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import java.util.logging.Level; import java.util.logging.Logger; /** - * Wraps the Bigtable emulator in a java api. + * 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}. @@ -44,102 +36,42 @@ public class Emulator { private static final Logger LOGGER = Logger.getLogger(Emulator.class.getName()); - private final Path executable; - private Process process; - private boolean isStopped = true; - private Thread shutdownHook; - - private int port; + private final EmulatorController controller; private ManagedChannel dataChannel; private ManagedChannel adminChannel; public static Emulator createFromPath(Path path) { - return new Emulator(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 { - String resourcePath = getBundledResourcePath(); - - File tmpEmulator = File.createTempFile("cbtemulator", ""); - tmpEmulator.deleteOnExit(); - - try (InputStream is = Emulator.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 Emulator(tmpEmulator.toPath()); + return new Emulator(EmulatorController.createBundled()); } - private Emulator(Path executable) { - this.executable = executable; + 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 { - if (!isStopped) { - throw new IllegalStateException("Emulator is already started"); - } - this.port = getAvailablePort(); - - // Workaround https://bugs.openjdk.java.net/browse/JDK-8068370 - for (int attemptsLeft = 3; process == null; attemptsLeft--) { - try { - process = Runtime.getRuntime().exec(String.format("%s -port %d", executable, port)); - } catch (IOException e) { - if (attemptsLeft > 0) { - Thread.sleep(1000); - continue; - } - throw e; - } - } - pipeStreamToLog(process.getInputStream(), Level.INFO); - pipeStreamToLog(process.getErrorStream(), Level.WARNING); - isStopped = false; - - shutdownHook = - new Thread() { - @Override - public void run() { - if (!isStopped) { - isStopped = true; - process.destroy(); - } - } - }; - - Runtime.getRuntime().addShutdownHook(shutdownHook); + controller.start(); + } - waitForPort(port); + public synchronized void start(int port) + throws IOException, TimeoutException, InterruptedException { + controller.start(port); } /** Stops the emulator process. */ public synchronized void stop() { - if (isStopped) { - throw new IllegalStateException("Emulator already stopped"); - } + controller.stop(); try { - Runtime.getRuntime().removeShutdownHook(shutdownHook); - shutdownHook = null; - // Shutdown channels in parallel if (dataChannel != null) { dataChannel.shutdownNow(); @@ -160,27 +92,19 @@ public synchronized void stop() { } catch (InterruptedException e) { LOGGER.warning("Interrupted while waiting for client channels to close"); Thread.currentThread().interrupt(); - } finally { - isStopped = true; - process.destroy(); } } public synchronized int getPort() { - if (isStopped) { - throw new IllegalStateException("Emulator is not running"); - } - return port; + return controller.getPort(); } public synchronized ManagedChannel getDataChannel() { - if (isStopped) { - throw new IllegalStateException("Emulator is not running"); - } + Preconditions.checkState(controller.isRunning(), "Emulator is not running"); if (dataChannel == null) { dataChannel = - newChannelBuilder(port) + newChannelBuilder(controller.getPort()) .maxInboundMessageSize(256 * 1024 * 1024) .keepAliveTimeout(10, TimeUnit.SECONDS) .keepAliveTime(10, TimeUnit.SECONDS) @@ -191,107 +115,21 @@ public synchronized ManagedChannel getDataChannel() { } public synchronized ManagedChannel getAdminChannel() { - if (isStopped) { - throw new IllegalStateException("Emulator is not running"); - } + Preconditions.checkState(controller.isRunning(), "Emulator is not running"); if (adminChannel == null) { - adminChannel = newChannelBuilder(port).build(); + adminChannel = newChannelBuilder(controller.getPort()).build(); } return adminChannel; } // - /** 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; - 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 {@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(); } - - /** Creates a thread that will pipe an {@link java.io.InputStream} to this class' Logger. */ - private static void pipeStreamToLog(final InputStream stream, final Level level) { - final BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); - - Thread thread = - new Thread( - new Runnable() { - @Override - public void run() { - 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(); - } // } diff --git a/google-cloud-bigtable-emulator/src/main/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/resource-config.json b/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 0000000000..aa986d630d --- /dev/null +++ b/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/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/BigtableEmulatorRuleTest.java b/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/ITBigtableEmulatorRuleTest.java similarity index 98% rename from google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/BigtableEmulatorRuleTest.java rename to google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/ITBigtableEmulatorRuleTest.java index f0eb965299..00e2969f80 100644 --- a/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/BigtableEmulatorRuleTest.java +++ b/google-cloud-bigtable-emulator/src/test/java/com/google/cloud/bigtable/emulator/v2/ITBigtableEmulatorRuleTest.java @@ -38,7 +38,7 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) -public class BigtableEmulatorRuleTest { +public class ITBigtableEmulatorRuleTest { @Rule public BigtableEmulatorRule bigtableRule = BigtableEmulatorRule.create(); private BigtableTableAdminBlockingStub tableAdminStub; private BigtableBlockingStub dataStub; diff --git a/google-cloud-bigtable-emulator/src/test/resources/META-INF/native-image/com.google.cloud/google-cloud-bigtable-emulator/native-image.properties b/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 0000000000..0c5258dc2c --- /dev/null +++ b/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/google-cloud-bigtable/EnableAutoValue.txt b/google-cloud-bigtable/EnableAutoValue.txt new file mode 100644 index 0000000000..e940c28979 --- /dev/null +++ b/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/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml index ab921a973f..383f60a7c1 100644 --- a/google-cloud-bigtable/clirr-ignored-differences.xml +++ b/google-cloud-bigtable/clirr-ignored-differences.xml @@ -23,4 +23,492 @@ 8001 com/google/cloud/bigtable/gaxx/tracing/WrappedTracerFactory* - \ No newline at end of file + + + 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/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index d8977b2785..9a1da47d24 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -1,8 +1,8 @@ - + 4.0.0 google-cloud-bigtable - 1.20.2-SNAPSHOT + 2.76.0 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 1.20.2-SNAPSHOT + 2.76.0 - 1.20.2-SNAPSHOT + 2.76.0 google-cloud-bigtable @@ -25,13 +25,28 @@ false ${skipTests} ${skipTests} - + + src/test/resources/logging.properties + + + + + batch-bigtable.googleapis.com:443 + + + 1.76.3 + 4.33.2 @@ -39,14 +54,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import @@ -56,7 +71,6 @@ - com.google.api @@ -98,11 +112,6 @@ com.google.auth google-auth-library-oauth2-http - - com.google.auto.value - auto-value - provided - com.google.auto.value auto-value-annotations @@ -134,6 +143,20 @@ 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.opentelemetry + opentelemetry-api + + + org.threeten threetenbp + + + io.opentelemetry + opentelemetry-api + + + 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.api.grpc + grpc-google-cloud-monitoring-v3 + test + com.google.api gax @@ -208,12 +288,31 @@ 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 @@ -229,14 +328,159 @@ 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-all + 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 @@ -259,6 +503,7 @@ emulator + ${bigtable.enable-grpc-logs} ${project.build.directory}/test-grpc-logs/emulator-it @@ -294,6 +539,8 @@ 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 @@ -309,6 +556,57 @@ + + + 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 @@ -324,14 +622,18 @@ 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 - true + REQUIRE_DIRECT_PATH + + true + com.google.cloud.bigtable.data.v2.it.*IT @@ -346,6 +648,45 @@ + + 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 @@ -366,10 +707,14 @@ 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 - true - true + REQUIRE_DIRECT_PATH_IPV4 + + true + com.google.cloud.bigtable.data.v2.it.*IT @@ -386,78 +731,63 @@ - - - src/main/templates - - **/*.java - - true - ${project.build.directory}/generated-sources/java - - + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + - org.codehaus.mojo - build-helper-maven-plugin - 3.2.0 + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 - add-source - generate-sources - add-source + test-compile + test-compile-custom - - - ${project.build.directory}/generated-sources/java/ - - + + + 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.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M3 + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 - - enforce-valid-profile - - - - - + add-source + generate-sources - enforce + add-source - - - - enforce-dependency-upper-bound - - - + + ${project.build.directory}/generated-sources/java/ + - - enforce - - org.apache.maven.plugins maven-dependency-plugin - io.grpc:grpc-auth,io.grpc:grpc-grpclb,com.google.auto.value:auto-value io.opencensus:opencensus-impl-core @@ -470,12 +800,19 @@ true - classes - 2C - 1 - true + + + 4 + false + false + + ${java-log-config} + @@ -485,7 +822,16 @@ ${skipUnitTests} + + + classes + 10 + false + + + src/test/resources/logging.properties + diff --git a/google-cloud-bigtable/src/main/templates/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java similarity index 81% rename from google-cloud-bigtable/src/main/templates/com/google/cloud/bigtable/Version.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 7f87f249dc..b4089da0d3 100644 --- a/google-cloud-bigtable/src/main/templates/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * 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. @@ -19,6 +19,7 @@ @InternalApi("For internal use only") public final class Version { - // The released version, populated by maven. - public static String VERSION = "${java-bigtable.version}"; + // {x-version-update-start:google-cloud-bigtable:current} + public static String VERSION = "2.76.0"; + // {x-version-update-end} } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java index 7a76c1ce98..aadfd5b638 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ package com.google.cloud.bigtable.admin.v2; -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.core.BackgroundResource; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; @@ -39,26 +36,51 @@ 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; @@ -78,9 +100,677 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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; @@ -105,7 +795,6 @@ public static final BaseBigtableInstanceAdminClient create( * Constructs an instance of BaseBigtableInstanceAdminClient, using the given stub for making * calls. This is for advanced usage - prefer using create(BaseBigtableInstanceAdminSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final BaseBigtableInstanceAdminClient create(BigtableInstanceAdminStub stub) { return new BaseBigtableInstanceAdminClient(stub); } @@ -122,7 +811,6 @@ protected BaseBigtableInstanceAdminClient(BaseBigtableInstanceAdminSettings sett this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected BaseBigtableInstanceAdminClient(BigtableInstanceAdminStub stub) { this.settings = null; this.stub = stub; @@ -133,7 +821,6 @@ public final BaseBigtableInstanceAdminSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public BigtableInstanceAdminStub getStub() { return stub; } @@ -150,9 +837,19 @@ public final OperationsClient getOperationsClient() { /** * 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]");
@@ -175,7 +872,7 @@ public final OperationsClient getOperationsClient() {
    * @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. Currently, at most four clusters can be specified.
+   *     must be left blank.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   public final OperationFuture createInstanceAsync(
@@ -194,9 +891,19 @@ public final OperationFuture createInstanceAsy
   /**
    * 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();
@@ -219,7 +926,7 @@ public final OperationFuture createInstanceAsy
    * @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. Currently, at most four clusters can be specified.
+   *     must be left blank.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   public final OperationFuture createInstanceAsync(
@@ -238,9 +945,19 @@ public final OperationFuture createInstanceAsy
   /**
    * 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 =
@@ -266,9 +983,19 @@ public final OperationFuture createInstanceAsy
   /**
    * 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 =
@@ -294,9 +1021,19 @@ public final OperationFuture createInstanceAsy
   /**
    * 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 =
@@ -324,6 +1061,11 @@ public final UnaryCallable createInstanceCalla
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -348,6 +1090,11 @@ public final Instance getInstance(InstanceName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -371,6 +1118,11 @@ public final Instance getInstance(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -395,6 +1147,11 @@ public final Instance getInstance(GetInstanceRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   GetInstanceRequest request =
@@ -419,6 +1176,11 @@ public final UnaryCallable getInstanceCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -445,6 +1207,11 @@ public final ListInstancesResponse listInstances(ProjectName parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -468,6 +1235,11 @@ public final ListInstancesResponse listInstances(String parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -493,6 +1265,11 @@ public final ListInstancesResponse listInstances(ListInstancesRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   ListInstancesRequest request =
@@ -519,6 +1296,11 @@ public final UnaryCallable listInst
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -526,6 +1308,10 @@ public final UnaryCallable listInst
    *           .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);
    * }
@@ -546,6 +1332,11 @@ public final Instance updateInstance(Instance 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   Instance request =
@@ -553,6 +1344,10 @@ public final Instance updateInstance(Instance request) {
    *           .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);
@@ -573,6 +1368,11 @@ public final UnaryCallable updateInstanceCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -605,6 +1405,11 @@ public final OperationFuture partialUpdateInst
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -632,6 +1437,11 @@ public final OperationFuture partialUpdateInst
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -661,6 +1471,11 @@ public final OperationFuture partialUpdateInst
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -687,6 +1502,11 @@ public final OperationFuture partialUpdateInst
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -711,6 +1531,11 @@ public final void deleteInstance(InstanceName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -734,6 +1559,11 @@ public final void deleteInstance(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -758,6 +1588,11 @@ public final void deleteInstance(DeleteInstanceRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   DeleteInstanceRequest request =
@@ -779,9 +1614,19 @@ public final UnaryCallable deleteInstanceCallable(
   /**
    * 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]");
@@ -816,9 +1661,19 @@ public final OperationFuture createClusterAsync(
   /**
    * 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();
@@ -853,9 +1708,19 @@ public final OperationFuture createClusterAsync(
   /**
    * 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 =
@@ -880,9 +1745,19 @@ public final OperationFuture createClusterAsync(
   /**
    * 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 =
@@ -907,9 +1782,19 @@ public final OperationFuture createClusterAsync(
   /**
    * 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 =
@@ -936,6 +1821,11 @@ public final UnaryCallable createClusterCallabl
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -960,6 +1850,11 @@ public final Cluster getCluster(ClusterName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -983,6 +1878,11 @@ public final Cluster getCluster(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1007,6 +1907,11 @@ public final Cluster getCluster(GetClusterRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   GetClusterRequest request =
@@ -1031,6 +1936,11 @@ public final UnaryCallable getClusterCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -1059,6 +1969,11 @@ public final ListClustersResponse listClusters(InstanceName parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1084,6 +1999,11 @@ public final ListClustersResponse listClusters(String parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1109,6 +2029,11 @@ public final ListClustersResponse listClusters(ListClustersRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   ListClustersRequest request =
@@ -1131,9 +2056,17 @@ public final UnaryCallable listCluste
   /**
    * 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 =
@@ -1159,9 +2092,17 @@ public final OperationFuture updateClusterAsync(
   /**
    * 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 =
@@ -1188,9 +2129,17 @@ public final OperationFuture updateClusterAsync(
   /**
    * 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 =
@@ -1212,6 +2161,177 @@ 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. @@ -1219,6 +2339,11 @@ public final UnaryCallable updateClusterCallable() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -1243,6 +2368,11 @@ public final void deleteCluster(ClusterName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1266,6 +2396,11 @@ public final void deleteCluster(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1290,6 +2425,11 @@ public final void deleteCluster(DeleteClusterRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   DeleteClusterRequest request =
@@ -1314,6 +2454,11 @@ public final UnaryCallable deleteClusterCallable()
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -1351,6 +2496,11 @@ public final AppProfile createAppProfile(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1388,6 +2538,11 @@ public final AppProfile createAppProfile(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1415,6 +2570,11 @@ public final AppProfile createAppProfile(CreateAppProfileRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   CreateAppProfileRequest request =
@@ -1442,6 +2602,11 @@ public final UnaryCallable createAppProfile
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -1466,6 +2631,11 @@ public final AppProfile getAppProfile(AppProfileName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1489,6 +2659,11 @@ public final AppProfile getAppProfile(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1513,6 +2688,11 @@ public final AppProfile getAppProfile(GetAppProfileRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   GetAppProfileRequest request =
@@ -1537,6 +2717,11 @@ public final UnaryCallable getAppProfileCallab
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -1568,6 +2753,11 @@ public final ListAppProfilesPagedResponse listAppProfiles(InstanceName parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1596,6 +2786,11 @@ public final ListAppProfilesPagedResponse listAppProfiles(String parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1625,6 +2820,11 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1654,12 +2854,23 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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.getResponsesList()) {
+   *     for (AppProfile element : response.getAppProfilesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -1684,6 +2895,11 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1715,6 +2931,11 @@ public final OperationFuture updateAppProf
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1742,6 +2963,11 @@ public final OperationFuture updateAppProf
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1769,6 +2995,11 @@ public final OperationFuture updateAppProf
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1795,6 +3026,11 @@ public final UnaryCallable updateAppProfileC
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -1819,6 +3055,11 @@ public final void deleteAppProfile(AppProfileName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -1842,6 +3083,79 @@ public final void deleteAppProfile(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -1867,6 +3181,11 @@ public final void deleteAppProfile(DeleteAppProfileRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   DeleteAppProfileRequest request =
@@ -1893,9 +3212,14 @@ public final UnaryCallable deleteAppProfileCalla
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
    *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(resource);
    * }
    * }
@@ -1920,9 +3244,14 @@ public final Policy getIamPolicy(ResourceName 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
    *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(resource);
    * }
    * }
@@ -1944,11 +3273,16 @@ public final Policy getIamPolicy(String 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()) {
    *   GetIamPolicyRequest request =
    *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
    *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(request);
@@ -1970,11 +3304,16 @@ public final Policy getIamPolicy(GetIamPolicyRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   GetIamPolicyRequest request =
    *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
    *   ApiFuture future =
@@ -1995,9 +3334,14 @@ public final UnaryCallable getIamPolicyCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
    *   Policy policy = Policy.newBuilder().build();
    *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(resource, policy);
    * }
@@ -2026,9 +3370,14 @@ public final Policy setIamPolicy(ResourceName resource, Policy 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
    *   Policy policy = Policy.newBuilder().build();
    *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(resource, policy);
    * }
@@ -2054,12 +3403,18 @@ public final Policy setIamPolicy(String resource, Policy 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(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
    *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(request);
    * }
@@ -2079,12 +3434,18 @@ public final Policy setIamPolicy(SetIamPolicyRequest 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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   SetIamPolicyRequest request =
    *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
    *   ApiFuture future =
    *       baseBigtableInstanceAdminClient.setIamPolicyCallable().futureCall(request);
@@ -2104,9 +3465,14 @@ public final UnaryCallable setIamPolicyCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
    *   List permissions = new ArrayList<>();
    *   TestIamPermissionsResponse response =
    *       baseBigtableInstanceAdminClient.testIamPermissions(resource, permissions);
@@ -2137,9 +3503,14 @@ public final TestIamPermissionsResponse testIamPermissions(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
    *   List permissions = new ArrayList<>();
    *   TestIamPermissionsResponse response =
    *       baseBigtableInstanceAdminClient.testIamPermissions(resource, permissions);
@@ -2170,11 +3541,16 @@ public final TestIamPermissionsResponse testIamPermissions(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .addAllPermissions(new ArrayList())
    *           .build();
    *   TestIamPermissionsResponse response =
@@ -2196,11 +3572,16 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .addAllPermissions(new ArrayList())
    *           .build();
    *   ApiFuture future =
@@ -2215,35 +3596,1687 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
     return stub.testIamPermissionsCallable();
   }
 
-  @Override
-  public final void close() {
-    stub.close();
-  }
-
-  @Override
-  public void shutdown() {
-    stub.shutdown();
+  // 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); } - @Override - public boolean isShutdown() { - return stub.isShutdown(); + // 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); } - @Override - public boolean isTerminated() { - return stub.isTerminated(); + // 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); } - @Override - public void shutdownNow() { - stub.shutdownNow(); + // 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(); } - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } + // 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< @@ -2260,12 +5293,7 @@ public static ApiFuture createAsync( ListAppProfilesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListAppProfilesPagedResponse apply(ListAppProfilesPage input) { - return new ListAppProfilesPagedResponse(input); - } - }, + input -> new ListAppProfilesPagedResponse(input), MoreExecutors.directExecutor()); } @@ -2326,4 +5354,241 @@ protected ListAppProfilesFixedSizeCollection createCollection( 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java index 0b5fb183e8..87fa4df55f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,11 @@ 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.core.BetaApi; -import com.google.api.core.InternalApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -38,24 +39,46 @@ 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; @@ -69,9 +92,83 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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 { @@ -97,6 +194,11 @@ public UnaryCallSettings listInstan 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() { @@ -147,6 +249,18 @@ public UnaryCallSettings updateClusterSettings() { 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(); @@ -202,6 +316,102 @@ public UnaryCallSettings setIamPolicySettings() { 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(); @@ -236,7 +446,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return BigtableInstanceAdminStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return BigtableInstanceAdminStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -288,14 +497,13 @@ public BigtableInstanceAdminStubSettings.Builder getStubSettingsBuilder() { return ((BigtableInstanceAdminStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * 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) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; @@ -323,6 +531,11 @@ public UnaryCallSettings.Builder getInstanceSettin 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() { @@ -374,6 +587,19 @@ public UnaryCallSettings.Builder updateClusterSettings() { 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(); @@ -431,6 +657,103 @@ public UnaryCallSettings.Builder setIamPolicySettin 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java index b47b9156fc..7caa206d32 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,8 @@ package com.google.cloud.bigtable.admin.v2; -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.core.BackgroundResource; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; @@ -30,28 +27,44 @@ 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; @@ -59,13 +72,23 @@ 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; @@ -78,15 +101,769 @@ 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. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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; @@ -110,7 +887,6 @@ public static final BaseBigtableTableAdminClient create(BaseBigtableTableAdminSe * Constructs an instance of BaseBigtableTableAdminClient, using the given stub for making calls. * This is for advanced usage - prefer using create(BaseBigtableTableAdminSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final BaseBigtableTableAdminClient create(BigtableTableAdminStub stub) { return new BaseBigtableTableAdminClient(stub); } @@ -127,7 +903,6 @@ protected BaseBigtableTableAdminClient(BaseBigtableTableAdminSettings settings) this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected BaseBigtableTableAdminClient(BigtableTableAdminStub stub) { this.settings = null; this.stub = stub; @@ -138,7 +913,6 @@ public final BaseBigtableTableAdminSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public BigtableTableAdminStub getStub() { return stub; } @@ -159,6 +933,11 @@ public final OperationsClient getOperationsClient() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -194,6 +973,11 @@ public final Table createTable(InstanceName parent, String tableId, Table 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 = InstanceName.of("[PROJECT]", "[INSTANCE]").toString();
@@ -229,6 +1013,11 @@ public final Table createTable(String parent, String tableId, Table 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()) {
    *   CreateTableRequest request =
@@ -257,6 +1046,11 @@ public final Table createTable(CreateTableRequest 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 =
@@ -290,6 +1084,11 @@ public final UnaryCallable createTableCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -336,6 +1135,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -382,6 +1186,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -428,6 +1237,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -474,6 +1288,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -508,6 +1327,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -545,6 +1369,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -573,6 +1402,11 @@ public final OperationFuture createTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -599,6 +1433,11 @@ public final ListTablesPagedResponse listTables(InstanceName parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -624,6 +1463,11 @@ public final ListTablesPagedResponse listTables(String parent) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -652,6 +1496,11 @@ public final ListTablesPagedResponse listTables(ListTablesRequest 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()) {
    *   ListTablesRequest request =
@@ -680,12 +1529,23 @@ public final UnaryCallable listTable
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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.getResponsesList()) {
+   *     for (Table element : response.getTablesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -709,6 +1569,11 @@ public final UnaryCallable listTablesCall
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -733,6 +1598,11 @@ public final Table getTable(TableName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -756,6 +1626,11 @@ public final Table getTable(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -780,6 +1655,11 @@ public final Table getTable(GetTableRequest 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()) {
    *   GetTableRequest request =
@@ -796,6 +1676,143 @@ 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. @@ -803,6 +1820,11 @@ public final UnaryCallable getTableCallable() { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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]");
@@ -827,6 +1849,11 @@ public final void deleteTable(TableName name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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();
@@ -850,6 +1877,11 @@ public final void deleteTable(String name) {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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 =
@@ -874,6 +1906,11 @@ public final void deleteTable(DeleteTableRequest 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()) {
    *   DeleteTableRequest request =
@@ -893,906 +1930,2815 @@ public final UnaryCallable deleteTableCallable() {
 
   // 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.
+   * 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]");
-   *   List modifications = new ArrayList<>();
-   *   Table response = baseBigtableTableAdminClient.modifyColumnFamilies(name, modifications);
+   *   Table response = baseBigtableTableAdminClient.undeleteTableAsync(name).get();
    * }
    * }
* - * @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). + * @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 Table modifyColumnFamilies( - TableName name, List modifications) { - ModifyColumnFamiliesRequest request = - ModifyColumnFamiliesRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .addAllModifications(modifications) - .build(); - return modifyColumnFamilies(request); + 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. /** - * 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. + * 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();
-   *   List modifications = new ArrayList<>();
-   *   Table response = baseBigtableTableAdminClient.modifyColumnFamilies(name, modifications);
+   *   Table response = baseBigtableTableAdminClient.undeleteTableAsync(name).get();
    * }
    * }
* - * @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). + * @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 Table modifyColumnFamilies( - String name, List modifications) { - ModifyColumnFamiliesRequest request = - ModifyColumnFamiliesRequest.newBuilder() - .setName(name) - .addAllModifications(modifications) - .build(); - return modifyColumnFamilies(request); + public final OperationFuture undeleteTableAsync(String name) { + UndeleteTableRequest request = UndeleteTableRequest.newBuilder().setName(name).build(); + return undeleteTableAsync(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. + * 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()) {
-   *   ModifyColumnFamiliesRequest request =
-   *       ModifyColumnFamiliesRequest.newBuilder()
+   *   UndeleteTableRequest request =
+   *       UndeleteTableRequest.newBuilder()
    *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .addAllModifications(new ArrayList())
    *           .build();
-   *   Table response = baseBigtableTableAdminClient.modifyColumnFamilies(request);
+   *   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 Table modifyColumnFamilies(ModifyColumnFamiliesRequest request) { - return modifyColumnFamiliesCallable().call(request); + public final OperationFuture undeleteTableAsync( + UndeleteTableRequest request) { + return undeleteTableOperationCallable().futureCall(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. + * 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()) {
-   *   ModifyColumnFamiliesRequest request =
-   *       ModifyColumnFamiliesRequest.newBuilder()
+   *   UndeleteTableRequest request =
+   *       UndeleteTableRequest.newBuilder()
    *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .addAllModifications(new ArrayList())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.modifyColumnFamiliesCallable().futureCall(request);
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.undeleteTableOperationCallable().futureCall(request);
    *   // Do something.
    *   Table response = future.get();
    * }
    * }
    */
-  public final UnaryCallable modifyColumnFamiliesCallable() {
-    return stub.modifyColumnFamiliesCallable();
+  public final OperationCallable
+      undeleteTableOperationCallable() {
+    return stub.undeleteTableOperationCallable();
   }
 
   // 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.
+   * 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()) {
-   *   DropRowRangeRequest request =
-   *       DropRowRangeRequest.newBuilder()
+   *   UndeleteTableRequest request =
+   *       UndeleteTableRequest.newBuilder()
    *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
    *           .build();
-   *   baseBigtableTableAdminClient.dropRowRange(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.undeleteTableCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.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 void dropRowRange(DropRowRangeRequest request) { - dropRowRangeCallable().call(request); + public final UnaryCallable undeleteTableCallable() { + return stub.undeleteTableCallable(); } // 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. + * 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()) {
-   *   DropRowRangeRequest request =
-   *       DropRowRangeRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.dropRowRangeCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
+   *   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 UnaryCallable dropRowRangeCallable() { - return stub.dropRowRangeCallable(); + 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. /** - * 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. + * 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 name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
-   *   GenerateConsistencyTokenResponse response =
-   *       baseBigtableTableAdminClient.generateConsistencyToken(name);
+   *   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 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}`. + * @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 GenerateConsistencyTokenResponse generateConsistencyToken(TableName name) { - GenerateConsistencyTokenRequest request = - GenerateConsistencyTokenRequest.newBuilder() - .setName(name == null ? null : name.toString()) + public final OperationFuture + createAuthorizedViewAsync( + String parent, AuthorizedView authorizedView, String authorizedViewId) { + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.newBuilder() + .setParent(parent) + .setAuthorizedView(authorizedView) + .setAuthorizedViewId(authorizedViewId) .build(); - return generateConsistencyToken(request); + return createAuthorizedViewAsync(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. + * 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 name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
-   *   GenerateConsistencyTokenResponse response =
-   *       baseBigtableTableAdminClient.generateConsistencyToken(name);
+   *   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 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}`. + * @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(String name) { - GenerateConsistencyTokenRequest request = - GenerateConsistencyTokenRequest.newBuilder().setName(name).build(); - return generateConsistencyToken(request); + public final OperationFuture + createAuthorizedViewAsync(CreateAuthorizedViewRequest request) { + return createAuthorizedViewOperationCallable().futureCall(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. + * 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()) {
-   *   GenerateConsistencyTokenRequest request =
-   *       GenerateConsistencyTokenRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *   CreateAuthorizedViewRequest request =
+   *       CreateAuthorizedViewRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setAuthorizedViewId("authorizedViewId-2074136549")
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
    *           .build();
-   *   GenerateConsistencyTokenResponse response =
-   *       baseBigtableTableAdminClient.generateConsistencyToken(request);
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.createAuthorizedViewOperationCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizedView response = future.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 GenerateConsistencyTokenResponse generateConsistencyToken( - GenerateConsistencyTokenRequest request) { - return generateConsistencyTokenCallable().call(request); + public final OperationCallable< + CreateAuthorizedViewRequest, AuthorizedView, CreateAuthorizedViewMetadata> + createAuthorizedViewOperationCallable() { + return stub.createAuthorizedViewOperationCallable(); } // 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. + * 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()) {
-   *   GenerateConsistencyTokenRequest request =
-   *       GenerateConsistencyTokenRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *   CreateAuthorizedViewRequest request =
+   *       CreateAuthorizedViewRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setAuthorizedViewId("authorizedViewId-2074136549")
+   *           .setAuthorizedView(AuthorizedView.newBuilder().build())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.generateConsistencyTokenCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.createAuthorizedViewCallable().futureCall(request);
    *   // Do something.
-   *   GenerateConsistencyTokenResponse response = future.get();
+   *   Operation response = future.get();
    * }
    * }
*/ - public final UnaryCallable - generateConsistencyTokenCallable() { - return stub.generateConsistencyTokenCallable(); + public final UnaryCallable + createAuthorizedViewCallable() { + return stub.createAuthorizedViewCallable(); } // 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. + * 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 name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
-   *   String consistencyToken = "consistencyToken-1985152319";
-   *   CheckConsistencyResponse response =
-   *       baseBigtableTableAdminClient.checkConsistency(name, consistencyToken);
+   *   TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   for (AuthorizedView element :
+   *       baseBigtableTableAdminClient.listAuthorizedViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
* - * @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. + * @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 CheckConsistencyResponse checkConsistency(TableName name, String consistencyToken) { - CheckConsistencyRequest request = - CheckConsistencyRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .setConsistencyToken(consistencyToken) + public final ListAuthorizedViewsPagedResponse listAuthorizedViews(TableName parent) { + ListAuthorizedViewsRequest request = + ListAuthorizedViewsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) .build(); - return checkConsistency(request); + return listAuthorizedViews(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. + * 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 name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
-   *   String consistencyToken = "consistencyToken-1985152319";
-   *   CheckConsistencyResponse response =
-   *       baseBigtableTableAdminClient.checkConsistency(name, consistencyToken);
+   *   String parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   for (AuthorizedView element :
+   *       baseBigtableTableAdminClient.listAuthorizedViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
* - * @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. + * @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 CheckConsistencyResponse checkConsistency(String name, String consistencyToken) { - CheckConsistencyRequest request = - CheckConsistencyRequest.newBuilder() - .setName(name) - .setConsistencyToken(consistencyToken) - .build(); - return checkConsistency(request); + public final ListAuthorizedViewsPagedResponse listAuthorizedViews(String parent) { + ListAuthorizedViewsRequest request = + ListAuthorizedViewsRequest.newBuilder().setParent(parent).build(); + return listAuthorizedViews(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. + * 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()) {
-   *   CheckConsistencyRequest request =
-   *       CheckConsistencyRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .setConsistencyToken("consistencyToken-1985152319")
+   *   ListAuthorizedViewsRequest request =
+   *       ListAuthorizedViewsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
    *           .build();
-   *   CheckConsistencyResponse response = baseBigtableTableAdminClient.checkConsistency(request);
+   *   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 CheckConsistencyResponse checkConsistency(CheckConsistencyRequest request) { - return checkConsistencyCallable().call(request); + public final ListAuthorizedViewsPagedResponse listAuthorizedViews( + ListAuthorizedViewsRequest request) { + return listAuthorizedViewsPagedCallable().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. + * 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()) {
-   *   CheckConsistencyRequest request =
-   *       CheckConsistencyRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .setConsistencyToken("consistencyToken-1985152319")
+   *   ListAuthorizedViewsRequest request =
+   *       ListAuthorizedViewsRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.checkConsistencyCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listAuthorizedViewsPagedCallable().futureCall(request);
    *   // Do something.
-   *   CheckConsistencyResponse response = future.get();
+   *   for (AuthorizedView element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
*/ - public final UnaryCallable - checkConsistencyCallable() { - return stub.checkConsistencyCallable(); + public final UnaryCallable + listAuthorizedViewsPagedCallable() { + return stub.listAuthorizedViewsPagedCallable(); } // 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. + * 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 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();
+   *   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;
+   *     }
+   *   }
    * }
    * }
- * - * @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); + public final UnaryCallable + listAuthorizedViewsCallable() { + return stub.listAuthorizedViewsCallable(); } // 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. + * 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()) {
-   *   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();
+   *   AuthorizedViewName name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   AuthorizedView response = baseBigtableTableAdminClient.getAuthorizedView(name);
    * }
    * }
* - * @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. + * @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 OperationFuture snapshotTableAsync( - TableName name, String cluster, String snapshotId, String description) { - SnapshotTableRequest request = - SnapshotTableRequest.newBuilder() + public final AuthorizedView getAuthorizedView(AuthorizedViewName name) { + GetAuthorizedViewRequest request = + GetAuthorizedViewRequest.newBuilder() .setName(name == null ? null : name.toString()) - .setCluster(cluster) - .setSnapshotId(snapshotId) - .setDescription(description) .build(); - return snapshotTableAsync(request); + return getAuthorizedView(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. + * 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 = 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();
+   *   String name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *           .toString();
+   *   AuthorizedView response = baseBigtableTableAdminClient.getAuthorizedView(name);
    * }
    * }
* - * @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. + * @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 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); + public final AuthorizedView getAuthorizedView(String name) { + GetAuthorizedViewRequest request = GetAuthorizedViewRequest.newBuilder().setName(name).build(); + return getAuthorizedView(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. + * 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 = 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();
+   *   GetAuthorizedViewRequest request =
+   *       GetAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .build();
+   *   AuthorizedView response = baseBigtableTableAdminClient.getAuthorizedView(request);
    * }
    * }
* - * @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. + * @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( - String name, String cluster, String snapshotId, String description) { - SnapshotTableRequest request = - SnapshotTableRequest.newBuilder() - .setName(name) - .setCluster(cluster) - .setSnapshotId(snapshotId) - .setDescription(description) - .build(); - return snapshotTableAsync(request); + public final AuthorizedView getAuthorizedView(GetAuthorizedViewRequest request) { + return getAuthorizedViewCallable().call(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. + * 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()) {
-   *   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")
+   *   GetAuthorizedViewRequest request =
+   *       GetAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
    *           .build();
-   *   Snapshot response = baseBigtableTableAdminClient.snapshotTableAsync(request).get();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getAuthorizedViewCallable().futureCall(request);
+   *   // Do something.
+   *   AuthorizedView response = future.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); + public final UnaryCallable getAuthorizedViewCallable() { + return stub.getAuthorizedViewCallable(); } // 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. + * 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()) {
-   *   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();
+   *   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 OperationCallable - snapshotTableOperationCallable() { - return stub.snapshotTableOperationCallable(); + 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. /** - * Creates a new snapshot in the specified cluster from the specified source table. The cluster - * and the table must be in the same instance. + * Updates an AuthorizedView in a 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. + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
-   *   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")
+   *   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.snapshotTableCallable().futureCall(request);
+   *       baseBigtableTableAdminClient.createBackupCallable().futureCall(request);
    *   // Do something.
    *   Operation response = future.get();
    * }
    * }
*/ - public final UnaryCallable snapshotTableCallable() { - return stub.snapshotTableCallable(); + public final UnaryCallable createBackupCallable() { + return stub.createBackupCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets metadata information about the specified snapshot. + * Gets metadata on a pending or completed Cloud Bigtable Backup. * - *

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()) {
+   *   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()) {
-   *   SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
-   *   Snapshot response = baseBigtableTableAdminClient.getSnapshot(name);
+   *   String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   Backup response = baseBigtableTableAdminClient.getBackup(name);
    * }
    * }
* - * @param name Required. The unique name of the requested snapshot. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @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 Snapshot getSnapshot(SnapshotName name) { - GetSnapshotRequest request = - GetSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getSnapshot(request); + 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. /** - * 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. + * 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 =
-   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
-   *   Snapshot response = baseBigtableTableAdminClient.getSnapshot(name);
+   *   String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   baseBigtableTableAdminClient.deleteBackup(name);
    * }
    * }
* - * @param name Required. The unique name of the requested snapshot. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. + * @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 Snapshot getSnapshot(String name) { - GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setName(name).build(); - return getSnapshot(request); + public final void deleteBackup(String name) { + DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); + deleteBackup(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. + * 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()) {
-   *   GetSnapshotRequest request =
-   *       GetSnapshotRequest.newBuilder()
-   *           .setName(
-   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .build();
-   *   Snapshot response = baseBigtableTableAdminClient.getSnapshot(request);
+   *   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 Snapshot getSnapshot(GetSnapshotRequest request) { - return getSnapshotCallable().call(request); + public final void deleteBackup(DeleteBackupRequest request) { + deleteBackupCallable().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. + * 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()) {
-   *   GetSnapshotRequest request =
-   *       GetSnapshotRequest.newBuilder()
-   *           .setName(
-   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
+   *   DeleteBackupRequest request =
+   *       DeleteBackupRequest.newBuilder()
+   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.getSnapshotCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteBackupCallable().futureCall(request);
    *   // Do something.
-   *   Snapshot response = future.get();
+   *   future.get();
    * }
    * }
*/ - public final UnaryCallable getSnapshotCallable() { - return stub.getSnapshotCallable(); + public final UnaryCallable deleteBackupCallable() { + return stub.deleteBackupCallable(); } // 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. + * 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 (Snapshot element : baseBigtableTableAdminClient.listSnapshots(parent).iterateAll()) {
+   *   for (Backup element : baseBigtableTableAdminClient.listBackups(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., + * @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 ListSnapshotsPagedResponse listSnapshots(ClusterName parent) { - ListSnapshotsRequest request = - ListSnapshotsRequest.newBuilder() + public final ListBackupsPagedResponse listBackups(ClusterName parent) { + ListBackupsRequest request = + ListBackupsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); - return listSnapshots(request); + return listBackups(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. + * 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 (Snapshot element : baseBigtableTableAdminClient.listSnapshots(parent).iterateAll()) {
+   *   for (Backup element : baseBigtableTableAdminClient.listBackups(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., + * @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 ListSnapshotsPagedResponse listSnapshots(String parent) { - ListSnapshotsRequest request = ListSnapshotsRequest.newBuilder().setParent(parent).build(); - return listSnapshots(request); + public final ListBackupsPagedResponse listBackups(String parent) { + ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); + return listBackups(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. + * 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()) {
-   *   ListSnapshotsRequest request =
-   *       ListSnapshotsRequest.newBuilder()
+   *   ListBackupsRequest request =
+   *       ListBackupsRequest.newBuilder()
    *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
    *           .setPageSize(883849137)
    *           .setPageToken("pageToken873572522")
    *           .build();
-   *   for (Snapshot element : baseBigtableTableAdminClient.listSnapshots(request).iterateAll()) {
+   *   for (Backup element : baseBigtableTableAdminClient.listBackups(request).iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
@@ -1801,62 +4747,72 @@ public final ListSnapshotsPagedResponse listSnapshots(String parent) {
    * @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);
+  public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) {
+    return listBackupsPagedCallable().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. + * 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()) {
-   *   ListSnapshotsRequest request =
-   *       ListSnapshotsRequest.newBuilder()
+   *   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.listSnapshotsPagedCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listBackupsPagedCallable().futureCall(request);
    *   // Do something.
-   *   for (Snapshot element : future.get().iterateAll()) {
+   *   for (Backup element : future.get().iterateAll()) {
    *     // doThingsWith(element);
    *   }
    * }
    * }
*/ - public final UnaryCallable - listSnapshotsPagedCallable() { - return stub.listSnapshotsPagedCallable(); + public final UnaryCallable + listBackupsPagedCallable() { + return stub.listBackupsPagedCallable(); } // 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. + * 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) {
-   *     ListSnapshotsResponse response =
-   *         baseBigtableTableAdminClient.listSnapshotsCallable().call(request);
-   *     for (Snapshot element : response.getResponsesList()) {
+   *     ListBackupsResponse response =
+   *         baseBigtableTableAdminClient.listBackupsCallable().call(request);
+   *     for (Backup element : response.getBackupsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -1869,1158 +4825,1592 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest reque
    * }
    * }
*/ - public final UnaryCallable listSnapshotsCallable() { - return stub.listSnapshotsCallable(); + public final UnaryCallable listBackupsCallable() { + return stub.listBackupsCallable(); } // 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. + * 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()) {
-   *   SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]");
-   *   baseBigtableTableAdminClient.deleteSnapshot(name);
+   *   RestoreTableRequest request =
+   *       RestoreTableRequest.newBuilder()
+   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
+   *           .setTableId("tableId-1552905847")
+   *           .build();
+   *   Table response = baseBigtableTableAdminClient.restoreTableAsync(request).get();
    * }
    * }
* - * @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}`. + * @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(SnapshotName name) { - DeleteSnapshotRequest request = - DeleteSnapshotRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteSnapshot(request); + public final OperationFuture restoreTableAsync( + RestoreTableRequest request) { + return restoreTableOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes the specified snapshot. + * 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. * - *

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()) {
+   *   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()) {
-   *   String name =
-   *       SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString();
-   *   baseBigtableTableAdminClient.deleteSnapshot(name);
+   *   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();
    * }
    * }
- * - * @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); + public final UnaryCallable restoreTableCallable() { + return stub.restoreTableCallable(); } // 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. + * 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()) {
-   *   DeleteSnapshotRequest request =
-   *       DeleteSnapshotRequest.newBuilder()
-   *           .setName(
-   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
-   *           .build();
-   *   baseBigtableTableAdminClient.deleteSnapshot(request);
+   *   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 request The request object containing all of the parameters for the API call. + * @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 void deleteSnapshot(DeleteSnapshotRequest request) { - deleteSnapshotCallable().call(request); + 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. /** - * 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. + * 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()) {
-   *   DeleteSnapshotRequest request =
-   *       DeleteSnapshotRequest.newBuilder()
-   *           .setName(
-   *               SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]").toString())
-   *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.deleteSnapshotCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
+   *   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 UnaryCallable deleteSnapshotCallable() { - return stub.deleteSnapshotCallable(); + 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. /** - * 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. + * 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 parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
    *   String backupId = "backupId2121930365";
-   *   Backup backup = Backup.newBuilder().build();
+   *   BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
+   *   Timestamp expireTime = Timestamp.newBuilder().build();
    *   Backup response =
-   *       baseBigtableTableAdminClient.createBackupAsync(parent, backupId, backup).get();
+   *       baseBigtableTableAdminClient
+   *           .copyBackupAsync(parent, backupId, sourceBackup, expireTime)
+   *           .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 + * @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 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: + * @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 backup Required. The backup to create. + * @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 createBackupAsync( - ClusterName parent, String backupId, Backup backup) { - CreateBackupRequest request = - CreateBackupRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + public final OperationFuture copyBackupAsync( + String parent, String backupId, BackupName sourceBackup, Timestamp expireTime) { + CopyBackupRequest request = + CopyBackupRequest.newBuilder() + .setParent(parent) .setBackupId(backupId) - .setBackup(backup) + .setSourceBackup(sourceBackup == null ? null : sourceBackup.toString()) + .setExpireTime(expireTime) .build(); - return createBackupAsync(request); + return copyBackupAsync(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. + * 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";
-   *   Backup backup = Backup.newBuilder().build();
+   *   String sourceBackup =
+   *       BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
+   *   Timestamp expireTime = Timestamp.newBuilder().build();
    *   Backup response =
-   *       baseBigtableTableAdminClient.createBackupAsync(parent, backupId, backup).get();
+   *       baseBigtableTableAdminClient
+   *           .copyBackupAsync(parent, backupId, sourceBackup, expireTime)
+   *           .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 + * @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 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: + * @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 backup Required. The backup to create. + * @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 createBackupAsync( - String parent, String backupId, Backup backup) { - CreateBackupRequest request = - CreateBackupRequest.newBuilder() + public final OperationFuture copyBackupAsync( + String parent, String backupId, String sourceBackup, Timestamp expireTime) { + CopyBackupRequest request = + CopyBackupRequest.newBuilder() .setParent(parent) .setBackupId(backupId) - .setBackup(backup) + .setSourceBackup(sourceBackup) + .setExpireTime(expireTime) .build(); - return createBackupAsync(request); + return copyBackupAsync(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. + * 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()) {
-   *   CreateBackupRequest request =
-   *       CreateBackupRequest.newBuilder()
+   *   CopyBackupRequest request =
+   *       CopyBackupRequest.newBuilder()
    *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
    *           .setBackupId("backupId2121930365")
-   *           .setBackup(Backup.newBuilder().build())
+   *           .setSourceBackup(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
    *           .build();
-   *   Backup response = baseBigtableTableAdminClient.createBackupAsync(request).get();
+   *   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 createBackupAsync( - CreateBackupRequest request) { - return createBackupOperationCallable().futureCall(request); + public final OperationFuture copyBackupAsync( + CopyBackupRequest request) { + return copyBackupOperationCallable().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. + * 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()) {
-   *   CreateBackupRequest request =
-   *       CreateBackupRequest.newBuilder()
+   *   CopyBackupRequest request =
+   *       CopyBackupRequest.newBuilder()
    *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
    *           .setBackupId("backupId2121930365")
-   *           .setBackup(Backup.newBuilder().build())
+   *           .setSourceBackup(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
    *           .build();
-   *   OperationFuture future =
-   *       baseBigtableTableAdminClient.createBackupOperationCallable().futureCall(request);
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.copyBackupOperationCallable().futureCall(request);
    *   // Do something.
    *   Backup response = future.get();
    * }
    * }
*/ - public final OperationCallable - createBackupOperationCallable() { - return stub.createBackupOperationCallable(); + public final OperationCallable + copyBackupOperationCallable() { + return stub.copyBackupOperationCallable(); } // 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. + * 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()) {
-   *   CreateBackupRequest request =
-   *       CreateBackupRequest.newBuilder()
+   *   CopyBackupRequest request =
+   *       CopyBackupRequest.newBuilder()
    *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
    *           .setBackupId("backupId2121930365")
-   *           .setBackup(Backup.newBuilder().build())
+   *           .setSourceBackup(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *           .setExpireTime(Timestamp.newBuilder().build())
    *           .build();
    *   ApiFuture future =
-   *       baseBigtableTableAdminClient.createBackupCallable().futureCall(request);
+   *       baseBigtableTableAdminClient.copyBackupCallable().futureCall(request);
    *   // Do something.
    *   Operation response = future.get();
    * }
    * }
*/ - public final UnaryCallable createBackupCallable() { - return stub.createBackupCallable(); + public final UnaryCallable copyBackupCallable() { + return stub.copyBackupCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets metadata on a pending or completed Cloud Bigtable Backup. + * 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()) {
-   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
-   *   Backup response = baseBigtableTableAdminClient.getBackup(name);
+   *   ResourceName resource =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
    * }
    * }
* - * @param name Required. Name of the backup. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @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 Backup getBackup(BackupName name) { - GetBackupRequest request = - GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getBackup(request); + 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 metadata on a pending or completed Cloud Bigtable Backup. + * 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 name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
-   *   Backup response = baseBigtableTableAdminClient.getBackup(name);
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
    * }
    * }
* - * @param name Required. Name of the backup. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @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 Backup getBackup(String name) { - GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build(); - return getBackup(request); + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets metadata on a pending or completed Cloud Bigtable Backup. + * 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()) {
-   *   GetBackupRequest request =
-   *       GetBackupRequest.newBuilder()
-   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
-   *   Backup response = baseBigtableTableAdminClient.getBackup(request);
+   *   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 Backup getBackup(GetBackupRequest request) { - return getBackupCallable().call(request); + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets metadata on a pending or completed Cloud Bigtable Backup. + * 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()) {
-   *   GetBackupRequest request =
-   *       GetBackupRequest.newBuilder()
-   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.getBackupCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getIamPolicyCallable().futureCall(request);
    *   // Do something.
-   *   Backup response = future.get();
+   *   Policy response = future.get();
    * }
    * }
*/ - public final UnaryCallable getBackupCallable() { - return stub.getBackupCallable(); + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a pending or completed Cloud Bigtable Backup. + * 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()) {
-   *   Backup backup = Backup.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Backup response = baseBigtableTableAdminClient.updateBackup(backup, updateMask);
+   *   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 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. + * @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 Backup updateBackup(Backup backup, FieldMask updateMask) { - UpdateBackupRequest request = - UpdateBackupRequest.newBuilder().setBackup(backup).setUpdateMask(updateMask).build(); - return updateBackup(request); + 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. /** - * Updates a pending or completed Cloud Bigtable Backup. + * 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()) {
-   *   UpdateBackupRequest request =
-   *       UpdateBackupRequest.newBuilder()
-   *           .setBackup(Backup.newBuilder().build())
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setPolicy(Policy.newBuilder().build())
    *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
-   *   Backup response = baseBigtableTableAdminClient.updateBackup(request);
+   *   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 Backup updateBackup(UpdateBackupRequest request) { - return updateBackupCallable().call(request); + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Updates a pending or completed Cloud Bigtable Backup. + * 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()) {
-   *   UpdateBackupRequest request =
-   *       UpdateBackupRequest.newBuilder()
-   *           .setBackup(Backup.newBuilder().build())
+   *   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.updateBackupCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.setIamPolicyCallable().futureCall(request);
    *   // Do something.
-   *   Backup response = future.get();
+   *   Policy response = future.get();
    * }
    * }
*/ - public final UnaryCallable updateBackupCallable() { - return stub.updateBackupCallable(); + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a pending or completed Cloud Bigtable backup. + * 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()) {
-   *   BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
-   *   baseBigtableTableAdminClient.deleteBackup(name);
+   *   ResourceName resource =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]");
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
    * }
    * }
* - * @param name Required. Name of the backup to delete. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @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 void deleteBackup(BackupName name) { - DeleteBackupRequest request = - DeleteBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteBackup(request); + 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. /** - * Deletes a pending or completed Cloud Bigtable backup. + * 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 name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
-   *   baseBigtableTableAdminClient.deleteBackup(name);
+   *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
+   *   List permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response =
+   *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
    * }
    * }
* - * @param name Required. Name of the backup to delete. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. + * @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 void deleteBackup(String name) { - DeleteBackupRequest request = DeleteBackupRequest.newBuilder().setName(name).build(); - deleteBackup(request); + 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. /** - * Deletes a pending or completed Cloud Bigtable backup. + * 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()) {
-   *   DeleteBackupRequest request =
-   *       DeleteBackupRequest.newBuilder()
-   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
    *           .build();
-   *   baseBigtableTableAdminClient.deleteBackup(request);
+   *   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 void deleteBackup(DeleteBackupRequest request) { - deleteBackupCallable().call(request); + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Deletes a pending or completed Cloud Bigtable backup. + * 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()) {
-   *   DeleteBackupRequest request =
-   *       DeleteBackupRequest.newBuilder()
-   *           .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .addAllPermissions(new ArrayList())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.deleteBackupCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.testIamPermissionsCallable().futureCall(request);
    *   // Do something.
-   *   future.get();
+   *   TestIamPermissionsResponse response = future.get();
    * }
    * }
*/ - public final UnaryCallable deleteBackupCallable() { - return stub.deleteBackupCallable(); + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * 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()) {
-   *   ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
-   *   for (Backup element : baseBigtableTableAdminClient.listBackups(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   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 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/-`. + * @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 ListBackupsPagedResponse listBackups(ClusterName parent) { - ListBackupsRequest request = - ListBackupsRequest.newBuilder() + 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 listBackups(request); + return createSchemaBundleAsync(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * 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 = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
-   *   for (Backup element : baseBigtableTableAdminClient.listBackups(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   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 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/-`. + * @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 ListBackupsPagedResponse listBackups(String parent) { - ListBackupsRequest request = ListBackupsRequest.newBuilder().setParent(parent).build(); - return listBackups(request); + 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. /** - * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * 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()) {
-   *   ListBackupsRequest request =
-   *       ListBackupsRequest.newBuilder()
-   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
-   *           .setFilter("filter-1274492040")
-   *           .setOrderBy("orderBy-1207110587")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
+   *   CreateSchemaBundleRequest request =
+   *       CreateSchemaBundleRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setSchemaBundleId("schemaBundleId2039843326")
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
    *           .build();
-   *   for (Backup element : baseBigtableTableAdminClient.listBackups(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   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 ListBackupsPagedResponse listBackups(ListBackupsRequest request) { - return listBackupsPagedCallable().call(request); + public final OperationFuture createSchemaBundleAsync( + CreateSchemaBundleRequest request) { + return createSchemaBundleOperationCallable().futureCall(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * 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()) {
-   *   ListBackupsRequest request =
-   *       ListBackupsRequest.newBuilder()
-   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
-   *           .setFilter("filter-1274492040")
-   *           .setOrderBy("orderBy-1207110587")
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
+   *   CreateSchemaBundleRequest request =
+   *       CreateSchemaBundleRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setSchemaBundleId("schemaBundleId2039843326")
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.listBackupsPagedCallable().futureCall(request);
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.createSchemaBundleOperationCallable().futureCall(request);
    *   // Do something.
-   *   for (Backup element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
+   *   SchemaBundle response = future.get();
    * }
    * }
*/ - public final UnaryCallable - listBackupsPagedCallable() { - return stub.listBackupsPagedCallable(); + public final OperationCallable< + CreateSchemaBundleRequest, SchemaBundle, CreateSchemaBundleMetadata> + createSchemaBundleOperationCallable() { + return stub.createSchemaBundleOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists Cloud Bigtable backups. Returns both completed and pending backups. + * 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()) {
-   *   while (true) {
-   *     ListBackupsResponse response =
-   *         baseBigtableTableAdminClient.listBackupsCallable().call(request);
-   *     for (Backup element : response.getResponsesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
+   *   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 listBackupsCallable() { - return stub.listBackupsCallable(); + public final UnaryCallable createSchemaBundleCallable() { + return stub.createSchemaBundleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Create a new table by restoring from a completed backup. The new table must be in the same - * instance as the instance containing the 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.RestoreTableMetadata]. The - * [response][google.longrunning.Operation.response] type is - * [Table][google.bigtable.admin.v2.Table], if successful. + * 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()) {
-   *   RestoreTableRequest request =
-   *       RestoreTableRequest.newBuilder()
-   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
-   *           .setTableId("tableId-1552905847")
-   *           .build();
-   *   Table response = baseBigtableTableAdminClient.restoreTableAsync(request).get();
+   *   SchemaBundle schemaBundle = SchemaBundle.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   SchemaBundle response =
+   *       baseBigtableTableAdminClient.updateSchemaBundleAsync(schemaBundle, updateMask).get();
    * }
    * }
* - * @param request The request object containing all of the parameters for the API call. + * @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 restoreTableAsync( - RestoreTableRequest request) { - return restoreTableOperationCallable().futureCall(request); + 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. /** - * Create a new table by restoring from a completed backup. The new table must be in the same - * instance as the instance containing the 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.RestoreTableMetadata]. The - * [response][google.longrunning.Operation.response] type is - * [Table][google.bigtable.admin.v2.Table], if successful. + * 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()) {
-   *   RestoreTableRequest request =
-   *       RestoreTableRequest.newBuilder()
-   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
-   *           .setTableId("tableId-1552905847")
+   *   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.restoreTableOperationCallable().futureCall(request);
+   *   OperationFuture future =
+   *       baseBigtableTableAdminClient.updateSchemaBundleOperationCallable().futureCall(request);
    *   // Do something.
-   *   Table response = future.get();
+   *   SchemaBundle response = future.get();
    * }
    * }
*/ - public final OperationCallable - restoreTableOperationCallable() { - return stub.restoreTableOperationCallable(); + public final OperationCallable< + UpdateSchemaBundleRequest, SchemaBundle, UpdateSchemaBundleMetadata> + updateSchemaBundleOperationCallable() { + return stub.updateSchemaBundleOperationCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Create a new table by restoring from a completed backup. The new table must be in the same - * instance as the instance containing the 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.RestoreTableMetadata]. The - * [response][google.longrunning.Operation.response] type is - * [Table][google.bigtable.admin.v2.Table], if successful. + * 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()) {
-   *   RestoreTableRequest request =
-   *       RestoreTableRequest.newBuilder()
-   *           .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
-   *           .setTableId("tableId-1552905847")
+   *   UpdateSchemaBundleRequest request =
+   *       UpdateSchemaBundleRequest.newBuilder()
+   *           .setSchemaBundle(SchemaBundle.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setIgnoreWarnings(true)
    *           .build();
    *   ApiFuture future =
-   *       baseBigtableTableAdminClient.restoreTableCallable().futureCall(request);
+   *       baseBigtableTableAdminClient.updateSchemaBundleCallable().futureCall(request);
    *   // Do something.
    *   Operation response = future.get();
    * }
    * }
*/ - public final UnaryCallable restoreTableCallable() { - return stub.restoreTableCallable(); + public final UnaryCallable updateSchemaBundleCallable() { + return stub.updateSchemaBundleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the access control policy for a Table or Backup resource. Returns an empty policy if the - * resource exists but does not have a policy set. + * 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()) {
-   *   ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
-   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
+   *   SchemaBundleName name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]");
+   *   SchemaBundle response = baseBigtableTableAdminClient.getSchemaBundle(name);
    * }
    * }
* - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. + * @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 Policy getIamPolicy(ResourceName resource) { - GetIamPolicyRequest request = - GetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .build(); - return getIamPolicy(request); + 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 the access control policy for a Table or Backup resource. Returns an empty policy if the - * resource exists but does not have a policy set. + * 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 resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
-   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
+   *   String name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]").toString();
+   *   SchemaBundle response = baseBigtableTableAdminClient.getSchemaBundle(name);
    * }
    * }
* - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. + * @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 Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); + public final SchemaBundle getSchemaBundle(String name) { + GetSchemaBundleRequest request = GetSchemaBundleRequest.newBuilder().setName(name).build(); + return getSchemaBundle(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the access control policy for a Table or Backup resource. Returns an empty policy if the - * resource exists but does not have a policy set. + * 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()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *   GetSchemaBundleRequest request =
+   *       GetSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
    *           .build();
-   *   Policy response = baseBigtableTableAdminClient.getIamPolicy(request);
+   *   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 Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); + public final SchemaBundle getSchemaBundle(GetSchemaBundleRequest request) { + return getSchemaBundleCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Gets the access control policy for a Table or Backup resource. Returns an empty policy if the - * resource exists but does not have a policy set. + * 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()) {
-   *   GetIamPolicyRequest request =
-   *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *   GetSchemaBundleRequest request =
+   *       GetSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.getIamPolicyCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.getSchemaBundleCallable().futureCall(request);
    *   // Do something.
-   *   Policy response = future.get();
+   *   SchemaBundle response = future.get();
    * }
    * }
*/ - public final UnaryCallable getIamPolicyCallable() { - return stub.getIamPolicyCallable(); + public final UnaryCallable getSchemaBundleCallable() { + return stub.getSchemaBundleCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + * 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()) {
-   *   ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = baseBigtableTableAdminClient.setIamPolicy(resource, policy);
+   *   TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
+   *   for (SchemaBundle element :
+   *       baseBigtableTableAdminClient.listSchemaBundles(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
* - * @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. + * @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 Policy setIamPolicy(ResourceName resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .setPolicy(policy) + public final ListSchemaBundlesPagedResponse listSchemaBundles(TableName parent) { + ListSchemaBundlesRequest request = + ListSchemaBundlesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) .build(); - return setIamPolicy(request); + return listSchemaBundles(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + * 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 resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
-   *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = baseBigtableTableAdminClient.setIamPolicy(resource, policy);
+   *   String parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
+   *   for (SchemaBundle element :
+   *       baseBigtableTableAdminClient.listSchemaBundles(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
* - * @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. + * @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 Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); + public final ListSchemaBundlesPagedResponse listSchemaBundles(String parent) { + ListSchemaBundlesRequest request = + ListSchemaBundlesRequest.newBuilder().setParent(parent).build(); + return listSchemaBundles(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + * 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()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
+   *   ListSchemaBundlesRequest request =
+   *       ListSchemaBundlesRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
    *           .build();
-   *   Policy response = baseBigtableTableAdminClient.setIamPolicy(request);
+   *   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 Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); + public final ListSchemaBundlesPagedResponse listSchemaBundles(ListSchemaBundlesRequest request) { + return listSchemaBundlesPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + * 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()) {
-   *   SetIamPolicyRequest request =
-   *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .setPolicy(Policy.newBuilder().build())
+   *   ListSchemaBundlesRequest request =
+   *       ListSchemaBundlesRequest.newBuilder()
+   *           .setParent(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.setIamPolicyCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.listSchemaBundlesPagedCallable().futureCall(request);
    *   // Do something.
-   *   Policy response = future.get();
+   *   for (SchemaBundle element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
    * }
    * }
*/ - public final UnaryCallable setIamPolicyCallable() { - return stub.setIamPolicyCallable(); + public final UnaryCallable + listSchemaBundlesPagedCallable() { + return stub.listSchemaBundlesPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Returns permissions that the caller has on the specified Table or Backup resource. + * 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()) {
-   *   ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
-   *   List permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response =
-   *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
+   *   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 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). + * @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 TestIamPermissionsResponse testIamPermissions( - ResourceName resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource == null ? null : resource.toString()) - .addAllPermissions(permissions) + public final void deleteSchemaBundle(SchemaBundleName name) { + DeleteSchemaBundleRequest request = + DeleteSchemaBundleRequest.newBuilder() + .setName(name == null ? null : name.toString()) .build(); - return testIamPermissions(request); + deleteSchemaBundle(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Returns permissions that the caller has on the specified Table or Backup resource. + * 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 resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
-   *   List permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response =
-   *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
+   *   String name =
+   *       SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]").toString();
+   *   baseBigtableTableAdminClient.deleteSchemaBundle(name);
    * }
    * }
* - * @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). + * @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 TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); + public final void deleteSchemaBundle(String name) { + DeleteSchemaBundleRequest request = + DeleteSchemaBundleRequest.newBuilder().setName(name).build(); + deleteSchemaBundle(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Returns permissions that the caller has on the specified Table or Backup resource. + * 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()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .addAllPermissions(new ArrayList())
+   *   DeleteSchemaBundleRequest request =
+   *       DeleteSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
    *           .build();
-   *   TestIamPermissionsResponse response =
-   *       baseBigtableTableAdminClient.testIamPermissions(request);
+   *   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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); + public final void deleteSchemaBundle(DeleteSchemaBundleRequest request) { + deleteSchemaBundleCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Returns permissions that the caller has on the specified Table or Backup resource. + * 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()) {
-   *   TestIamPermissionsRequest request =
-   *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
-   *           .addAllPermissions(new ArrayList())
+   *   DeleteSchemaBundleRequest request =
+   *       DeleteSchemaBundleRequest.newBuilder()
+   *           .setName(
+   *               SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
    *           .build();
-   *   ApiFuture future =
-   *       baseBigtableTableAdminClient.testIamPermissionsCallable().futureCall(request);
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.deleteSchemaBundleCallable().futureCall(request);
    *   // Do something.
-   *   TestIamPermissionsResponse response = future.get();
+   *   future.get();
    * }
    * }
*/ - public final UnaryCallable - testIamPermissionsCallable() { - return stub.testIamPermissionsCallable(); + public final UnaryCallable deleteSchemaBundleCallable() { + return stub.deleteSchemaBundleCallable(); } @Override @@ -3067,14 +6457,7 @@ public static ApiFuture createAsync( ApiFuture futurePage = ListTablesPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListTablesPagedResponse apply(ListTablesPage input) { - return new ListTablesPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); + futurePage, input -> new ListTablesPagedResponse(input), MoreExecutors.directExecutor()); } private ListTablesPagedResponse(ListTablesPage page) { @@ -3133,6 +6516,90 @@ protected ListTablesFixedSizeCollection createCollection( } } + 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, @@ -3148,12 +6615,7 @@ public static ApiFuture createAsync( ListSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, - new ApiFunction() { - @Override - public ListSnapshotsPagedResponse apply(ListSnapshotsPage input) { - return new ListSnapshotsPagedResponse(input); - } - }, + input -> new ListSnapshotsPagedResponse(input), MoreExecutors.directExecutor()); } @@ -3228,14 +6690,7 @@ public static ApiFuture createAsync( ApiFuture futurePage = ListBackupsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( - futurePage, - new ApiFunction() { - @Override - public ListBackupsPagedResponse apply(ListBackupsPage input) { - return new ListBackupsPagedResponse(input); - } - }, - MoreExecutors.directExecutor()); + futurePage, input -> new ListBackupsPagedResponse(input), MoreExecutors.directExecutor()); } private ListBackupsPagedResponse(ListBackupsPage page) { @@ -3293,4 +6748,84 @@ protected ListBackupsFixedSizeCollection createCollection( 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java index 9aa3add053..19cc61a490 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,13 @@ 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.core.BetaApi; -import com.google.api.core.InternalApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; @@ -33,25 +33,40 @@ 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; @@ -59,11 +74,20 @@ 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; @@ -77,9 +101,83 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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. */ @@ -112,11 +210,76 @@ 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(); @@ -209,6 +372,17 @@ public UnaryCallSettings restoreTableSettings() 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(); @@ -225,6 +399,47 @@ public UnaryCallSettings setIamPolicySettings() { 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(); @@ -259,7 +474,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return BigtableTableAdminStubSettings.defaultTransportChannelProvider(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return BigtableTableAdminStubSettings.defaultApiClientHeaderProviderBuilder(); } @@ -311,14 +525,13 @@ public BigtableTableAdminStubSettings.Builder getStubSettingsBuilder() { return ((BigtableTableAdminStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * 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) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; @@ -353,11 +566,80 @@ 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() { @@ -454,6 +736,17 @@ public UnaryCallSettings.Builder restoreTableSet 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(); @@ -470,6 +763,51 @@ public UnaryCallSettings.Builder setIamPolicySettin 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java index efcb0cd81a..0e5a9155a0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java @@ -19,26 +19,45 @@ 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; @@ -49,6 +68,7 @@ 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; @@ -105,6 +125,7 @@ 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 { @@ -127,6 +148,7 @@ 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. */ @@ -134,6 +156,14 @@ 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() { @@ -141,7 +171,10 @@ public void close() { } /** - * Creates a new instance and returns its representation. + * 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: * @@ -155,12 +188,16 @@ public void close() { * @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)); } /** - * Asynchronously creates a new instance and returns its representation wrapped in a future. + * 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: * @@ -176,6 +213,7 @@ public Instance createInstance(CreateInstanceRequest request) { * @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)), @@ -189,7 +227,10 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) { } /** - * Updates a new instance and returns its representation. + * 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: * @@ -203,12 +244,16 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) { * @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)); } /** - * Asynchronously updates a new instance and returns its representation wrapped in a future. + * 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: * @@ -224,6 +269,7 @@ public Instance updateInstance(UpdateInstanceRequest request) { * @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)), @@ -237,7 +283,10 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) { } /** - * Get the instance representation by 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)}. + * + *

Get the instance representation by ID. * *

Sample code: * @@ -245,12 +294,16 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) { * 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)); } /** - * Asynchronously gets the instance representation by ID wrapped in a future. + * 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: * @@ -260,6 +313,7 @@ public Instance getInstance(String id) { * } */ @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); @@ -278,7 +332,10 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) { } /** - * Lists all of the instances in the current project. + * 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. @@ -295,12 +352,16 @@ public Instance apply(com.google.bigtable.admin.v2.Instance proto) { * } */ @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public List listInstances() { return ApiExceptions.callAndTranslateApiException(listInstancesAsync()); } /** - * Asynchronously lists all of the instances in the current project. + * 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. @@ -328,6 +389,7 @@ public List listInstances() { * } */ @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() @@ -370,7 +432,10 @@ public List apply(com.google.bigtable.admin.v2.ListInstancesResponse p } /** - * Deletes the specified instance. + * 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: * @@ -379,12 +444,16 @@ public List apply(com.google.bigtable.admin.v2.ListInstancesResponse p * } */ @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public void deleteInstance(String instanceId) { ApiExceptions.callAndTranslateApiException(deleteInstanceAsync(instanceId)); } /** - * Asynchronously deletes the specified instance. + * 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: * @@ -394,6 +463,7 @@ public void deleteInstance(String instanceId) { * } */ @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); @@ -414,7 +484,10 @@ public Void apply(Empty input) { } /** - * Checks if the instance specified by the instance ID exists. + * 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: * @@ -424,12 +497,16 @@ public Void apply(Empty input) { * } * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public boolean exists(String instanceId) { return ApiExceptions.callAndTranslateApiException(existsAsync(instanceId)); } /** - * Asynchronously checks if the instance specified by the instance ID exists. + * 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: * @@ -455,6 +532,7 @@ public boolean exists(String instanceId) { * ); * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture existsAsync(String instanceId) { ApiFuture protoFuture = getInstanceAsync(instanceId); @@ -482,7 +560,10 @@ public Boolean apply(NotFoundException ignored) { } /** - * Creates a new cluster in the specified instance. + * 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: * @@ -496,12 +577,16 @@ public Boolean apply(NotFoundException ignored) { * } */ @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public Cluster createCluster(CreateClusterRequest request) { return ApiExceptions.callAndTranslateApiException(createClusterAsync(request)); } /** - * Asynchronously creates a new cluster in the specified instance. + * 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: * @@ -517,20 +602,19 @@ public Cluster createCluster(CreateClusterRequest request) { * } */ @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)), - new ApiFunction() { - @Override - public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { - return Cluster.fromProto(proto); - } - }, + Cluster::fromProto, MoreExecutors.directExecutor()); } /** - * Gets the cluster representation by ID. + * 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: * @@ -539,12 +623,16 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { * } */ @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)); } /** - * Asynchronously gets the cluster representation by ID. + * 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: * @@ -554,6 +642,7 @@ public Cluster getCluster(String instanceId, String clusterId) { * } */ @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); @@ -572,7 +661,10 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { } /** - * Lists all clusters in the specified instance. + * 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. @@ -589,12 +681,16 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { * } */ @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public List listClusters(String instanceId) { return ApiExceptions.callAndTranslateApiException(listClustersAsync(instanceId)); } /** - * Asynchronously lists all clusters in the specified instance. + * 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. @@ -622,6 +718,7 @@ public List listClusters(String instanceId) { * } */ @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 = @@ -660,8 +757,14 @@ public List apply(com.google.bigtable.admin.v2.ListClustersResponse pro } /** - * Modifies the cluster's node count. Please note that only clusters that belong to a production - * instance can be resized. + * 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: * @@ -670,14 +773,21 @@ public List apply(com.google.bigtable.admin.v2.ListClustersResponse pro * } */ @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)); } /** - * Asynchronously modifies the cluster's node count. Please note that only clusters that belong to - * a production instance can be resized. + * 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);
@@ -685,6 +795,7 @@ public Cluster resizeCluster(String instanceId, String clusterId, int numServeNo
    * }
*/ @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture resizeClusterAsync( String instanceId, String clusterId, int numServeNodes) { @@ -708,7 +819,129 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { } /** - * Deletes the specified cluster. Please note that an instance must have at least 1 cluster. To + * 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: @@ -718,13 +951,17 @@ public Cluster apply(com.google.bigtable.admin.v2.Cluster proto) { * } */ @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)); } /** - * Asynchronously deletes the specified cluster. Please note that an instance must have at least 1 - * cluster. To remove the last cluster, please use {@link + * 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: @@ -735,6 +972,7 @@ public void deleteCluster(String instanceId, String clusterId) { * } */ @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); @@ -753,7 +991,10 @@ public Void apply(Empty input) { } /** - * Creates a new app profile. + * 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: * @@ -767,12 +1008,16 @@ public Void apply(Empty input) { * @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)); } /** - * Asynchronously creates a new app profile. + * 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: * @@ -788,6 +1033,7 @@ public AppProfile createAppProfile(CreateAppProfileRequest request) { * @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)), @@ -801,7 +1047,10 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { } /** - * Gets the app profile by ID. + * 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: * @@ -811,12 +1060,16 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { * * @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)); } /** - * Asynchronously gets the app profile by ID. + * 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: * @@ -829,6 +1082,7 @@ public AppProfile getAppProfile(String instanceId, String appProfileId) { * @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); @@ -846,7 +1100,10 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { } /** - * Lists all app profiles of the specified instance. + * 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: * @@ -857,12 +1114,16 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { * @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)); } /** - * Asynchronously lists all app profiles of the specified instance. + * 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: * @@ -875,6 +1136,7 @@ public List listAppProfiles(String instanceId) { * @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); @@ -940,7 +1202,10 @@ public List apply(List inpu } /** - * Updates an existing app profile. + * 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: * @@ -956,12 +1221,16 @@ public List apply(List inpu * @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)); } /** - * Asynchronously updates an existing app profile. + * 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: * @@ -987,6 +1256,7 @@ public AppProfile updateAppProfile(UpdateAppProfileRequest request) { * @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)), @@ -1000,7 +1270,10 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { } /** - * Deletes the specified app profile. + * 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: * @@ -1009,13 +1282,17 @@ public AppProfile apply(com.google.bigtable.admin.v2.AppProfile proto) { * } */ @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)); } /** - * Asynchronously deletes the specified app profile. + * 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: * @@ -1026,12 +1303,16 @@ public void deleteAppProfile(String instanceId, String appProfileId) { * } */ @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); } /** - * Deletes the specified app profile with an option to force deletion. + * 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: * @@ -1040,13 +1321,17 @@ public ApiFuture deleteAppProfileAsync(String instanceId, String appProfil * } */ @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)); } /** - * Asynchronously deletes the specified app profile with an option to force deletion. + * 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: * @@ -1057,6 +1342,7 @@ public void deleteAppProfile(String instanceId, String appProfileId, boolean for * } */ @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); @@ -1075,7 +1361,10 @@ public Void apply(Empty input) { } /** - * Gets the IAM access control policy for the specified instance. + * 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: * @@ -1091,12 +1380,16 @@ public Void apply(Empty input) { * 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)); } /** - * Asynchronously gets the IAM access control policy for the specified instance. + * 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: * @@ -1123,6 +1416,7 @@ public Policy getIamPolicy(String instanceId) { * 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); @@ -1142,7 +1436,10 @@ public Policy apply(com.google.iam.v1.Policy proto) { } /** - * Replaces the IAM policy associated with the specified instance. + * 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: * @@ -1159,12 +1456,16 @@ public Policy apply(com.google.iam.v1.Policy proto) { * 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)); } /** - * Asynchronously replaces the IAM policy associated with the specified instance. + * 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: * @@ -1195,6 +1496,7 @@ public Policy setIamPolicy(String instanceId, Policy policy) { * 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(); @@ -1217,8 +1519,11 @@ public Policy apply(com.google.iam.v1.Policy proto) { } /** - * Tests whether the caller has the given permissions for the specified instance. Returns a subset - * of the specified permissions that the caller has. + * 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: * @@ -1235,14 +1540,18 @@ public Policy apply(com.google.iam.v1.Policy proto) { * 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)); } /** - * Asynchronously tests whether the caller has the given permissions for the specified instance. - * Returns a subset of the specified permissions that the caller has. + * 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: * @@ -1268,6 +1577,7 @@ public List testIamPermission(String instanceId, String... permissions) * 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() @@ -1286,6 +1596,674 @@ public List apply(TestIamPermissionsResponse input) { 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. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java index f89142828d..974317a9d1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettings.java @@ -18,11 +18,17 @@ 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; @@ -47,6 +53,9 @@ * } */ public final class BigtableInstanceAdminSettings { + private static final Logger LOGGER = + Logger.getLogger(BigtableInstanceAdminSettings.class.getName()); + private final String projectId; private final BigtableInstanceAdminStubSettings stubSettings; @@ -104,6 +113,16 @@ public String toString() { .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(); } @@ -115,12 +134,49 @@ public Builder toBuilder() { /** Returns a new builder for this class. */ public static Builder newBuilder() { - Preconditions.checkState( - System.getenv(BIGTABLE_EMULATOR_HOST_ENV_VAR) == null, - "BigtableInstanceAdminSettings doesn't supported on Emulator"); + 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; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java index d4029e19b5..3cd7fef840 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClient.java @@ -19,36 +19,63 @@ 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; @@ -60,6 +87,7 @@ 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; @@ -76,13 +104,30 @@ * // One instance per application. * BigtableTableAdminClient client = BigtableTableAdminClient.create("[PROJECT]", "[INSTANCE]"); * - * CreateTableRequest request = - * CreateTableRequest.of("my-table") - * .addFamily("cf1") - * .addFamily("cf2", GCRULES.maxVersions(10)) - * .addSplit(ByteString.copyFromUtf8("b")) - * .addSplit(ByteString.copyFromUtf8("q")); - * client.createTable(request); + * 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(); @@ -124,6 +169,7 @@ 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( @@ -138,8 +184,10 @@ public static BigtableTableAdminClient create( /** 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()); + EnhancedBigtableTableAdminStub.createEnhanced(settings.getStubSettings(), requestContext); return create(settings.getProjectId(), settings.getInstanceId(), stub); } @@ -161,6 +209,7 @@ private BigtableTableAdminClient( 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. */ @@ -173,13 +222,24 @@ 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(); } /** - * Creates a new table with the specified configuration. + * 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: * @@ -203,12 +263,16 @@ public void close() { * @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)); } /** - * Asynchronously creates a new table with the specified configuration. + * 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: * @@ -247,13 +311,91 @@ public Table createTable(CreateTableRequest request) { * @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))); } /** - * Creates, updates and drops column families as specified in the request. + * 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: * @@ -286,12 +428,16 @@ public ApiFuture

createTableAsync(CreateTableRequest request) { * * @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)); } /** - * Asynchronously creates, updates, and drops column families as specified in the 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: * @@ -338,6 +484,7 @@ public Table modifyFamilies(ModifyColumnFamiliesRequest request) { * @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 @@ -346,7 +493,10 @@ public ApiFuture
modifyFamiliesAsync(ModifyColumnFamiliesRequest request) } /** - * Deletes the table specified by the table ID. + * 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: * @@ -354,12 +504,16 @@ public ApiFuture

modifyFamiliesAsync(ModifyColumnFamiliesRequest request) * 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)); } /** - * Asynchronously deletes the table specified by the table ID. + * 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: * @@ -382,6 +536,7 @@ public void deleteTable(String tableId) { * } */ @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(); @@ -390,7 +545,10 @@ public ApiFuture deleteTableAsync(String tableId) { } /** - * Checks if the table specified by the table ID exists. + * 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: * @@ -400,12 +558,16 @@ public ApiFuture deleteTableAsync(String tableId) { * } * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public boolean exists(String tableId) { return ApiExceptions.callAndTranslateApiException(existsAsync(tableId)); } /** - * Asynchronously checks if the table specified by the table ID exists. + * 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: * @@ -431,6 +593,7 @@ public boolean exists(String tableId) { * ); * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture existsAsync(String tableId) { ApiFuture

protoFuture = @@ -460,7 +623,10 @@ public Boolean apply(NotFoundException ignored) { } /** - * Gets the table metadata by table ID. + * 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: * @@ -475,12 +641,16 @@ public Boolean apply(NotFoundException ignored) { * } * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public Table getTable(String tableId) { return ApiExceptions.callAndTranslateApiException(getTableAsync(tableId)); } /** - * Asynchronously gets the table metadata by table ID. + * 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: * @@ -507,6 +677,7 @@ public Table getTable(String tableId) { * } */ @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); } @@ -520,23 +691,85 @@ private ApiFuture
getTableAsync( } /** - * Lists all table IDs in the instance. + * 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(name.getTable());
+   *   System.out.println(tableId);
    * }
    * }
*/ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public List listTables() { return ApiExceptions.callAndTranslateApiException(listTablesAsync()); } /** - * Asynchronously lists all table IDs in the instance. + * 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: * @@ -561,6 +794,7 @@ public List listTables() { * ); * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture> listTablesAsync() { ListTablesRequest request = ListTablesRequest.newBuilder() @@ -624,7 +858,10 @@ public List apply(List protos) { } /** - * Drops rows by the specified row key prefix and table ID. + * 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. * @@ -634,12 +871,16 @@ public List apply(List protos) { * 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)); } /** - * Asynchronously drops rows by the specified row key prefix and table ID. + * 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. * @@ -664,12 +905,16 @@ public void dropRowRange(String tableId, String rowKeyPrefix) { * } */ @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)); } /** - * Drops rows by the specified row key prefix and table ID. + * 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. * @@ -680,12 +925,16 @@ public ApiFuture dropRowRangeAsync(String tableId, String rowKeyPrefix) { * } */ @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)); } /** - * Asynchronously drops rows by the specified row key prefix and table ID. + * 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. * @@ -710,6 +959,7 @@ public void dropRowRange(String tableId, ByteString rowKeyPrefix) { * } */ @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() @@ -721,7 +971,10 @@ public ApiFuture dropRowRangeAsync(String tableId, ByteString rowKeyPrefix } /** - * Drops all data in the table. + * 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: * @@ -729,12 +982,16 @@ public ApiFuture dropRowRangeAsync(String tableId, ByteString rowKeyPrefix * 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)); } /** - * Asynchronously drops all data in the table. + * 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: * @@ -757,6 +1014,7 @@ public void dropAllRows(String tableId) { * } */ @SuppressWarnings("WeakerAccess") + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture dropAllRowsAsync(String tableId) { DropRowRangeRequest request = DropRowRangeRequest.newBuilder() @@ -768,7 +1026,10 @@ public ApiFuture dropAllRowsAsync(String tableId) { } /** - * Blocks the current thread until replication has caught up to the point when this method was + * 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. * @@ -780,6 +1041,8 @@ public ApiFuture dropAllRowsAsync(String tableId) { * * @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 = @@ -789,8 +1052,16 @@ public void awaitReplication(String tableId) { stub.awaitReplicationCallable().futureCall(tableName)); } + public void awaitConsistency(ConsistencyRequest consistencyRequest) { + ApiExceptions.callAndTranslateApiException( + stub.awaitConsistencyCallable().futureCall(consistencyRequest)); + } + /** - * Creates a backup with the specified configuration. + * 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 * @@ -802,12 +1073,16 @@ public void awaitReplication(String tableId) { * 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)); } /** - * Creates a backup with the specified configuration asynchronously. + * 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 * @@ -833,6 +1108,7 @@ public Backup createBackup(CreateBackupRequest request) { * ); * } */ + @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)), @@ -846,7 +1122,10 @@ public Backup apply(com.google.bigtable.admin.v2.Backup backupProto) { } /** - * Gets a backup with the specified backup ID in the specified cluster. + * 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 * @@ -854,12 +1133,16 @@ public Backup apply(com.google.bigtable.admin.v2.Backup backupProto) { * 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)); } /** - * Gets a backup with the specified backup ID in the specified cluster asynchronously. + * 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 * @@ -881,6 +1164,7 @@ public Backup getBackup(String clusterId, String backupId) { * ); * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture getBackupAsync(String clusterId, String backupId) { GetBackupRequest request = GetBackupRequest.newBuilder() @@ -898,7 +1182,10 @@ public Backup apply(com.google.bigtable.admin.v2.Backup backup) { } /** - * Lists backups in the specified cluster. + * 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 * @@ -906,12 +1193,16 @@ public Backup apply(com.google.bigtable.admin.v2.Backup backup) { * 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)); } /** - * Lists backups in the specified cluster asynchronously. + * 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: * @@ -936,6 +1227,7 @@ public List listBackups(String clusterId) { * ); * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture> listBackupsAsync(String clusterId) { ListBackupsRequest request = ListBackupsRequest.newBuilder() @@ -999,7 +1291,10 @@ public List apply(List protos) { } /** - * Deletes a backup with the specified backup ID in the specified cluster. + * 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 * @@ -1007,12 +1302,16 @@ public List apply(List protos) { * 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)); } /** - * Deletes a backup with the specified backup ID in the specified cluster asynchronously. + * 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 * @@ -1034,6 +1333,7 @@ public void deleteBackup(String clusterId, String backupId) { * ); * } */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture deleteBackupAsync(String clusterId, String backupId) { DeleteBackupRequest request = DeleteBackupRequest.newBuilder() @@ -1044,7 +1344,10 @@ public ApiFuture deleteBackupAsync(String clusterId, String backupId) { } /** - * Updates a backup with the specified configuration. + * 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 * @@ -1052,12 +1355,16 @@ public ApiFuture deleteBackupAsync(String clusterId, String backupId) { * 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)); } /** - * Updates a backup with the specified configuration asynchronously. + * 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 * @@ -1079,6 +1386,7 @@ public Backup updateBackup(UpdateBackupRequest request) { * ); * } */ + @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)), @@ -1092,7 +1400,10 @@ public Backup apply(com.google.bigtable.admin.v2.Backup proto) { } /** - * Restores a backup to a new table with the specified configuration. + * 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 * @@ -1101,12 +1412,18 @@ public Backup apply(com.google.bigtable.admin.v2.Backup proto) { * 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)); } - /** Restores a backup to a new table with the specified configuration asynchronously. + /** + * 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
@@ -1126,8 +1443,9 @@ public RestoredTableResult restoreTable(RestoreTableRequest request)
    *   },
    *   MoreExecutors.directExecutor()
    * );
-   * 
- * */ + * } + */ + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") public ApiFuture restoreTableAsync(RestoreTableRequest request) { final OperationFuture future = this.stub @@ -1150,6 +1468,37 @@ public ApiFuture apply(com.google.bigtable.admin.v2.Table t 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. * @@ -1166,7 +1515,8 @@ public void awaitOptimizeRestoredTable(OptimizeRestoredTableOperationToken token awaitOptimizeRestoredTableAsync(token).get(); } - /** Awaits a restored table is fully optimized asynchronously. + /** + * Awaits a restored table is fully optimized asynchronously. * *

Sample code * @@ -1189,7 +1539,8 @@ public void awaitOptimizeRestoredTable(OptimizeRestoredTableOperationToken token * }, * MoreExecutors.directExecutor() * ); - * */ + * } + */ public ApiFuture awaitOptimizeRestoredTableAsync( OptimizeRestoredTableOperationToken token) { return transformToVoid( @@ -1197,9 +1548,102 @@ public ApiFuture awaitOptimizeRestoredTableAsync( } /** - * 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. + * 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: * @@ -1223,6 +1667,8 @@ public ApiFuture awaitOptimizeRestoredTableAsync( * } */ @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 = @@ -1231,106 +1677,899 @@ public ApiFuture awaitReplicationAsync(final String tableId) { } /** - * Helper method to construct the table name in format: - * projects/{project}/instances/{instance}/tables/{tableId} + * 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. */ - private String getTableName(String tableId) { - return NameUtil.formatTableName(projectId, instanceId, tableId); + public void waitForConsistency(String tableId, String consistencyToken) { + ApiExceptions.callAndTranslateApiException(waitForConsistencyAsync(tableId, consistencyToken)); } - // TODO(igorbernstein): rename methods to make clear that they deal with futures. - /** - * Helper method to transform ApiFuture to ApiFuture

+ * 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. */ - 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()); + public ApiFuture waitForConsistencyAsync(String tableId, String consistencyToken) { + return stub.awaitConsistencyCallable() + .futureCall(ConsistencyRequest.forReplication(tableId, consistencyToken)); } /** - * Gets the IAM access control policy for the specified table. + * 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
-   * 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());
-   * }
+   * 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 Table-level - * IAM management + * @see CreateAuthorizedViewRequest for available options. */ - @SuppressWarnings("WeakerAccess") - public Policy getIamPolicy(String tableId) { - return ApiExceptions.callAndTranslateApiException(getIamPolicyAsync(tableId)); + @ObsoleteApi("Use getBaseClient() to access the auto-generated proto-based methods instead.") + public AuthorizedView createAuthorizedView(CreateAuthorizedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(createAuthorizedViewAsync(request)); } /** - * Asynchronously gets the IAM access control policy for the specified table. + * 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
-   * ApiFuture policyFuture = client.getIamPolicyAsync("my-table");
+   * CreateAuthorizedViewRequest request =
+   *     CreateAuthorizedViewRequest.of("my-table", "my-new-authorized-view")
+   *         .setDeletionProtection(true)
+   *         .setAuthorizedViewType(
+   *             SubsetView.create()
+   *                 .addRowPrefix("row#")
+   *                 .addFamilySubsets(
+   *                     "my-family", FamilySubsets.create().addQualifier("column")));
    *
-   * 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());
-   *       }
+   * 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());
+   *   MoreExecutors.directExecutor()
+   * );
    * }
* - * @see Table-level - * IAM management + * @see CreateAuthorizedViewRequest for available options. */ - @SuppressWarnings("WeakerAccess") - public ApiFuture getIamPolicyAsync(String tableId) { - String tableName = NameUtil.formatTableName(projectId, instanceId, tableId); - return getResourceIamPolicy(tableName); + @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()); } /** - * Replaces the IAM policy associated with the specified table. + * 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
-   * Policy newPolicy = client.setIamPolicy("my-table",
-   *   Policy.newBuilder()
+   * 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());
@@ -1341,12 +2580,16 @@ public ApiFuture getIamPolicyAsync(String tableId) {
    *     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));
   }
 
   /**
-   * Asynchronously replaces the IAM policy associated with the specified table.
+   * 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: * @@ -1377,14 +2620,18 @@ public Policy setIamPolicy(String tableId, Policy policy) { * 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); } /** - * Tests whether the caller has the given permissions for the specified table. Returns a subset of - * the specified permissions that the caller has. + * 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: * @@ -1401,12 +2648,16 @@ public ApiFuture setIamPolicyAsync(String tableId, Policy policy) { * 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)); } /** - * Asynchronously tests whether the caller has the given permissions for the specified table. + * 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: @@ -1433,13 +2684,17 @@ public List testIamPermission(String tableId, String... permissions) { * 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); } /** - * Gets the IAM access control policy for the specified backup. + * 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: * @@ -1455,12 +2710,16 @@ public ApiFuture> testIamPermissionAsync(String tableId, String... * 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)); } /** - * Asynchronously gets the IAM access control policy for the specified backup. + * 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: * @@ -1487,13 +2746,17 @@ public Policy getBackupIamPolicy(String clusterId, String backupId) { * 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); } /** - * Replaces the IAM policy associated with the specified backup. + * 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: * @@ -1510,13 +2773,17 @@ public ApiFuture getBackupIamPolicyAsync(String clusterId, String backup * 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)); } /** - * Asynchronously replaces the IAM policy associated with the specified backup. + * 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: * @@ -1547,6 +2814,7 @@ public Policy setBackupIamPolicy(String clusterId, String backupId, Policy polic * 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); @@ -1554,8 +2822,11 @@ public ApiFuture setBackupIamPolicyAsync( } /** - * Tests whether the caller has the given permissions for the specified backup. Returns a subset - * of the specified permissions that the caller has. + * 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: * @@ -1574,6 +2845,7 @@ public ApiFuture setBackupIamPolicyAsync( * 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( @@ -1581,7 +2853,10 @@ public List testBackupIamPermission( } /** - * Asynchronously tests whether the caller has the given permissions for the specified backup. + * 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: @@ -1608,12 +2883,218 @@ public List testBackupIamPermission( * 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(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java index 9cba1159b9..a9a8acead9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettings.java @@ -15,9 +15,9 @@ */ package com.google.cloud.bigtable.admin.v2; -import com.google.api.core.ApiFunction; 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; @@ -111,6 +111,8 @@ public String toString() { .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()) @@ -120,6 +122,32 @@ public String toString() { .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(); } @@ -170,14 +198,8 @@ public static Builder newBuilderForEmulator(String hostname, int port) { .setEndpoint(hostname + ":" + port) .setTransportChannelProvider( InstantiatingGrpcChannelProvider.newBuilder() - .setPoolSize(1) - .setChannelConfigurator( - new ApiFunction() { - @Override - public ManagedChannelBuilder apply(ManagedChannelBuilder input) { - return input.usePlaintext(); - } - }) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) .build()); LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json index 23321fd9ac..8ad0f454cc 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json @@ -19,8 +19,14 @@ "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", "deleteAppProfileCallable"] + "methods": ["deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfileCallable"] }, "DeleteCluster": { "methods": ["deleteCluster", "deleteCluster", "deleteCluster", "deleteClusterCallable"] @@ -28,6 +34,12 @@ "DeleteInstance": { "methods": ["deleteInstance", "deleteInstance", "deleteInstance", "deleteInstanceCallable"] }, + "DeleteLogicalView": { + "methods": ["deleteLogicalView", "deleteLogicalView", "deleteLogicalView", "deleteLogicalViewCallable"] + }, + "DeleteMaterializedView": { + "methods": ["deleteMaterializedView", "deleteMaterializedView", "deleteMaterializedView", "deleteMaterializedViewCallable"] + }, "GetAppProfile": { "methods": ["getAppProfile", "getAppProfile", "getAppProfile", "getAppProfileCallable"] }, @@ -40,15 +52,33 @@ "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"] }, @@ -66,6 +96,12 @@ }, "UpdateInstance": { "methods": ["updateInstance", "updateInstanceCallable"] + }, + "UpdateLogicalView": { + "methods": ["updateLogicalViewAsync", "updateLogicalViewAsync", "updateLogicalViewOperationCallable", "updateLogicalViewCallable"] + }, + "UpdateMaterializedView": { + "methods": ["updateMaterializedViewAsync", "updateMaterializedViewAsync", "updateMaterializedViewOperationCallable", "updateMaterializedViewCallable"] } } } @@ -79,18 +115,33 @@ "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"] }, @@ -103,21 +154,33 @@ "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"] }, @@ -139,8 +202,20 @@ "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"] } } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java index 8cccf3d578..a0fef3c0fc 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/internal/NameUtil.java @@ -16,8 +16,10 @@ 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. @@ -34,6 +36,12 @@ public class NameUtil { 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; } @@ -46,6 +54,20 @@ public static String formatTableName(String projectId, String instanceId, String 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; } @@ -55,6 +77,16 @@ public static String formatBackupName( 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()) { @@ -71,6 +103,23 @@ public static String extractBackupIdFromBackupName(String 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()) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java index 848b84ba68..247d2fc2b8 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AppProfile.java @@ -16,12 +16,16 @@ 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; /** @@ -64,7 +68,12 @@ private AppProfile(@Nonnull com.google.bigtable.admin.v2.AppProfile proto) { @SuppressWarnings("WeakerAccess") public RoutingPolicy getPolicy() { if (proto.hasMultiClusterRoutingUseAny()) { - return MultiClusterRoutingPolicy.of(); + 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 { @@ -73,6 +82,17 @@ public RoutingPolicy getPolicy() { } } + 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() { @@ -203,6 +223,7 @@ com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting toProto() { return proto; } + @SuppressWarnings("EqualsGetClass") @Override public boolean equals(Object o) { if (this == o) { @@ -226,15 +247,70 @@ public int hashCode() { * available cluster. */ public static class MultiClusterRoutingPolicy implements RoutingPolicy { - private static final MultiClusterRoutingUseAny proto = - MultiClusterRoutingUseAny.getDefaultInstance(); + private final MultiClusterRoutingUseAny proto; /** Creates a new instance of {@link MultiClusterRoutingPolicy}. */ public static MultiClusterRoutingPolicy of() { - return new MultiClusterRoutingPolicy(); + 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() {} + 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 @@ -245,6 +321,7 @@ MultiClusterRoutingUseAny toProto() { return proto; } + @SuppressWarnings("EqualsGetClass") @Override public boolean equals(Object o) { if (this == o) { @@ -253,8 +330,217 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } + MultiClusterRoutingPolicy that = (MultiClusterRoutingPolicy) o; + return Objects.equal(proto, that.proto); + } - return true; + @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 diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedView.java new file mode 100644 index 0000000000..33e40f6458 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java index 54002da634..f57d6fded0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Backup.java @@ -76,6 +76,56 @@ public com.google.bigtable.admin.v2.Backup.State toProto() { } } + 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; @@ -106,6 +156,11 @@ 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; @@ -142,6 +197,33 @@ 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) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java index 1d9d695cea..fb6af29f55 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Cluster.java @@ -30,6 +30,7 @@ * 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), @@ -147,6 +148,51 @@ 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. @@ -156,6 +202,19 @@ 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) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfig.java new file mode 100644 index 0000000000..fe83273cf8 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java index 975f5b52fa..7203eb274b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ColumnFamily.java @@ -18,7 +18,6 @@ import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; import com.google.api.core.InternalApi; -import com.google.bigtable.admin.v2.GcRule; import com.google.bigtable.admin.v2.GcRule.RuleCase; import com.google.cloud.bigtable.admin.v2.models.GCRules.GCRule; import com.google.common.base.MoreObjects; @@ -28,18 +27,18 @@ 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) { - // TODO(igorbernstein): can getGcRule ever be null? - GcRule ruleProto = MoreObjects.firstNonNull(proto.getGcRule(), GcRule.getDefaultInstance()); - - return new ColumnFamily(id, GCRULES.fromProto(ruleProto)); + return new ColumnFamily( + id, GCRULES.fromProto(proto.getGcRule()), Type.fromProto(proto.getValueType())); } - private ColumnFamily(String id, GCRule rule) { + private ColumnFamily(String id, GCRule rule, Type type) { this.id = id; this.rule = rule; + this.valueType = type; } /** Gets the column family's id. */ @@ -47,16 +46,25 @@ public String getId() { return id; } - /** Get's the GCRule configured for the column family. */ + /** 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) { @@ -66,16 +74,22 @@ public boolean equals(Object o) { return false; } ColumnFamily that = (ColumnFamily) o; - return Objects.equal(id, that.id) && Objects.equal(rule, that.rule); + 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); + return Objects.hashCode(id, rule, valueType); } @Override public String toString() { - return MoreObjects.toStringHelper(this).add("id", id).add("GCRule", rule).toString(); + return MoreObjects.toStringHelper(this) + .add("id", id) + .add("GCRule", rule) + .add("valueType", valueType) + .toString(); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.java new file mode 100644 index 0000000000..f338776503 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.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.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(); + + public static ConsistencyRequest forReplication(String tableId) { + return new AutoValue_ConsistencyRequest( + tableId, CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES, null); + } + + /** + * 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); + } + + public static ConsistencyRequest forDataBoost(String tableId) { + return new AutoValue_ConsistencyRequest( + tableId, CheckConsistencyRequest.ModeCase.DATA_BOOST_READ_LOCAL_WRITES, null); + } + + @InternalApi + public CheckConsistencyRequest toCheckConsistencyProto( + TableAdminRequestContext requestContext, String token) { + CheckConsistencyRequest.Builder builder = CheckConsistencyRequest.newBuilder(); + TableName tableName = + TableName.of(requestContext.getProjectId(), requestContext.getInstanceId(), getTableId()); + + if (getMode().equals(CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES)) { + builder.setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()); + } else { + builder.setDataBoostReadLocalWrites(DataBoostReadLocalWrites.newBuilder().build()); + } + + return builder.setName(tableName.toString()).setConsistencyToken(token).build(); + } + + @InternalApi + public GenerateConsistencyTokenRequest toGenerateTokenProto( + TableAdminRequestContext requestContext) { + GenerateConsistencyTokenRequest.Builder builder = GenerateConsistencyTokenRequest.newBuilder(); + TableName tableName = + TableName.of(requestContext.getProjectId(), requestContext.getInstanceId(), getTableId()); + + return builder.setName(tableName.toString()).build(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequest.java new file mode 100644 index 0000000000..88b50376be --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java index 35c41208be..2ad236c07b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequest.java @@ -17,9 +17,11 @@ 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; @@ -92,6 +94,25 @@ public CreateAppProfileRequest setRoutingPolicy(RoutingPolicy 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. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequest.java new file mode 100644 index 0000000000..0c251fa666 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java index 1a27546c8d..542ba8da20 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequest.java @@ -58,6 +58,23 @@ public CreateBackupRequest setExpireTime(Instant expireTime) { 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) { @@ -69,12 +86,23 @@ public boolean equals(Object o) { CreateBackupRequest that = (CreateBackupRequest) o; return Objects.equal(requestBuilder.getBackupId(), that.requestBuilder.getBackupId()) && Objects.equal(clusterId, that.clusterId) - && Objects.equal(sourceTableId, that.sourceTableId); + && 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); + return Objects.hashCode( + requestBuilder.getBackupId(), + clusterId, + sourceTableId, + requestBuilder.getBackup().getBackupType(), + requestBuilder.getBackup().getHotToStandardTime()); } @InternalApi diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java index 4711097d53..c7ad0a6e38 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequest.java @@ -49,6 +49,7 @@ * 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 @@ -83,13 +84,68 @@ public CreateClusterRequest setZone(String zone) { /** * 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}. @@ -104,6 +160,17 @@ public CreateClusterRequest setStorageType(@Nonnull StorageType storageType) { 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. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java index 467344c821..092a4c7aa0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateInstanceRequest.java @@ -16,7 +16,6 @@ package com.google.cloud.bigtable.admin.v2.models; import com.google.api.core.InternalApi; -import com.google.bigtable.admin.v2.Instance.Type; import com.google.cloud.bigtable.admin.v2.internal.NameUtil; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -74,7 +73,7 @@ private CreateInstanceRequest(@Nonnull String instanceId) { builder.setInstanceId(instanceId); builder.getInstanceBuilder().setDisplayName(instanceId); - builder.getInstanceBuilder().setType(Type.PRODUCTION); + builder.getInstanceBuilder().setType(com.google.bigtable.admin.v2.Instance.Type.PRODUCTION); } /** @@ -119,7 +118,23 @@ public CreateInstanceRequest addLabel(@Nonnull String key, @Nonnull String value } /** - * Adds a cluster to the instance request. + * 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. @@ -140,13 +155,70 @@ public CreateInstanceRequest addCluster( CreateClusterRequest clusterRequest = CreateClusterRequest.of("ignored-instance-id", clusterId) .setZone(zone) - .setServeNodes(serveNodes) + .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. * diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequest.java new file mode 100644 index 0000000000..5a3a6e0f5f --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequest.java new file mode 100644 index 0000000000..983a0a48e1 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequest.java new file mode 100644 index 0000000000..b6d88e2b53 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java index 03022b8763..88e6b99c22 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequest.java @@ -16,6 +16,7 @@ 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; @@ -23,6 +24,7 @@ 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} @@ -61,21 +63,92 @@ public CreateTableRequest addFamily(String familyId) { * * @see GCRule for available options. */ - public CreateTableRequest addFamily(String familyId, GCRule gcRule) { + 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); - requestBuilder - .getTableBuilder() - .putColumnFamilies(familyId, ColumnFamily.newBuilder().setGcRule(gcRule.toProto()).build()); + 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 */ + /** 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) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfo.java new file mode 100644 index 0000000000..b96e0ade13 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsets.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsets.java new file mode 100644 index 0000000000..e80452b2af --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilder.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilder.java new file mode 100644 index 0000000000..552a789624 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java index c3a0c43bca..df163b0e0d 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Instance.java @@ -150,6 +150,12 @@ 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() { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/IntersectionRuleBuilder.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/IntersectionRuleBuilder.java new file mode 100644 index 0000000000..96891669c4 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/LogicalView.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/LogicalView.java new file mode 100644 index 0000000000..48100c81de --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/MaterializedView.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/MaterializedView.java new file mode 100644 index 0000000000..c3bf494c03 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java index d4d0f2a992..664c54aede 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ModifyColumnFamiliesRequest.java @@ -55,9 +55,31 @@ public ModifyColumnFamiliesRequest addFamily(String familyId) { /** 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); - modification.getCreateBuilder().setGcRule(gcRule.toProto()); + 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; } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java index 7b95983225..f04bdf326e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListClustersException.java @@ -33,7 +33,7 @@ public class PartialListClustersException extends RuntimeException { */ @InternalApi public PartialListClustersException(List unavailableZones, List clusters) { - super("Failed to list all instances, some zones where unavailable"); + super("Failed to list all clusters, some zones were unavailable: " + unavailableZones); this.unavailableZones = ImmutableList.copyOf(unavailableZones); this.clusters = ImmutableList.copyOf(clusters); } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java index d4d5d4e992..a24d66fb27 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/PartialListInstancesException.java @@ -31,7 +31,7 @@ public class PartialListInstancesException extends RuntimeException { @InternalApi public PartialListInstancesException( @Nonnull List unavailableZones, @Nonnull List instances) { - super("Failed to list all instances, some zones where unavailable"); + super("Failed to list all instances, some zones were unavailable: " + unavailableZones); this.unavailableZones = ImmutableList.copyOf(unavailableZones); this.instances = ImmutableList.copyOf(instances); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java index fa47ba582e..b801b0db3b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequest.java @@ -20,24 +20,66 @@ 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 backupId; - private final String clusterId; + private final String sourceBackupId; + private final String sourceClusterId; + private final String sourceInstanceId; + private final String sourceProjectId; - public static RestoreTableRequest of(String clusterId, String backupId) { - RestoreTableRequest request = new RestoreTableRequest(clusterId, backupId); + /** + * 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; } - private RestoreTableRequest(String clusterId, String backupId) { - Preconditions.checkNotNull(clusterId); - Preconditions.checkNotNull(backupId); - this.backupId = backupId; - this.clusterId = clusterId; + /** + * 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) { @@ -56,13 +98,20 @@ public boolean equals(Object o) { } RestoreTableRequest that = (RestoreTableRequest) o; return Objects.equal(requestBuilder.getTableId(), that.requestBuilder.getTableId()) - && Objects.equal(clusterId, that.clusterId) - && Objects.equal(backupId, that.backupId); + && 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(), clusterId, backupId); + return Objects.hashCode( + requestBuilder.getTableId(), + sourceInstanceId, + sourceClusterId, + sourceBackupId, + sourceProjectId); } @InternalApi @@ -73,7 +122,12 @@ public com.google.bigtable.admin.v2.RestoreTableRequest toProto( return requestBuilder .setParent(NameUtil.formatInstanceName(projectId, instanceId)) - .setBackup(NameUtil.formatBackupName(projectId, instanceId, clusterId, backupId)) + .setBackup( + NameUtil.formatBackupName( + sourceProjectId == null ? projectId : sourceProjectId, + sourceInstanceId == null ? instanceId : sourceInstanceId, + sourceClusterId, + sourceBackupId)) .build(); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundle.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundle.java new file mode 100644 index 0000000000..7782c335a2 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSize.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSize.java new file mode 100644 index 0000000000..c6826e03c4 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java new file mode 100644 index 0000000000..dc0e599286 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java index bb852b25ae..2163b8c47d 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Table.java @@ -13,10 +13,12 @@ * 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; @@ -25,6 +27,8 @@ 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 { @@ -57,7 +61,7 @@ public enum ReplicationState { /** * 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. + * performance. When optimizations are complete, the table will transition to`READY` state. */ READY_OPTIMIZING( com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.READY_OPTIMIZING), @@ -98,11 +102,51 @@ public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState toProto( } } + 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(); @@ -120,18 +164,42 @@ public static Table fromProto(@Nonnull com.google.bigtable.admin.v2.Table proto) 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()); + TableName.parse(proto.getName()), + replicationStates.build(), + columnFamilies.build(), + changeStreamConfig, + proto.getDeletionProtection(), + automatedBackupPolicy); } private Table( TableName tableName, Map replicationStatesByClusterId, - List columnFamilies) { + 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. */ @@ -152,6 +220,26 @@ 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) { @@ -164,11 +252,21 @@ public boolean equals(Object o) { return Objects.equal(id, table.id) && Objects.equal(instanceId, table.instanceId) && Objects.equal(replicationStatesByClusterId, table.replicationStatesByClusterId) - && Objects.equal(columnFamilies, table.columnFamilies); + && 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); + return Objects.hashCode( + id, + instanceId, + replicationStatesByClusterId, + columnFamilies, + changeStreamRetention, + deletionProtection, + automatedBackupPolicy); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java new file mode 100644 index 0000000000..0505aa90b3 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UnionRuleBuilder.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UnionRuleBuilder.java new file mode 100644 index 0000000000..0d4c1ba70a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java index 1697b47f76..b5e14f4f2a 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java @@ -17,9 +17,12 @@ 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; @@ -121,6 +124,29 @@ public UpdateAppProfileRequest setRoutingPolicy(@Nonnull RoutingPolicy routingPo 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); @@ -151,11 +177,11 @@ public boolean equals(Object o) { UpdateAppProfileRequest that = (UpdateAppProfileRequest) o; return Objects.equal(instanceId, that.instanceId) && Objects.equal(appProfileId, that.appProfileId) - && Objects.equal(proto, that.proto); + && Objects.equal(proto.build(), that.proto.build()); } @Override public int hashCode() { - return Objects.hashCode(instanceId, appProfileId, proto); + return Objects.hashCode(instanceId, appProfileId, proto.build()); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequest.java new file mode 100644 index 0000000000..fbb54c994e --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java index 9f8aa6a799..9bf9076b0c 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequest.java @@ -16,10 +16,12 @@ 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; @@ -43,12 +45,35 @@ private UpdateBackupRequest(String clusterId, String 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())); - requestBuilder.setUpdateMask(FieldMask.newBuilder().addPaths("expire_time")); + 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; } @@ -64,6 +89,9 @@ public boolean equals(Object 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); @@ -73,6 +101,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hashCode( requestBuilder.getBackupBuilder().getExpireTime(), + requestBuilder.getBackupBuilder().getHotToStandardTime(), requestBuilder.getUpdateMask(), backupId); } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java index ac64fa1f91..ddab8e7b88 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequest.java @@ -17,7 +17,6 @@ import com.google.api.core.InternalApi; import com.google.bigtable.admin.v2.Instance; -import com.google.bigtable.admin.v2.Instance.Type; import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; import com.google.cloud.bigtable.admin.v2.internal.NameUtil; import com.google.common.base.Preconditions; @@ -64,7 +63,7 @@ public UpdateInstanceRequest setDisplayName(@Nonnull String displayName) { */ @SuppressWarnings("WeakerAccess") public UpdateInstanceRequest setProductionType() { - builder.getInstanceBuilder().setType(Type.PRODUCTION); + builder.getInstanceBuilder().setType(Instance.Type.PRODUCTION); updateFieldMask(Instance.TYPE_FIELD_NUMBER); return this; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequest.java new file mode 100644 index 0000000000..6cbc55a28d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequest.java new file mode 100644 index 0000000000..57823da81f --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequest.java new file mode 100644 index 0000000000..904c4d0097 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java new file mode 100644 index 0000000000..1d6d635ac0 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java new file mode 100644 index 0000000000..b4e42e2354 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java @@ -0,0 +1,222 @@ +/* + * 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; + +/** + * 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; + + private final TableAdminRequestContext requestContext; + + static AwaitConsistencyCallable create( + UnaryCallable + generateCallable, + UnaryCallable checkCallable, + ClientContext clientContext, + RetrySettings pollingSettings, + 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); + } + + @VisibleForTesting + AwaitConsistencyCallable( + UnaryCallable + generateCallable, + UnaryCallable checkCallable, + RetryingExecutor executor, + 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 = + consistencyRequest.toCheckConsistencyProto( + requestContext, consistencyRequest.getConsistencyToken()); + return pollToken(request, apiCallContext); + } + + ApiFuture tokenFuture = + generateToken(consistencyRequest.toGenerateTokenProto(requestContext), apiCallContext); + + return ApiFutures.transformAsync( + tokenFuture, + new ApiAsyncFunction() { + @Override + public ApiFuture apply(GenerateConsistencyTokenResponse input) { + CheckConsistencyRequest request = + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java index a09026f7f7..53b3be73e6 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallable.java @@ -15,31 +15,12 @@ */ 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.ResultRetryAlgorithm; -import com.google.api.gax.retrying.RetryAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -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.bigtable.admin.v2.TableName; +import com.google.cloud.bigtable.admin.v2.models.ConsistencyRequest; import com.google.common.annotations.VisibleForTesting; -import com.google.common.util.concurrent.MoreExecutors; -import java.util.concurrent.Callable; -import java.util.concurrent.CancellationException; /** * Callable that waits until replication has caught up to the point it was called. @@ -47,144 +28,27 @@ *

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 UnaryCallable - generateCallable; - private final UnaryCallable checkCallable; - private final RetryingExecutor executor; - - static AwaitReplicationCallable create( - UnaryCallable - generateCallable, - UnaryCallable checkCallable, - ClientContext clientContext, - RetrySettings pollingSettings) { + private final AwaitConsistencyCallable awaitConsistencyCallable; - RetryAlgorithm retryAlgorithm = - new RetryAlgorithm<>( - new PollResultAlgorithm(), - new ExponentialPollAlgorithm(pollingSettings, clientContext.getClock())); + static AwaitReplicationCallable create(AwaitConsistencyCallable awaitConsistencyCallable) { - RetryingExecutor retryingExecutor = - new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); - - return new AwaitReplicationCallable(generateCallable, checkCallable, retryingExecutor); - } - - @VisibleForTesting - AwaitReplicationCallable( - UnaryCallable - generateCallable, - UnaryCallable checkCallable, - RetryingExecutor executor) { - this.generateCallable = generateCallable; - this.checkCallable = checkCallable; - this.executor = executor; + return new AwaitReplicationCallable(awaitConsistencyCallable); } @Override public ApiFuture futureCall(final TableName tableName, final ApiCallContext context) { - ApiFuture tokenFuture = generateToken(tableName, context); - - return ApiFutures.transformAsync( - tokenFuture, - new ApiAsyncFunction() { - @Override - public ApiFuture apply(GenerateConsistencyTokenResponse input) { - CheckConsistencyRequest request = - CheckConsistencyRequest.newBuilder() - .setName(tableName.toString()) - .setConsistencyToken(input.getConsistencyToken()) - .build(); - - return pollToken(request, context); - } - }, - MoreExecutors.directExecutor()); - } - - private ApiFuture generateToken( - TableName tableName, ApiCallContext context) { - GenerateConsistencyTokenRequest generateRequest = - GenerateConsistencyTokenRequest.newBuilder().setName(tableName.toString()).build(); - 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(); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(tableName.getTable()); - return ApiFutures.transform( - retryingFuture, - new ApiFunction() { - @Override - public Void apply(CheckConsistencyResponse input) { - return null; - } - }, - MoreExecutors.directExecutor()); + return awaitConsistencyCallable.futureCall(consistencyRequest, context); } - /** 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 volatile 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 ResultRetryAlgorithm { - @Override - public TimedAttemptSettings createNextAttempt( - Throwable prevThrowable, - CheckConsistencyResponse prevResponse, - TimedAttemptSettings prevSettings) { - return null; - } - - @Override - public boolean shouldRetry(Throwable prevThrowable, CheckConsistencyResponse prevResponse) - throws CancellationException { - return prevResponse != null && !prevResponse.getConsistent(); - } + @VisibleForTesting + AwaitReplicationCallable(AwaitConsistencyCallable awaitConsistencyCallable) { + this.awaitConsistencyCallable = awaitConsistencyCallable; } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java index 2ab20acd6b..73db53f15e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,10 @@ 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.InternalApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -29,24 +31,46 @@ 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; @@ -58,9 +82,12 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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() { @@ -128,6 +155,16 @@ 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()"); } @@ -175,6 +212,94 @@ public UnaryCallable setIamPolicyCallable() { 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java index d178602d65..86fa2b0ba9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,10 +17,13 @@ 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.BetaApi; +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; @@ -34,6 +37,7 @@ 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; @@ -51,24 +55,47 @@ 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; @@ -81,9 +108,9 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -100,9 +127,16 @@ *

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 total timeout of getInstance to 30 seconds: + *

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
@@ -112,13 +146,51 @@
  *             .getInstanceSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .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. */ @@ -154,6 +226,11 @@ public class BigtableInstanceAdminStubSettings 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; @@ -168,6 +245,41 @@ public class BigtableInstanceAdminStubSettings 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> @@ -202,9 +314,119 @@ public String extractNextToken(ListAppProfilesResponse payload) { @Override public Iterable extractResources(ListAppProfilesResponse payload) { - return payload.getAppProfilesList() == null - ? ImmutableList.of() - : payload.getAppProfilesList(); + 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(); } }; @@ -225,6 +447,66 @@ public ApiFuture getFuturePagedResponse( } }; + 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; @@ -300,6 +582,17 @@ public UnaryCallSettings updateClusterSettings() { 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; @@ -354,7 +647,98 @@ public UnaryCallSettings setIamPolicySettings() { return testIamPermissionsSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + /** 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() @@ -366,16 +750,28 @@ public BigtableInstanceAdminStub createStub() throws IOException { "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; @@ -383,7 +779,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ @@ -396,7 +794,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -438,6 +835,9 @@ protected BigtableInstanceAdminStubSettings(Builder settingsBuilder) throws IOEx 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(); @@ -448,6 +848,33 @@ protected BigtableInstanceAdminStubSettings(Builder settingsBuilder) throws IOEx 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/java-bigtable") + .build(); } /** Builder for BigtableInstanceAdminStubSettings. */ @@ -479,6 +906,11 @@ public static class Builder 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; @@ -497,6 +929,45 @@ public static class Builder 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; @@ -512,6 +983,7 @@ public static class Builder 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(); } @@ -522,31 +994,33 @@ public static class Builder RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(300000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(300000L)) - .setTotalTimeout(Duration.ofMillis(300000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(300000L)) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build(); definitions.put("no_retry_5_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_6_params", settings); settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .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(); } @@ -571,6 +1045,8 @@ protected Builder(ClientContext clientContext) { listClustersSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); updateClusterOperationSettings = OperationCallSettings.newBuilder(); + partialUpdateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + partialUpdateClusterOperationSettings = OperationCallSettings.newBuilder(); deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); createAppProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getAppProfileSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -581,6 +1057,22 @@ protected Builder(ClientContext clientContext) { 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( @@ -594,6 +1086,7 @@ protected Builder(ClientContext clientContext) { getClusterSettings, listClustersSettings, updateClusterSettings, + partialUpdateClusterSettings, deleteClusterSettings, createAppProfileSettings, getAppProfileSettings, @@ -602,7 +1095,18 @@ protected Builder(ClientContext clientContext) { deleteAppProfileSettings, getIamPolicySettings, setIamPolicySettings, - testIamPermissionsSettings); + testIamPermissionsSettings, + listHotTabletsSettings, + createLogicalViewSettings, + getLogicalViewSettings, + listLogicalViewsSettings, + updateLogicalViewSettings, + deleteLogicalViewSettings, + createMaterializedViewSettings, + getMaterializedViewSettings, + listMaterializedViewsSettings, + updateMaterializedViewSettings, + deleteMaterializedViewSettings); initDefaults(this); } @@ -624,6 +1128,9 @@ protected Builder(BigtableInstanceAdminStubSettings settings) { 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(); @@ -634,6 +1141,23 @@ protected Builder(BigtableInstanceAdminStubSettings settings) { 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( @@ -647,6 +1171,7 @@ protected Builder(BigtableInstanceAdminStubSettings settings) { getClusterSettings, listClustersSettings, updateClusterSettings, + partialUpdateClusterSettings, deleteClusterSettings, createAppProfileSettings, getAppProfileSettings, @@ -655,7 +1180,18 @@ protected Builder(BigtableInstanceAdminStubSettings settings) { deleteAppProfileSettings, getIamPolicySettings, setIamPolicySettings, - testIamPermissionsSettings); + testIamPermissionsSettings, + listHotTabletsSettings, + createLogicalViewSettings, + getLogicalViewSettings, + listLogicalViewsSettings, + updateLogicalViewSettings, + deleteLogicalViewSettings, + createMaterializedViewSettings, + getMaterializedViewSettings, + listMaterializedViewsSettings, + updateMaterializedViewSettings, + deleteMaterializedViewSettings); } private static Builder createDefault() { @@ -664,7 +1200,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } @@ -720,6 +1257,11 @@ private static Builder initDefaults(Builder builder) { .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")) @@ -765,6 +1307,61 @@ private static Builder initDefaults(Builder builder) { .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( @@ -780,13 +1377,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) .build())); builder @@ -804,13 +1401,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) .build())); builder @@ -828,13 +1425,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(21600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(21600000L)) .build())); builder @@ -851,13 +1448,38 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .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 @@ -875,26 +1497,125 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .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; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * 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) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -909,8 +1630,6 @@ public UnaryCallSettings.Builder createInstanc } /** Returns the builder for the settings used for calls to createInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder createInstanceOperationSettings() { return createInstanceOperationSettings; @@ -939,8 +1658,6 @@ public UnaryCallSettings.Builder updateInstanceSettings() { } /** Returns the builder for the settings used for calls to partialUpdateInstance. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< PartialUpdateInstanceRequest, Instance, UpdateInstanceMetadata> partialUpdateInstanceOperationSettings() { @@ -958,8 +1675,6 @@ public UnaryCallSettings.Builder createClusterS } /** Returns the builder for the settings used for calls to createCluster. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder createClusterOperationSettings() { return createClusterOperationSettings; @@ -982,13 +1697,24 @@ public UnaryCallSettings.Builder updateClusterSettings() { } /** Returns the builder for the settings used for calls to updateCluster. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") 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; @@ -1019,8 +1745,6 @@ public UnaryCallSettings.Builder getAppProfile } /** Returns the builder for the settings used for calls to updateAppProfile. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< UpdateAppProfileRequest, AppProfile, UpdateAppProfileMetadata> updateAppProfileOperationSettings() { @@ -1048,6 +1772,103 @@ public UnaryCallSettings.Builder setIamPolicySettin 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java index 4dc95ce042..db34b67438 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,33 +16,49 @@ 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.InternalApi; 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; @@ -50,11 +66,20 @@ 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; @@ -66,9 +91,12 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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() { @@ -102,10 +130,68 @@ 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()"); } @@ -188,6 +274,15 @@ 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()"); } @@ -201,6 +296,44 @@ public UnaryCallable setIamPolicyCallable() { 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java index 8d785624e9..e4baf9f806 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,15 @@ 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.BetaApi; +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; @@ -36,6 +38,7 @@ 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; @@ -46,25 +49,40 @@ 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; @@ -72,11 +90,20 @@ 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; @@ -89,9 +116,9 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** @@ -108,9 +135,16 @@ *

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 total timeout of createTable to 30 seconds: + *

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
@@ -120,13 +154,51 @@
  *             .createTableSettings()
  *             .getRetrySettings()
  *             .toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .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 = @@ -148,7 +220,29 @@ public class BigtableTableAdminStubSettings extends StubSettings 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 @@ -174,10 +268,26 @@ public class BigtableTableAdminStubSettings extends StubSettings 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 = @@ -209,9 +319,45 @@ public String extractNextToken(ListTablesResponse payload) { @Override public Iterable
extractResources(ListTablesResponse payload) { - return payload.getTablesList() == null - ? ImmutableList.
of() - : payload.getTablesList(); + 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(); } }; @@ -245,9 +391,7 @@ public String extractNextToken(ListSnapshotsResponse payload) { @Override public Iterable extractResources(ListSnapshotsResponse payload) { - return payload.getSnapshotsList() == null - ? ImmutableList.of() - : payload.getSnapshotsList(); + return payload.getSnapshotsList(); } }; @@ -281,9 +425,45 @@ public String extractNextToken(ListBackupsResponse payload) { @Override public Iterable extractResources(ListBackupsResponse payload) { - return payload.getBackupsList() == null - ? ImmutableList.of() - : payload.getBackupsList(); + 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(); } }; @@ -304,6 +484,27 @@ public ApiFuture getFuturePagedResponse( } }; + 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 = @@ -338,6 +539,27 @@ public ApiFuture getFuturePagedResponse( } }; + 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; @@ -367,11 +589,74 @@ 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; @@ -464,6 +749,17 @@ public UnaryCallSettings restoreTableSettings() 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; @@ -480,7 +776,45 @@ public UnaryCallSettings setIamPolicySettings() { return testIamPermissionsSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + /** 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() @@ -492,16 +826,28 @@ public BigtableTableAdminStub createStub() throws IOException { "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; @@ -509,7 +855,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ @@ -522,7 +870,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( @@ -555,7 +902,20 @@ protected BigtableTableAdminStubSettings(Builder settingsBuilder) throws IOExcep 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(); @@ -573,9 +933,28 @@ protected BigtableTableAdminStubSettings(Builder settingsBuilder) throws IOExcep 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/java-bigtable") + .build(); } /** Builder for BigtableTableAdminStubSettings. */ @@ -592,7 +971,32 @@ public static class 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; @@ -622,10 +1026,30 @@ public static class Builder 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; @@ -640,8 +1064,6 @@ public static class Builder ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "no_retry_4_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( @@ -649,6 +1071,8 @@ public static class Builder 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(); } @@ -659,52 +1083,52 @@ public static class Builder RetrySettings settings = null; settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(300000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(300000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(300000L)) - .setTotalTimeout(Duration.ofMillis(300000L)) + .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() - .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_2_params", settings); settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); - definitions.put("no_retry_1_params", settings); + definitions.put("no_retry_4_params", settings); settings = RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(3600000L)) + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(3600000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) .build(); - definitions.put("no_retry_4_params", settings); + definitions.put("retry_policy_3_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_3_params", settings); + definitions.put("no_retry_1_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -720,7 +1144,19 @@ protected Builder(ClientContext clientContext) { 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(); @@ -738,9 +1174,18 @@ protected Builder(ClientContext clientContext) { 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( @@ -748,7 +1193,14 @@ protected Builder(ClientContext clientContext) { createTableFromSnapshotSettings, listTablesSettings, getTableSettings, + updateTableSettings, deleteTableSettings, + undeleteTableSettings, + createAuthorizedViewSettings, + listAuthorizedViewsSettings, + getAuthorizedViewSettings, + updateAuthorizedViewSettings, + deleteAuthorizedViewSettings, modifyColumnFamiliesSettings, dropRowRangeSettings, generateConsistencyTokenSettings, @@ -763,9 +1215,15 @@ protected Builder(ClientContext clientContext) { deleteBackupSettings, listBackupsSettings, restoreTableSettings, + copyBackupSettings, getIamPolicySettings, setIamPolicySettings, - testIamPermissionsSettings); + testIamPermissionsSettings, + createSchemaBundleSettings, + updateSchemaBundleSettings, + getSchemaBundleSettings, + listSchemaBundlesSettings, + deleteSchemaBundleSettings); initDefaults(this); } @@ -778,7 +1236,20 @@ protected Builder(BigtableTableAdminStubSettings settings) { 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(); @@ -796,9 +1267,20 @@ protected Builder(BigtableTableAdminStubSettings settings) { 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( @@ -806,7 +1288,14 @@ protected Builder(BigtableTableAdminStubSettings settings) { createTableFromSnapshotSettings, listTablesSettings, getTableSettings, + updateTableSettings, deleteTableSettings, + undeleteTableSettings, + createAuthorizedViewSettings, + listAuthorizedViewsSettings, + getAuthorizedViewSettings, + updateAuthorizedViewSettings, + deleteAuthorizedViewSettings, modifyColumnFamiliesSettings, dropRowRangeSettings, generateConsistencyTokenSettings, @@ -821,9 +1310,15 @@ protected Builder(BigtableTableAdminStubSettings settings) { deleteBackupSettings, listBackupsSettings, restoreTableSettings, + copyBackupSettings, getIamPolicySettings, setIamPolicySettings, - testIamPermissionsSettings); + testIamPermissionsSettings, + createSchemaBundleSettings, + updateSchemaBundleSettings, + getSchemaBundleSettings, + listSchemaBundlesSettings, + deleteSchemaBundleSettings); } private static Builder createDefault() { @@ -832,7 +1327,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } @@ -858,10 +1354,45 @@ private static Builder initDefaults(Builder builder) { .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_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .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() @@ -875,8 +1406,8 @@ private static Builder initDefaults(Builder builder) { builder .generateConsistencyTokenSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .checkConsistencySettings() @@ -895,18 +1426,18 @@ private static Builder initDefaults(Builder builder) { builder .listSnapshotsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .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_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .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_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .getBackupSettings() @@ -920,8 +1451,8 @@ private static Builder initDefaults(Builder builder) { builder .deleteBackupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); builder .listBackupsSettings() @@ -930,13 +1461,18 @@ private static Builder initDefaults(Builder builder) { 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_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .setIamPolicySettings() @@ -945,8 +1481,33 @@ private static Builder initDefaults(Builder builder) { builder .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .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() @@ -964,13 +1525,110 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) + .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) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(3600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); builder @@ -988,13 +1646,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) .build())); builder @@ -1002,8 +1660,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .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)) @@ -1012,13 +1670,13 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelayDuration(Duration.ofMillis(500L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(5000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) .build())); builder @@ -1026,8 +1684,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .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)) @@ -1036,26 +1694,98 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .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) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(600000L)) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) .build())); return builder; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * 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) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -1076,8 +1806,6 @@ public UnaryCallSettings.Builder createTableSettings( } /** Returns the builder for the settings used for calls to createTableFromSnapshot. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< CreateTableFromSnapshotRequest, Table, CreateTableFromSnapshotMetadata> createTableFromSnapshotOperationSettings() { @@ -1095,11 +1823,80 @@ 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() { @@ -1130,8 +1927,6 @@ public UnaryCallSettings.Builder snapshotTableS } /** Returns the builder for the settings used for calls to snapshotTable. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder snapshotTableOperationSettings() { return snapshotTableOperationSettings; @@ -1160,8 +1955,6 @@ public UnaryCallSettings.Builder createBackupSet } /** Returns the builder for the settings used for calls to createBackup. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder createBackupOperationSettings() { return createBackupOperationSettings; @@ -1195,13 +1988,22 @@ public UnaryCallSettings.Builder restoreTableSet } /** Returns the builder for the settings used for calls to restoreTable. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") 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; @@ -1218,6 +2020,51 @@ public UnaryCallSettings.Builder setIamPolicySettin 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java index 0a6e8efec3..e68cafca54 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java @@ -31,6 +31,8 @@ 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; @@ -52,27 +54,43 @@ public class EnhancedBigtableTableAdminStub extends GrpcBigtableTableAdminStub { private final BigtableTableAdminStubSettings settings; private final ClientContext clientContext; - private final AwaitReplicationCallable awaitReplicationCallable; + private final TableAdminRequestContext requestContext; + + @Deprecated private final AwaitReplicationCallable awaitReplicationCallable; + + private final AwaitConsistencyCallable awaitConsistencyCallable; private final OperationCallable optimizeRestoredTableOperationBaseCallable; public static EnhancedBigtableTableAdminStub createEnhanced( - BigtableTableAdminStubSettings settings) throws IOException { - return new EnhancedBigtableTableAdminStub(settings, ClientContext.create(settings)); + BigtableTableAdminStubSettings settings, TableAdminRequestContext requestContext) + throws IOException { + return new EnhancedBigtableTableAdminStub( + settings, ClientContext.create(settings), requestContext); } private EnhancedBigtableTableAdminStub( - BigtableTableAdminStubSettings settings, ClientContext clientContext) throws IOException { + BigtableTableAdminStubSettings settings, + ClientContext clientContext, + 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() @@ -84,7 +102,6 @@ private AwaitReplicationCallable createAwaitReplicationCallable() { .setInitialRetryDelay(Duration.ofSeconds(10)) .setRetryDelayMultiplier(1.0) .setMaxRetryDelay(Duration.ofSeconds(10)) - .setJittered(true) // These rpc timeouts are ignored, instead the rpc timeouts defined for // generateConsistencyToken and checkConsistency callables will be used. .setInitialRpcTimeout(Duration.ZERO) @@ -92,11 +109,12 @@ private AwaitReplicationCallable createAwaitReplicationCallable() { .setRpcTimeoutMultiplier(1.0) .build(); - return AwaitReplicationCallable.create( + return AwaitConsistencyCallable.create( generateConsistencyTokenCallable(), checkConsistencyCallable(), clientContext, - pollingSettings); + pollingSettings, + requestContext); } // Plug into gax operation infrastructure @@ -190,10 +208,15 @@ public Empty apply(OperationSnapshot input) { unusedInitialCallSettings, operationCallSettings, clientContext, getOperationsStub()); } + @Deprecated public UnaryCallable awaitReplicationCallable() { return awaitReplicationCallable; } + public UnaryCallable awaitConsistencyCallable() { + return awaitConsistencyCallable; + } + public OperationCallable awaitOptimizeRestoredTableCallable() { return optimizeRestoredTableOperationBaseCallable; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java index ba2d950130..c3df944086 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.bigtable.admin.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; @@ -37,9 +36,12 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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 diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java index dd61c8c919..7c2f8aab23 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,15 +17,17 @@ 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.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.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; +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; @@ -34,25 +36,46 @@ 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.common.collect.ImmutableMap; +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; @@ -64,14 +87,16 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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 = @@ -81,6 +106,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getInstanceMethodDescriptor = @@ -89,6 +115,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetInstance") .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -100,6 +127,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateInstanceMethodDescriptor = @@ -108,6 +136,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/UpdateInstance") .setRequestMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -119,6 +148,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(PartialUpdateInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -129,6 +159,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -139,6 +170,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getClusterMethodDescriptor = @@ -147,6 +179,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/GetCluster") .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -157,6 +190,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller(ProtoUtils.marshaller(ListClustersRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListClustersResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor updateClusterMethodDescriptor = @@ -165,14 +199,28 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .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 @@ -183,6 +231,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateAppProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(AppProfile.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -193,6 +242,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(GetAppProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(AppProfile.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -204,6 +254,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { ProtoUtils.marshaller(ListAppProfilesRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListAppProfilesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -214,6 +265,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(UpdateAppProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -224,6 +276,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteAppProfileRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getIamPolicyMethodDescriptor = @@ -232,6 +285,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .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 = @@ -240,6 +294,7 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableInstanceAdmin/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -252,6 +307,136 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { 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; @@ -273,6 +458,10 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { 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; @@ -288,6 +477,38 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { 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; @@ -337,52 +558,40 @@ protected GrpcBigtableInstanceAdminStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(createInstanceMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateInstanceRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getInstanceMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetInstanceRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listInstancesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listInstancesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListInstancesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateInstanceTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateInstanceMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(Instance request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -390,118 +599,100 @@ public Map extract(Instance request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(partialUpdateInstanceMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(PartialUpdateInstanceRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "instance.name", String.valueOf(request.getInstance().getName())); - return params.build(); - } + 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( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteInstanceRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings createClusterTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createClusterMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateClusterRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getClusterTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getClusterMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetClusterRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listClustersTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listClustersMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListClustersRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateClusterTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateClusterMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(Cluster request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .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( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteClusterRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings createAppProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createAppProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateAppProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getAppProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getAppProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetAppProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -509,66 +700,51 @@ public Map extract(GetAppProfileRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(listAppProfilesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListAppProfilesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateAppProfileTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateAppProfileMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateAppProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "app_profile.name", String.valueOf(request.getAppProfile().getName())); - return params.build(); - } + 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( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteAppProfileRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetIamPolicyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(SetIamPolicyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings @@ -576,15 +752,132 @@ public Map extract(SetIamPolicyRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(TestIamPermissionsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listHotTabletsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listHotTabletsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings createLogicalViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createLogicalViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLogicalViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLogicalViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listLogicalViewsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLogicalViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .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(); + }) + .build(); + GrpcCallSettings + createMaterializedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createMaterializedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getMaterializedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getMaterializedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listMaterializedViewsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listMaterializedViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .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(); + }) + .build(); this.createInstanceCallable = callableFactory.createUnaryCallable( @@ -642,6 +935,17 @@ public Map extract(TestIamPermissionsRequest request) { 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); @@ -680,6 +984,90 @@ public Map extract(TestIamPermissionsRequest request) { 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()); @@ -763,6 +1151,17 @@ public UnaryCallable updateClusterCallable() { return updateClusterOperationCallable; } + @Override + public UnaryCallable partialUpdateClusterCallable() { + return partialUpdateClusterCallable; + } + + @Override + public OperationCallable + partialUpdateClusterOperationCallable() { + return partialUpdateClusterOperationCallable; + } + @Override public UnaryCallable deleteClusterCallable() { return deleteClusterCallable; @@ -821,9 +1220,116 @@ public UnaryCallable setIamPolicyCallable() { 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() { - shutdown(); + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } } @Override diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java index 456418c0fb..9826dedb73 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ package com.google.cloud.bigtable.admin.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; @@ -37,9 +36,12 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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 diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java index e3573b8660..174683dc21 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,38 +16,54 @@ 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.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.OperationCallable; -import com.google.api.gax.rpc.RequestParamsExtractor; +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; @@ -55,12 +71,20 @@ 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.common.collect.ImmutableMap; +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; @@ -72,14 +96,16 @@ import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. -/** For internal use only. */ -@Generated("by gapic-generator") -@InternalApi +/** + * 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() @@ -87,6 +113,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/CreateTable") .setRequestMarshaller(ProtoUtils.marshaller(CreateTableRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Table.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -98,6 +125,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(CreateTableFromSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -107,6 +135,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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 = @@ -115,6 +144,16 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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 = @@ -123,8 +162,76 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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() @@ -133,6 +240,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(ModifyColumnFamiliesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Table.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor dropRowRangeMethodDescriptor = @@ -141,6 +249,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange") .setRequestMarshaller(ProtoUtils.marshaller(DropRowRangeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor< @@ -155,6 +264,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { ProtoUtils.marshaller(GenerateConsistencyTokenRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(GenerateConsistencyTokenResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -166,6 +276,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { ProtoUtils.marshaller(CheckConsistencyRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(CheckConsistencyResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -176,6 +287,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(SnapshotTableRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor getSnapshotMethodDescriptor = @@ -184,6 +296,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot") .setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -195,6 +308,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { ProtoUtils.marshaller(ListSnapshotsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListSnapshotsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -205,6 +319,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setRequestMarshaller( ProtoUtils.marshaller(DeleteSnapshotRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -214,6 +329,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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 = @@ -222,6 +338,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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 = @@ -230,6 +347,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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 = @@ -238,6 +356,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup") .setRequestMarshaller(ProtoUtils.marshaller(DeleteBackupRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -248,6 +367,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setRequestMarshaller(ProtoUtils.marshaller(ListBackupsRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(ListBackupsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -257,14 +377,25 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .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 = @@ -273,6 +404,7 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setFullMethodName("google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy") .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -284,6 +416,63 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { 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; @@ -295,7 +484,27 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { 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 @@ -322,10 +531,27 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { 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; @@ -375,13 +601,10 @@ protected GrpcBigtableTableAdminStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(createTableMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateTableRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings @@ -389,78 +612,133 @@ public Map extract(CreateTableRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(createTableFromSnapshotMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateTableFromSnapshotRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings listTablesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listTablesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListTablesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getTableTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getTableMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetTableRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .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( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteTableRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings undeleteTableTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeleteTableMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createAuthorizedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAuthorizedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listAuthorizedViewsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAuthorizedViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getAuthorizedViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getAuthorizedViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .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(); }) .build(); GrpcCallSettings modifyColumnFamiliesTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyColumnFamiliesMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ModifyColumnFamiliesRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings dropRowRangeTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(dropRowRangeMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DropRowRangeRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -469,13 +747,10 @@ public Map extract(DropRowRangeRequest request) { .newBuilder() .setMethodDescriptor(generateConsistencyTokenMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GenerateConsistencyTokenRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -483,169 +758,140 @@ public Map extract(GenerateConsistencyTokenRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(checkConsistencyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CheckConsistencyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings snapshotTableTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(snapshotTableMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(SnapshotTableRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings getSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getSnapshotMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetSnapshotRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listSnapshotsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listSnapshotsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListSnapshotsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings deleteSnapshotTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteSnapshotMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteSnapshotRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings createBackupTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(createBackupMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CreateBackupRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getBackupTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getBackupMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetBackupRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings updateBackupTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(updateBackupMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(UpdateBackupRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("backup.name", String.valueOf(request.getBackup().getName())); - return params.build(); - } + 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( - new RequestParamsExtractor() { - @Override - public Map extract(DeleteBackupRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listBackupsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listBackupsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ListBackupsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings restoreTableTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(restoreTableMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(RestoreTableRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings copyBackupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(copyBackupMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(GetIamPolicyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(SetIamPolicyRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings @@ -653,15 +899,64 @@ public Map extract(SetIamPolicyRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(TestIamPermissionsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); - } + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); + GrpcCallSettings createSchemaBundleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSchemaBundleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .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(); + }) + .build(); + GrpcCallSettings + listSchemaBundlesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSchemaBundlesMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSchemaBundleTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSchemaBundleMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); this.createTableCallable = callableFactory.createUnaryCallable( @@ -686,9 +981,69 @@ public Map extract(TestIamPermissionsRequest request) { 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, @@ -759,6 +1114,15 @@ public Map extract(TestIamPermissionsRequest request) { 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); @@ -770,6 +1134,46 @@ public Map extract(TestIamPermissionsRequest request) { 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()); @@ -811,11 +1215,79 @@ 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; @@ -917,6 +1389,17 @@ public UnaryCallable restoreTableCallable() { return restoreTableOperationCallable; } + @Override + public UnaryCallable copyBackupCallable() { + return copyBackupCallable; + } + + @Override + public OperationCallable + copyBackupOperationCallable() { + return copyBackupOperationCallable; + } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; @@ -933,9 +1416,59 @@ public UnaryCallable setIamPolicyCallable() { 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() { - shutdown(); + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } } @Override diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Status.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Status.java new file mode 100644 index 0000000000..8ee3f54b07 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java new file mode 100644 index 0000000000..8d283af11b --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java index 04e1b15987..85529de8d9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java @@ -23,27 +23,44 @@ 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; @@ -189,7 +206,9 @@ public static BigtableDataClient create(BigtableDataSettings settings) throws IO * } * * @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)); } @@ -216,11 +235,71 @@ public boolean exists(String tableId, String rowKey) { * } * * @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. * @@ -245,7 +324,10 @@ public boolean exists(String tableId, ByteString rowKey) { * }, 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)); } @@ -274,10 +356,77 @@ public ApiFuture existsAsync(String tableId, String rowKey) { * }, 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(tableId) + Query.create(targetId) .rowKey(rowKey) .filter( FILTERS @@ -321,7 +470,9 @@ public Boolean apply(Row row) { * } * * @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)); } @@ -351,7 +502,9 @@ public Row readRow(String tableId, ByteString rowKey) { * } * * @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)); @@ -387,7 +540,9 @@ public Row readRow(String tableId, String rowKey) { * } * * @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)); @@ -423,11 +578,154 @@ public Row readRow(String tableId, String rowKey, @Nullable Filter filter) { * } * * @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. @@ -456,7 +754,10 @@ public Row readRow(String tableId, ByteString rowKey, @Nullable Filter filter) { * }, 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); } @@ -489,7 +790,10 @@ public ApiFuture readRowAsync(String tableId, String rowKey) { * }, MoreExecutors.directExecutor()); * } * } + * + * @deprecated Please use {@link BigtableDataClient#readRowAsync(TargetId, ByteString)} instead. */ + @Deprecated public ApiFuture readRowAsync(String tableId, ByteString rowKey) { return readRowAsync(tableId, rowKey, null); } @@ -527,7 +831,11 @@ public ApiFuture readRowAsync(String tableId, ByteString rowKey) { * }, 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); } @@ -565,17 +873,18 @@ public ApiFuture readRowAsync(String tableId, String rowKey, @Nullable Filt * }, MoreExecutors.directExecutor()); * } * } + * + * @deprecated Please use {@link BigtableDataClient#readRowAsync(TargetId, ByteString, Filter)} + * instead. */ + @Deprecated public ApiFuture readRowAsync(String tableId, ByteString rowKey, @Nullable Filter filter) { - Query query = Query.create(tableId).rowKey(rowKey); - if (filter != null) { - query = query.filter(filter); - } - return readRowCallable().futureCall(query); + return readRowAsync(TableId.of(tableId), rowKey, filter); } /** - * Reads a single row. The returned callable object allows for customization of api invocation. + * 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: * @@ -583,24 +892,9 @@ public ApiFuture readRowAsync(String tableId, ByteString rowKey, @Nullable * 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); + * ApiFuture futureResult = bigtableDataClient.readRowAsync(TableId.of(tableId), "key"); * - * ApiFutures.addCallback(rowFuture, new ApiFutureCallback() { + * ApiFutures.addCallback(futureResult, new ApiFutureCallback() { * public void onFailure(Throwable t) { * if (t instanceof NotFoundException) { * System.out.println("Tried to read a non-existent table"); @@ -608,26 +902,25 @@ public ApiFuture readRowAsync(String tableId, ByteString rowKey, @Nullable * t.printStackTrace(); * } * } - * public void onSuccess(Row row) { - * if (row == null) { - * System.out.println("Row not found"); + * public void onSuccess(Row result) { + * if (result != null) { + * System.out.println("Got row: " + result); * } * } * }, 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. + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId */ - public UnaryCallable readRowCallable() { - return stub.readRowCallable(); + public ApiFuture readRowAsync(TargetId targetId, String rowKey) { + return readRowAsync(targetId, ByteString.copyFromUtf8(rowKey), null); } /** - * Reads a single row. This callable allows for customization of the logical representation of a - * row. It's meant for advanced use cases. + * 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: * @@ -635,15 +928,189 @@ public UnaryCallable readRowCallable() { * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) { * String tableId = "[TABLE]"; * - * Query query = Query.create(tableId) - * .rowKey("[KEY]") - * .filter(FILTERS.qualifier().regex("[COLUMN PREFIX].*")); + * ApiFuture futureResult = bigtableDataClient.readRowAsync(TableId.of(tableId), ByteString.copyFromUtf8("key")); * - * // Synchronous invocation - * CustomRow row = bigtableDataClient.readRowCallable(new CustomRowAdapter()).call(query)); - * // Do something with row - * } - * } + * 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. @@ -805,6 +1272,53 @@ 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. @@ -840,6 +1354,46 @@ public ServerStreamingCallable readRowsCallable(RowAdapterStreams 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 @@ -861,11 +1415,41 @@ public ServerStreamingCallable readRowsCallable(RowAdapter * * @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 @@ -891,15 +1475,54 @@ public List sampleRowKeys(String tableId) { * }, MoreExecutors.directExecutor()); * } * } + * + * @deprecated Please use {@link BigtableDataClient#sampleRowKeysAsync(TargetId)} instead. */ + @Deprecated public ApiFuture> sampleRowKeysAsync(String tableId) { - return sampleRowKeysCallable().futureCall(tableId); + return sampleRowKeysAsync(TableId.of(tableId)); } /** - * 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 + * 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: @@ -932,11 +1555,62 @@ public ApiFuture> sampleRowKeysAsync(String tableId) { * }, 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}. @@ -1070,10 +1744,120 @@ public void bulkMutateRows(BulkMutation mutation) { * // Before `batcher` is closed, all remaining(If any) mutations are applied. * } * } + * + * @deprecated Please use {@link BigtableDataClient#newBulkMutationBatcher(TargetId)} instead. */ - @BetaApi("This surface is likely to change as the batching surface evolves.") + @Deprecated public Batcher newBulkMutationBatcher(@Nonnull String tableId) { - return stub.newMutateRowsBatcher(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); } /** @@ -1110,15 +1894,223 @@ public Batcher newBulkMutationBatcher(@Nonnull String ta * 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. + * 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 @@ -1137,7 +2129,8 @@ public Batcher newBulkReadRowsBatcher(String tableId) { * * List> rows = new ArrayList<>(); * - * try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher("[TABLE]", filter)) { + * 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]")); @@ -1156,14 +2149,17 @@ public Batcher newBulkReadRowsBatcher(String tableId) { * List actualRows = ApiFutures.allAsList(rows).get(); * } * } + * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId */ public Batcher newBulkReadRowsBatcher( - String tableId, @Nullable Filters.Filter filter) { - Query query = Query.create(tableId); + TargetId targetId, @Nullable Filter filter, @Nullable GrpcCallContext ctx) { + Query query = Query.create(targetId); if (filter != null) { query = query.filter(filter); } - return stub.newBulkReadRowsBatcher(query); + return stub.newBulkReadRowsBatcher(query, ctx); } /** @@ -1405,6 +2401,359 @@ 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() { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java index d4561ab4df..f19726e2a3 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactory.java @@ -16,14 +16,10 @@ package com.google.cloud.bigtable.data.v2; import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.api.gax.core.FixedExecutorProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.FixedHeaderProvider; -import com.google.api.gax.rpc.FixedTransportChannelProvider; -import com.google.api.gax.rpc.FixedWatchdogProvider; -import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +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; @@ -67,8 +63,8 @@ */ @BetaApi("This feature is currently experimental and can change in the future") public final class BigtableDataClientFactory implements AutoCloseable { - private final BigtableDataSettings defaultSettings; - private final ClientContext sharedClientContext; + private final BigtableClientContext sharedClientContext; + private final ClientOperationSettings perOpSettings; /** * Create a instance of this factory. @@ -78,14 +74,16 @@ public final class BigtableDataClientFactory implements AutoCloseable { */ public static BigtableDataClientFactory create(BigtableDataSettings defaultSettings) throws IOException { - ClientContext sharedClientContext = ClientContext.create(defaultSettings.getStubSettings()); - return new BigtableDataClientFactory(sharedClientContext, defaultSettings); + BigtableClientContext sharedClientContext = + BigtableClientContext.create(defaultSettings.getStubSettings()); + ClientOperationSettings perOpSettings = defaultSettings.getStubSettings().getPerOpSettings(); + return new BigtableDataClientFactory(sharedClientContext, perOpSettings); } private BigtableDataClientFactory( - ClientContext sharedClientContext, BigtableDataSettings defaultSettings) { + BigtableClientContext sharedClientContext, ClientOperationSettings perOpSettings) { this.sharedClientContext = sharedClientContext; - this.defaultSettings = defaultSettings; + this.perOpSettings = perOpSettings; } /** @@ -95,9 +93,7 @@ private BigtableDataClientFactory( */ @Override public void close() throws Exception { - for (BackgroundResource resource : sharedClientContext.getBackgroundResources()) { - resource.close(); - } + sharedClientContext.close(); } /** @@ -110,12 +106,13 @@ public void close() throws Exception { * release all resources, first close all of the created clients and then this factory instance. */ public BigtableDataClient createDefault() { - BigtableDataSettings.Builder settingsBuilder = defaultSettings.toBuilder(); - patchStubSettings(settingsBuilder.stubSettings()); - BigtableDataSettings settings = settingsBuilder.build(); - try { - return BigtableDataClient.create(settings); + 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( @@ -133,12 +130,11 @@ public BigtableDataClient createDefault() { * release all resources, first close all of the created clients and then this factory instance. */ public BigtableDataClient createForAppProfile(@Nonnull String appProfileId) throws IOException { - BigtableDataSettings.Builder settingsBuilder = - defaultSettings.toBuilder().setAppProfileId(appProfileId); - - patchStubSettings(settingsBuilder.stubSettings()); + BigtableClientContext ctx = + sharedClientContext.createChild( + sharedClientContext.getClientInfo().getInstanceName(), appProfileId); - return BigtableDataClient.create(settingsBuilder.build()); + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); } /** @@ -152,16 +148,10 @@ public BigtableDataClient createForAppProfile(@Nonnull String appProfileId) thro */ public BigtableDataClient createForInstance(@Nonnull String projectId, @Nonnull String instanceId) throws IOException { - BigtableDataSettings.Builder settingsBuilder = - defaultSettings - .toBuilder() - .setProjectId(projectId) - .setInstanceId(instanceId) - .setDefaultAppProfileId(); + BigtableClientContext ctx = + sharedClientContext.createChild(InstanceName.of(projectId, instanceId), ""); - patchStubSettings(settingsBuilder.stubSettings()); - - return BigtableDataClient.create(settingsBuilder.build()); + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); } /** @@ -176,32 +166,9 @@ public BigtableDataClient createForInstance(@Nonnull String projectId, @Nonnull public BigtableDataClient createForInstance( @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String appProfileId) throws IOException { - BigtableDataSettings.Builder settingsBuilder = - defaultSettings - .toBuilder() - .setProjectId(projectId) - .setInstanceId(instanceId) - .setAppProfileId(appProfileId); - - patchStubSettings(settingsBuilder.stubSettings()); - - return BigtableDataClient.create(settingsBuilder.build()); - } + BigtableClientContext ctx = + sharedClientContext.createChild(InstanceName.of(projectId, instanceId), appProfileId); - // Update stub settings to use shared resources in this factory - private void patchStubSettings(EnhancedBigtableStubSettings.Builder stubSettings) { - stubSettings - // Channel refreshing will be configured in the shared ClientContext. Derivative clients - // won't be able to reconfigure the refreshing logic - .setRefreshingChannel(false) - .setTransportChannelProvider( - FixedTransportChannelProvider.create(sharedClientContext.getTransportChannel())) - .setCredentialsProvider( - FixedCredentialsProvider.create(sharedClientContext.getCredentials())) - .setExecutorProvider(FixedExecutorProvider.create(sharedClientContext.getExecutor())) - .setStreamWatchdogProvider( - FixedWatchdogProvider.create(sharedClientContext.getStreamWatchdog())) - .setHeaderProvider(FixedHeaderProvider.create(sharedClientContext.getHeaders())) - .setClock(sharedClientContext.getClock()); + return new BigtableDataClient(new EnhancedBigtableStub(perOpSettings, ctx)); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java index 3002aa6113..535c9d9993 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java @@ -15,22 +15,30 @@ */ package com.google.cloud.bigtable.data.v2; -import com.google.api.core.ApiFunction; 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 org.threeten.bp.Duration; +import javax.annotation.Nullable; /** * Settings class to configure an instance of {@link BigtableDataClient}. @@ -66,6 +74,10 @@ 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; @@ -107,67 +119,68 @@ public static Builder newBuilderForEmulator(int port) { * 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() - .setMaxInboundMessageSize(256 * 1024 * 1024) - .setPoolSize(1) - .setChannelConfigurator( - new ApiFunction() { - @Override - public ManagedChannelBuilder apply(ManagedChannelBuilder input) { - return input.usePlaintext(); - } - }) - .setKeepAliveTime(Duration.ofSeconds(30)) // sends ping in this interval - .setKeepAliveTimeout( - Duration.ofSeconds(10)) // wait this long before considering the connection dead - .build()); + 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() + .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; } /** - * Enables OpenCensus metric aggregations. + * @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
+   * 
    *
-   * 

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();
+   * 
+   *   io.opencensus
+   *   opencensus-exporter-stats-stackdriver
+   *   ${opencensus.version}
+   * 
+   * }
+ * Java: + *
{@code
+   * StackdriverStatsExporter.createAndRegister();
+   * BigtableDataSettings.enableOpenCensusStats();
    * }
*/ - @BetaApi("OpenCensus stats integration is currently unstable and may change in the future") + @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 @@ -176,19 +189,48 @@ public static void enableOpenCensusStats() { } /** - * 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 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. */ - @BetaApi("OpenCensus stats integration is currently unstable and may change in the future") + @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(); @@ -204,21 +246,63 @@ public String getAppProfileId() { return stubSettings.getAppProfileId(); } - /** Gets if channels will gracefully refresh connections to Cloud Bigtable service */ - @BetaApi("Channel priming is not currently stable and may change in the future") + /** + * 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(); } /** - * Gets the table ids that will be used to send warmup requests when {@link - * #isRefreshingChannel()} is enabled. + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. */ - @BetaApi("Channel priming is not currently stable and may change in the future") + @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; @@ -242,6 +326,7 @@ public Builder toBuilder() { /** Builder for BigtableDataSettings. */ public static class Builder { private final EnhancedBigtableStubSettings.Builder stubSettings; + /** * Initializes a new Builder with sane defaults for all settings. * @@ -336,45 +421,170 @@ public CredentialsProvider getCredentialsProvider() { /** * Configure periodic gRPC channel refreshes. * - *

This feature will gracefully refresh connections to the Cloud Bigtable service. This is an - * experimental 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 + *

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. */ - @BetaApi("Channel priming is not currently stable and may change in the future") + @Deprecated public Builder setRefreshingChannel(boolean isRefreshingChannel) { stubSettings.setRefreshingChannel(isRefreshingChannel); return this; } - /** Gets if channels will gracefully refresh connections to Cloud Bigtable service */ - @BetaApi("Channel priming is not currently stable and may change in the future") + /** + * 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(); } /** - * Configure the tables that can be used to prime a channel during a refresh. - * - *

These tables work in conjunction with {@link #setRefreshingChannel(boolean)}. When a - * channel is refreshed, it will send a request to each table to warm up the serverside caches - * before admitting the new channel into the channel pool. + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. */ - @BetaApi("Channel priming is not currently stable and may change in the future") + @Deprecated public Builder setPrimingTableIds(String... tableIds) { - stubSettings.setPrimedTableIds(tableIds); return this; } /** - * Gets the table ids that will be used to send warmup requests when {@link - * #setRefreshingChannel(boolean)} is enabled. + * @deprecated This field is ignored. If {@link #isRefreshingChannel()} is enabled, warm up + * requests will be sent to all table ids of the instance. */ - @BetaApi("Channel priming is not currently stable and may change in the future") + @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. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json index 0891b90455..5bc262fb5c 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json @@ -13,12 +13,27 @@ "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"] }, diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReader.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReader.java new file mode 100644 index 0000000000..166da1b553 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnMetadataImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnMetadataImpl.java new file mode 100644 index 0000000000..966cca5e60 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnToIndexMapper.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ColumnToIndexMapper.java new file mode 100644 index 0000000000..aec1c5897c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/JwtCredentialsWithAudience.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/JwtCredentialsWithAudience.java new file mode 100644 index 0000000000..4456e278e2 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java index 4744d3ef1e..b53f235d7b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java @@ -16,6 +16,10 @@ 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; @@ -30,6 +34,10 @@ 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; @@ -40,6 +48,42 @@ public static String formatTableName( 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()) { @@ -47,4 +91,99 @@ public static String extractTableIdFromTableName(@Nonnull String 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequest.java new file mode 100644 index 0000000000..0a330d32c6 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareResponse.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PrepareResponse.java new file mode 100644 index 0000000000..35247e2dc9 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImpl.java new file mode 100644 index 0000000000..ea0de5bf8f --- /dev/null +++ b/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. + */ + 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 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadata.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadata.java new file mode 100644 index 0000000000..45542d96e6 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoSqlRow.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoSqlRow.java new file mode 100644 index 0000000000..3a63fe089a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoStruct.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoStruct.java new file mode 100644 index 0000000000..f9da3ef9fb --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtil.java new file mode 100644 index 0000000000..439f8f7205 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java index c348ec7408..00cebcf462 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RegexUtil.java @@ -33,13 +33,14 @@ */ @InternalApi public final class RegexUtil { - private static final byte[] NULL_BYTES = "\\x00".getBytes(); + 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); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java index fc015186aa..7058ae137c 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RequestContext.java @@ -17,6 +17,7 @@ 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; /** @@ -33,6 +34,13 @@ @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); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java new file mode 100644 index 0000000000..77bc0ebd6b --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtil.java new file mode 100644 index 0000000000..184dfff623 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java index 430db81a7f..2c4ce914bb 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtil.java @@ -25,13 +25,13 @@ 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.common.collect.ImmutableSortedSet; -import com.google.common.collect.Lists; import com.google.protobuf.ByteString; -import java.util.Arrays; +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; @@ -49,174 +49,249 @@ 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(); + } + /** - * Splits the provided {@link RowSet} along the provided splitPoint into 2 segments. The right - * segment will contain all keys that are strictly greater than the splitPoint and all {@link - * RowRange}s truncated to start right after the splitPoint. + * 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. */ - @Nonnull - public static Split split(@Nonnull RowSet rowSet, @Nonnull ByteString splitPoint) { - ImmutableSortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE).add(splitPoint).build(); + public static RowSet erase(RowSet rowSet, ByteString splitPoint, boolean fromStart) { + RowSet.Builder newRowSet = RowSet.newBuilder(); - List splits = split(rowSet, splitPoints, true); + if (rowSet.getRowKeysList().isEmpty() && rowSet.getRowRangesList().isEmpty()) { + rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); + } - return Split.of(splits.get(0), splits.get(1)); + // 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}. Each split point represents the last row of the corresponding segment. The row - * keys contained in the provided {@link RowSet} will be distributed across the segments. Each - * range in the {@link RowSet} will be split up across each segment. - * - * @see #split(RowSet, SortedSet, boolean) for more details. + * 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) { - return split(rowSet, splitPoints, false); - } - /** - * Split a {@link RowSet} into segments. - * - *

Each segment is defined by a split point. The split point identifies the segment's inclusive - * end. This means that the first segment will start at the beginning of the table and extend to - * include the first split point. The last segment will start just after the last split point and - * extend until the end of the table. The maximum number of segments that can be returned is the - * number of split points + 1. - * - *

Each segment is represented by a RowSet in the returned List. Each of the returned RowSets - * will contain all of the {@link RowRange}s and keys that fall between the previous segment and - * this segment's split point. If there are no {@link RowRange}s or keys that belong to a segment, - * then that segment will either be omitted or if {@code preserveNullSegments} is true, then it - * will be represented by a null value in the returned list. - * - *

The segments in the returned list are guaranteed to be sorted. If {@code - * preserveNullSegments} is true, then it will have exactly {@code splitPoints.size() + 1} items. - * The extra segment will contain keys and {@link RowRange}s between the last splitPoint and the - * end of the table. - * - *

Please note that an empty {@link RowSet} is treated like a full table scan and each segment - * will contain a {@link RowRange} that covers the full extent of the segment. - */ - @Nonnull - static List split( - @Nonnull RowSet rowSet, - @Nonnull SortedSet splitPoints, - boolean preserveNullSegments) { // An empty RowSet represents a full table scan. Make that explicit so that there is RowRange to // split. - if (RowSet.getDefaultInstance().equals(rowSet)) { + if (rowSet.getRowKeysList().isEmpty() && rowSet.getRowRangesList().isEmpty()) { rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); } - // Create sorted copies of the ranges and keys in the RowSet - ByteString[] rowKeys = - rowSet.getRowKeysList().toArray(new ByteString[rowSet.getRowKeysCount()]); - RowRange[] rowRanges = - rowSet.getRowRangesList().toArray(new RowRange[rowSet.getRowRangesCount()]); + 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)); - Arrays.sort(rowKeys, ByteStringComparator.INSTANCE); - Arrays.sort(rowRanges, RANGE_START_COMPARATOR); + List segments = new ArrayList<>(); - List results = Lists.newArrayList(); + boolean currentSegmentIsEmpty; + RowSet.Builder segment; - // Track consumption of input ranges & keys. - int rowKeysStart = 0; - int rowRangesStart = 0; + for (ByteString splitPoint : splitPoints) { + Preconditions.checkArgument(!splitPoint.isEmpty(), "Can't handle empty splitPoints"); - // Keys and ranges that lie before the current split point, - RowSet.Builder segment = RowSet.newBuilder(); - boolean isSegmentEmpty = true; + segment = RowSet.newBuilder(); + currentSegmentIsEmpty = true; - for (ByteString splitPoint : splitPoints) { - Preconditions.checkState(!splitPoint.isEmpty(), "Split point can't be empty"); - - // Consume all of the row keys that lie on and to the left of the split point. Consumption is - // designated by advancing rowKeysStart. - for (int i = rowKeysStart; i < rowKeys.length; i++) { - ByteString rowKey = rowKeys[i]; - if (ByteStringComparator.INSTANCE.compare(rowKey, splitPoint) <= 0) { - segment.addRowKeys(rowKey); - isSegmentEmpty = false; - rowKeysStart++; + // 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 all following keys belong to a later segment. + // This key and the following will be in a later segment break; } } - // Consume all of the ranges that lie before the split point (splitting the range if - // necessary). Consumption is designated by advancing rowRangesStart. - for (int i = rowRangesStart; i < rowRanges.length; i++) { - RowRange rowRange = rowRanges[i]; - + // Handle ranges + while (!ranges.isEmpty()) { // Break early when encountering the first start point that is past the split point. - // (The split point is the inclusive end of of the segment) - int startCmp = StartPoint.extract(rowRange).compareTo(new StartPoint(splitPoint, true)); - if (startCmp > 0) { + // 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; } - - // Some part of this range will be in the segment. - isSegmentEmpty = false; - - // Figure out the endpoint and remainder. - int endCmp = EndPoint.extract(rowRange).compareTo(new EndPoint(splitPoint, true)); - if (endCmp <= 0) { - // The range is fully contained in the segment. - segment.addRowRanges(rowRange); - - // Consume the range, but take care to shift partially consumed ranges to fill the gap - // created by consuming the current range. For example if the list contained the following - // ranges: [a-z], [b-d], [f-z] and the split point was 'e'. Then after processing the - // split point, the list would contain: (d-z], GAP, [f-z]. So we fill the gap by shifting - // (d-z] over by one and advancing rowRangesStart. - // Partially consumed ranges will only exist if the original RowSet had overlapping - // ranges, this should be a rare occurrence. - System.arraycopy( - rowRanges, rowRangesStart, rowRanges, rowRangesStart + 1, i - rowRangesStart); - rowRangesStart++; + 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 { - // The range is split: - // Add the left part to the segment - RowRange leftSubRange = rowRange.toBuilder().setEndKeyClosed(splitPoint).build(); - segment.addRowRanges(leftSubRange); - // Save the remainder for the next segment. This is done by replacing the current rowRange - // with the remainder and not advancing rowRangesStart. - RowRange rightSubRange = rowRange.toBuilder().setStartKeyOpen(splitPoint).build(); - rowRanges[i] = rightSubRange; + segment.addRowRanges(range.toBuilder().setEndKeyOpen(splitPoint)); + currentSegmentIsEmpty = false; + ranges.addFirst(range.toBuilder().setStartKeyClosed(splitPoint).build()); } } - // Build the current segment - if (!isSegmentEmpty) { - results.add(segment.build()); - isSegmentEmpty = true; - segment = RowSet.newBuilder(); - } else if (preserveNullSegments) { - results.add(null); + if (!currentSegmentIsEmpty) { + segments.add(segment.build()); } } - // Create the last segment (from the last splitKey to the end of the table) - for (int i = rowKeysStart; i < rowKeys.length; i++) { - isSegmentEmpty = false; - segment.addRowKeys(rowKeys[i]); - } - for (int i = rowRangesStart; i < rowRanges.length; i++) { - isSegmentEmpty = false; - segment.addRowRanges(rowRanges[i]); - } - if (!isSegmentEmpty) { - results.add(segment.build()); - } else if (preserveNullSegments) { - results.add(null); + if (!keys.isEmpty() || !ranges.isEmpty()) { + segment = RowSet.newBuilder().addAllRowKeys(keys).addAllRowRanges(ranges); + segments.add(segment.build()); } - return results; + return segments; } /** Get the bounding range of a {@link RowSet}. */ @@ -297,14 +372,6 @@ public static Split of(RowSet left, RowSet right) { } } - private static final Comparator RANGE_START_COMPARATOR = - new Comparator() { - @Override - public int compare(@Nonnull RowRange o1, @Nonnull RowRange o2) { - return StartPoint.extract(o1).compareTo(StartPoint.extract(o2)); - } - }; - /** Helper class to ease comparison of RowRange start points. */ private static final class StartPoint implements Comparable { private final ByteString value; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRow.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRow.java new file mode 100644 index 0000000000..6ddde59155 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil.java new file mode 100644 index 0000000000..90631f3bbd --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TableAdminRequestContext.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TableAdminRequestContext.java new file mode 100644 index 0000000000..05554425b4 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtil.java new file mode 100644 index 0000000000..d659e03c2c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java new file mode 100644 index 0000000000..01dfed2d72 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceName.java @@ -0,0 +1,70 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java new file mode 100644 index 0000000000..159c7b0b50 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/api/TableName.java @@ -0,0 +1,86 @@ +/* + * 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.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 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java new file mode 100644 index 0000000000..9c0a70d30c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistry.java @@ -0,0 +1,218 @@ +/* + * 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.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.ClientChannelPoolOutstandingRpcs; +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.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.TableDebugTagCount; +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 TableDebugTagCount debugTagCountMetric; + final PacemakerDelay pacemakerDelayMetric; + + 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()); + + debugTagCountMetric = register(new TableDebugTagCount()); + pacemakerDelayMetric = register(new PacemakerDelay()); + + // 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 newRecorderRegistry(MeterProvider meterProvider) { + return new RecorderRegistry(meterProvider.get(METER_NAME)); + } + + 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 TableDebugTagCount.Recorder debugTagCount; + + public final PacemakerDelay.Recorder pacemakerDelay; + + private RecorderRegistry(Meter meter) { + operationLatency = operationLatencyMetric.newRecorder(meter); + attemptLatency = attemptLatencyMetric.newRecorder(meter); + attemptLatency2 = attemptLatency2Metric.newRecorder(meter); + retryCount = retryCountMetric.newRecorder(meter); + firstResponseLantency = firstResponseLantencyMetric.newRecorder(meter); + serverLatency = serverLatencyMetric.newRecorder(meter); + channelPoolOutstandingRpcs = channelPoolOutstandingRpcsMetric.newRecorder(meter); + connectivityErrorCount = connectivityErrorCountMetric.newRecorder(meter); + dpCompatGuage = dpCompatGuageMetric.newRecorder(meter); + applicationBlockingLatency = applicationBlockingLatencyMetric.newRecorder(meter); + clientBlockingLatency = clientBlockingLatencyMetric.newRecorder(meter); + perConnectionErrorCount = perConnectionErrorCountMetric.newRecorder(meter); + remainingDeadline = remainingDeadlineMetric.newRecorder(meter); + batchWriteFlowControlTargetQps = batchWriteFlowControlTargetQpsMetric.newRecorder(meter); + batchWriteFlowControlFactor = batchWriteFlowControlFactorMetric.newRecorder(meter); + + debugTagCount = debugTagCountMetric.newRecorder(meter); + pacemakerDelay = pacemakerDelayMetric.newRecorder(meter); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java new file mode 100644 index 0000000000..6e30d3dd2b --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/Metrics.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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.DirectPathCompatibleTracer; +import io.grpc.ManagedChannelBuilder; +import java.io.Closeable; +import java.io.IOException; +import javax.annotation.Nullable; + +public interface Metrics extends Closeable { + ApiTracerFactory createTracerFactory(ClientInfo clientInfo) throws IOException; + + > T configureGrpcChannel(T channelBuilder); + + @Nullable + ChannelPoolMetricsTracer getChannelPoolMetricsTracer(); + + DirectPathCompatibleTracer getDirectPathCompatibleTracer(); + + void start(); + + @Override + void close(); +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.java new file mode 100644 index 0000000000..c7a68f8eea --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricsImpl.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. + */ +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.OpencensusTracerFactory; +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.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.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.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.stub.metrics.NoopMetricsProvider; +import com.google.common.base.Preconditions; +import com.google.common.base.Suppliers; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +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 java.io.Closeable; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import javax.annotation.Nullable; + +public class MetricsImpl implements Metrics, Closeable { + private final MetricRegistry metricRegistry; + + private final ApiTracerFactory userTracerFactory; + private final @Nullable OpenTelemetrySdk internalOtel; + private final @Nullable MetricRegistry.RecorderRegistry internalRecorder; + private final @Nullable OpenTelemetry userOtel; + 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; + @Nullable private final Pacemaker pacemaker; + 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.metricRegistry = metricRegistry; + this.userTracerFactory = Preconditions.checkNotNull(userTracerFactory); + + this.internalOtel = internalOtel; + this.userOtel = userOtel; + + this.ocTagger = ocTagger; + this.ocRecorder = ocRecorder; + + this.executor = executor; + + if (internalOtel != null) { + this.internalRecorder = metricRegistry.newRecorderRegistry(internalOtel.getMeterProvider()); + this.pacemaker = new Pacemaker(internalRecorder, clientInfo, "background"); + this.channelPoolMetricsTracer = new ChannelPoolMetricsTracer(internalRecorder, clientInfo); + this.directPathCompatibleTracer = + new DirectPathCompatibleTracerImpl(clientInfo, internalRecorder); + 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; + } + + if (userOtel != null) { + this.userRecorder = metricRegistry.newRecorderRegistry(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)); + } + } + + @Override + public > T configureGrpcChannel(T channelBuilder) { + if (grpcOtel == null) { + return channelBuilder; + } + grpcOtel.configureChannelBuilder(channelBuilder); + return channelBuilder; + } + + @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; + } + + 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(exporter, executor)); + + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java new file mode 100644 index 0000000000..7122cb40c7 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfo.java @@ -0,0 +1,53 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.java new file mode 100644 index 0000000000..b7afb73ee9 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfo.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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.java new file mode 100644 index 0000000000..4312392afa --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/MethodInfo.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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java new file mode 100644 index 0000000000..91cfab1301 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/Util.java @@ -0,0 +1,197 @@ +/* + * 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.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.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.ResponseParams; +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 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 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 ResponseParams clusterInfo) { + return Optional.ofNullable(clusterInfo) + .map(ResponseParams::getClusterId) + .filter(s -> !s.isEmpty()) + .orElse(""); + } + + public static String formatZoneIdMetricLabel(@Nullable ResponseParams clusterInfo) { + return Optional.ofNullable(clusterInfo) + .map(ResponseParams::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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java new file mode 100644 index 0000000000..1ccd3f00e9 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter.java @@ -0,0 +1,276 @@ +/* + * 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 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 CompletableResultCode lastExportCode; + 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"); + + lastExportCode = doExport(metricData); + return lastExportCode; + } + + 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 != null) { + return lastExportCode; + } + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtablePeriodicReader.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtablePeriodicReader.java new file mode 100644 index 0000000000..e536f2ca7b --- /dev/null +++ b/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 BigtableCloudMonitoringExporter exporter; + + public BigtablePeriodicReader( + BigtableCloudMonitoringExporter 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java new file mode 100644 index 0000000000..601e19dc66 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/Converter.java @@ -0,0 +1,220 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlFactor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlFactor.java new file mode 100644 index 0000000000..c4c6d97118 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlTargetQps.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientBatchWriteFlowControlTargetQps.java new file mode 100644 index 0000000000..a15189aa4a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolOutstandingRpcs.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientChannelPoolOutstandingRpcs.java new file mode 100644 index 0000000000..c5c1589c4f --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDpCompatGuage.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientDpCompatGuage.java new file mode 100644 index 0000000000..26bc493ed1 --- /dev/null +++ b/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( + 1, + getSchema() + .createResourceAttrs(clientInfo) + .put(MetricLabels.DP_REASON_KEY, reason.getValue()) + .put(MetricLabels.DP_IP_PREFERENCE_KEY, "") + .build()); + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java new file mode 100644 index 0000000000..ff7dd36cbe --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/ClientPerConnectionErrorCount.java @@ -0,0 +1,114 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java new file mode 100644 index 0000000000..3478fd2e42 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/Constants.java @@ -0,0 +1,122 @@ +/* + * 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.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"); + + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java new file mode 100644 index 0000000000..e4ddc12165 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/GrpcMetric.java @@ -0,0 +1,65 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java new file mode 100644 index 0000000000..a6c882d820 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/MetricWrapper.java @@ -0,0 +1,103 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/PacemakerDelay.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/PacemakerDelay.java new file mode 100644 index 0000000000..ec081f2afd --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java new file mode 100644 index 0000000000..9fd5561d0f --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableApplicationBlockingLatency.java @@ -0,0 +1,86 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java new file mode 100644 index 0000000000..e792cb8eb8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency.java @@ -0,0 +1,89 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java new file mode 100644 index 0000000000..ca895e0e1b --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableAttemptLatency2.java @@ -0,0 +1,96 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.PeerInfo; +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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, "") + // 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java new file mode 100644 index 0000000000..7fc46c5559 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableClientBlockingLatency.java @@ -0,0 +1,87 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.java new file mode 100644 index 0000000000..3f99f90248 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableConnectivityErrorCount.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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableDebugTagCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableDebugTagCount.java new file mode 100644 index 0000000000..5d9dbc8536 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableDebugTagCount.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.internal.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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.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.LongCounter; +import io.opentelemetry.api.metrics.Meter; +import javax.annotation.Nullable; + +public class TableDebugTagCount extends MetricWrapper { + private static final String NAME = "bigtable.googleapis.com/internal/client/debug_tags"; + + public TableDebugTagCount() { + 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("A counter of internal client events used for debugging.") + .setUnit(Units.COUNT) + .build(); + } + + public void record( + ClientInfo clientInfo, + String tableId, + String tag, + @Nullable ResponseParams clusterInfo, + long amount) { + Attributes attributes = + getSchema() + .createResourceAttrs(clientInfo, tableId, clusterInfo) + // 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java new file mode 100644 index 0000000000..6ad09e7798 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableFirstResponseLatency.java @@ -0,0 +1,92 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java new file mode 100644 index 0000000000..781501100f --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableOperationLatency.java @@ -0,0 +1,91 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java new file mode 100644 index 0000000000..314f9874c8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRemainingDeadline.java @@ -0,0 +1,91 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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; + +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, + ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java new file mode 100644 index 0000000000..205bf83962 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableRetryCount.java @@ -0,0 +1,84 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java new file mode 100644 index 0000000000..cafc0c245e --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/TableServerLatency.java @@ -0,0 +1,91 @@ +/* + * 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.csm.metrics; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/package-info.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/metrics/package-info.java new file mode 100644 index 0000000000..e6e4fb388c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracer.java similarity index 62% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracer.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracer.java index 864ba75020..b430cb8119 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracer.java @@ -13,11 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; -import com.google.api.gax.tracing.ApiTracer; +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; @@ -31,10 +37,11 @@ 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; -import org.threeten.bp.Duration; -class MetricsTracer implements ApiTracer { +class MetricsTracer extends BigtableTracer { + private final OperationType operationType; private final Tagger tagger; @@ -49,12 +56,16 @@ class MetricsTracer implements ApiTracer { private final AtomicBoolean opFinished = new AtomicBoolean(); private final Stopwatch operationTimer = Stopwatch.createStarted(); private final Stopwatch firstResponsePerOpTimer = Stopwatch.createStarted(); - private long operationResponseCount = 0; // Attempt level metrics private int attemptCount = 0; private Stopwatch attemptTimer; - private long attemptResponseCount = 0; + + private volatile int attempt = 0; + + private volatile boolean reportBatchingLatency = false; + private final AtomicLong batchThrottledLatency = new AtomicLong(0); + private MetadataExtractorInterceptor.SidebandData sidebandData; MetricsTracer( OperationType operationType, @@ -78,6 +89,12 @@ public void close() {} }; } + @Override + public void operationFinishEarly() { + attemptTimer.stop(); + operationTimer.stop(); + } + @Override public void operationSucceeded() { recordOperationCompletion(null); @@ -97,7 +114,6 @@ private void recordOperationCompletion(@Nullable Throwable throwable) { if (!opFinished.compareAndSet(false, true)) { return; } - operationTimer.stop(); long elapsed = operationTimer.elapsed(TimeUnit.MILLISECONDS); @@ -116,21 +132,18 @@ private void recordOperationCompletion(@Nullable Throwable throwable) { TagContextBuilder tagCtx = newTagCtxBuilder() - .putLocal(RpcMeasureConstants.BIGTABLE_STATUS, Util.extractStatus(throwable)); + .putLocal( + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create(Util.extractStatus(throwable).name())); measures.record(tagCtx.build()); } @Override - public void connectionSelected(String s) { - // noop: cardinality for connection ids is too high to use as tags - } - - @Override - public void attemptStarted(int i) { + public void attemptStarted(int attemptNumber) { + attempt = attemptNumber; attemptCount++; attemptTimer = Stopwatch.createStarted(); - attemptResponseCount = 0; } @Override @@ -143,8 +156,18 @@ 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 throwable, Duration duration) { + 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); } @@ -166,46 +189,64 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { 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, Util.extractStatus(throwable)); + .putLocal( + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create(Util.extractStatus(throwable).name())); measures.record(tagCtx.build()); } - @Override - public void lroStartFailed(Throwable throwable) { - // noop - } - - @Override - public void lroStartSucceeded() { - // noop - } - @Override public void responseReceived() { if (firstResponsePerOpTimer.isRunning()) { firstResponsePerOpTimer.stop(); } - attemptResponseCount++; - operationResponseCount++; } @Override - public void requestSent() { - // noop: no operations are client streaming + public int getAttempt() { + return attempt; + } + + @Override + public void setSidebandData(MetadataExtractorInterceptor.SidebandData sidebandData) { + this.sidebandData = sidebandData; } @Override - public void batchRequestSent(long elementCount, long requestSize) { - // noop + public void batchRequestThrottled(long totalThrottledMs) { + reportBatchingLatency = true; + batchThrottledLatency.addAndGet(totalThrottledMs); } private TagContextBuilder newTagCtxBuilder() { TagContextBuilder tagCtx = - tagger - .toBuilder(parentContext) + tagger.toBuilder(parentContext) .putLocal(RpcMeasureConstants.BIGTABLE_OP, TagValue.create(spanName.toString())); // Copy client level tags in diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerFactory.java similarity index 90% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerFactory.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerFactory.java index 24b22d3531..0f557e6536 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerFactory.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +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; @@ -30,7 +31,7 @@ * api. */ @InternalApi("For internal use only") -public class MetricsTracerFactory implements ApiTracerFactory { +public class MetricsTracerFactory extends BaseApiTracerFactory { private final Tagger tagger; private final StatsRecorder stats; private final ImmutableMap statsAttributes; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcMeasureConstants.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcMeasureConstants.java similarity index 87% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcMeasureConstants.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcMeasureConstants.java index e6e5c70db1..39c9bb0e99 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcMeasureConstants.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcMeasureConstants.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; import com.google.api.core.InternalApi; import io.opencensus.stats.Measure.MeasureLong; @@ -79,13 +79,22 @@ public class RpcMeasureConstants { 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", + "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", + "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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViewConstants.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcViewConstants.java similarity index 61% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViewConstants.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcViewConstants.java index 8a14c01b13..1db8b443ec 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViewConstants.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/RpcViewConstants.java @@ -13,21 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_ATTEMPT_LATENCY; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_GFE_LATENCY; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_INSTANCE_ID; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_OP; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_OP_ATTEMPT_COUNT; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_OP_LATENCY; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_PROJECT_ID; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY; -import static com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants.BIGTABLE_STATUS; +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; @@ -36,7 +39,7 @@ import io.opencensus.stats.View; import java.util.Arrays; -class RpcViewConstants { +public class RpcViewConstants { // Aggregations private static final Aggregation COUNT = Count.create(); private static final Aggregation SUM = Sum.create(); @@ -57,14 +60,6 @@ class RpcViewConstants { 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))); - private static final Aggregation AGGREGATION_WITH_POWERS_OF_2 = - Distribution.create( - BucketBoundaries.create( - ImmutableList.of( - 0.0, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0, 512.0, 1024.0, 2048.0, - 4096.0, 8192.0, 16384.0, 32768.0, 65536.0, 131072.0, 262144.0, 524288.0, - 1048576.0, 2097152.0))); - /** * {@link View} for Bigtable client roundtrip latency in milliseconds including all retry * attempts. @@ -132,18 +127,53 @@ class RpcViewConstants { 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", + "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_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", + "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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/ClientSchema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/ClientSchema.java new file mode 100644 index 0000000000..5ef030539d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java new file mode 100644 index 0000000000..0a5b3adeb2 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/GrpcClientSchema.java @@ -0,0 +1,78 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java new file mode 100644 index 0000000000..a5d621acbc --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/Schema.java @@ -0,0 +1,100 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java new file mode 100644 index 0000000000..e333837d7a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/schema/TableSchema.java @@ -0,0 +1,65 @@ +/* + * 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.csm.schema; + +import com.google.bigtable.v2.ResponseParams; +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 ResponseParams 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableGrpcStreamTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableGrpcStreamTracer.java new file mode 100644 index 0000000000..99a184b5e3 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerStreamingCallable.java new file mode 100644 index 0000000000..c45e608c0a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BigtableTracerUnaryCallable.java new file mode 100644 index 0000000000..443ee17345 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java new file mode 100644 index 0000000000..d2fa015cf3 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracer.java @@ -0,0 +1,438 @@ +/* + * 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.ResponseParams; +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.getResponseParams(), + code, + attemptCount - 1); + } + + recorder.operationLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getResponseParams(), + code, + Duration.ofNanos(operationLatencyNano)); + + // serverLatencyTimer should already be stopped in recordAttemptCompletion + long applicationLatencyNano = operationLatencyNano - totalServerLatencyNano.get(); + recorder.applicationBlockingLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getResponseParams(), + Duration.ofNanos(applicationLatencyNano)); + + if (methodInfo.equals(READ_ROWS)) { + recorder.firstResponseLantency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getResponseParams(), + 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.getResponseParams(), + Duration.ofNanos(totalClientBlockingTime.get())); + + recorder.attemptLatency.record( + clientInfo, + tableId, + sidebandData.getResponseParams(), + methodInfo, + code, + attemptTimer.elapsed()); + + recorder.attemptLatency2.record( + clientInfo, + tableId, + sidebandData.getPeerInfo(), + sidebandData.getResponseParams(), + 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.getResponseParams(), + code, + Comparators.max(remainingDeadlineAtAttemptStart, Duration.ZERO)); + } + + if (sidebandData.getGfeTiming() != null) { + recorder.serverLatency.record( + clientInfo, + tableId, + methodInfo, + sidebandData.getResponseParams(), + code, + sidebandData.getGfeTiming()); + } + + boolean seenServer = + Optional.ofNullable(sidebandData.getPeerInfo()) + .map(pe -> pe.getApplicationFrontendId() != 0) + .orElse(false); + + seenServer = + seenServer + || Optional.ofNullable(sidebandData.getResponseParams()) + .map(rp -> !ResponseParams.getDefaultInstance().equals(rp)) + .orElse(false); + + seenServer = seenServer || (sidebandData.getGfeTiming() != null); + + if (seenServer) { + recorder.connectivityErrorCount.record( + clientInfo, tableId, methodInfo, sidebandData.getResponseParams(), code, 0); + } else { + recorder.connectivityErrorCount.record( + clientInfo, tableId, methodInfo, sidebandData.getResponseParams(), 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerFactory.java new file mode 100644 index 0000000000..8a41fd339e --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java new file mode 100644 index 0000000000..ec132e4dad --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracer.java @@ -0,0 +1,102 @@ +/* + * 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.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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracer.java new file mode 100644 index 0000000000..d9362acb48 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerFactory.java similarity index 89% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerFactory.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerFactory.java index e2e399ae3d..8b2606e955 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerFactory.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +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; @@ -25,7 +26,7 @@ /** Combines multiple {@link ApiTracerFactory} into a single {@link ApiTracerFactory}. */ @InternalApi("For internal use only") -public class CompositeTracerFactory implements ApiTracerFactory { +public class CompositeTracerFactory extends BaseApiTracerFactory { private final List apiTracerFactories; public CompositeTracerFactory(List apiTracerFactories) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracer.java new file mode 100644 index 0000000000..701e93ef0d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracerImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/DirectPathCompatibleTracerImpl.java new file mode 100644 index 0000000000..9995d1c90d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/Pacemaker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/Pacemaker.java new file mode 100644 index 0000000000..8a3771406a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/TracedBatcherUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/TracedBatcherUnaryCallable.java new file mode 100644 index 0000000000..9b1b9764ab --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/AlwaysEnabledDirectAccessChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/AlwaysEnabledDirectAccessChecker.java new file mode 100644 index 0000000000..307f55a18d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessChecker.java new file mode 100644 index 0000000000..ea11be7ce9 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessChecker.java new file mode 100644 index 0000000000..e6954d279d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessInvestigator.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/DirectAccessInvestigator.java new file mode 100644 index 0000000000..2a80672d82 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/NoopDirectAccessChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/dp/NoopDirectAccessChecker.java new file mode 100644 index 0000000000..bf79fd5478 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AddToCell.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AddToCell.java new file mode 100644 index 0000000000..75ba6a192d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java new file mode 100644 index 0000000000..a090b2117d --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java index 95d10872ec..fb7b04269f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/BulkMutation.java @@ -15,6 +15,8 @@ */ 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; @@ -36,18 +38,33 @@ */ public final class BulkMutation implements Serializable, Cloneable { private static final long serialVersionUID = 3522061250439399088L; - - private final String tableId; + 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); + 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(@Nonnull String tableId) { - Preconditions.checkNotNull(tableId); + private BulkMutation(TargetId targetId) { + Preconditions.checkNotNull(targetId, "target id can't be null."); - this.tableId = tableId; + this.targetId = targetId; this.builder = MutateRowsRequest.newBuilder(); } @@ -81,6 +98,14 @@ 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) @@ -105,14 +130,15 @@ public int getEntryCount() { @InternalApi public MutateRowsRequest toProto(RequestContext requestContext) { - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); - - return builder - .setTableName(tableName) - .setAppProfileId(requestContext.getAppProfileId()) - .build(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); } /** @@ -128,8 +154,11 @@ public MutateRowsRequest toProto(RequestContext requestContext) { */ @BetaApi public static BulkMutation fromProto(@Nonnull MutateRowsRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + BulkMutation bulkMutation = - BulkMutation.create(NameUtil.extractTableIdFromTableName(request.getTableName())); + BulkMutation.create(NameUtil.extractTargetId(tableName, authorizedViewName)); bulkMutation.builder = request.toBuilder(); return bulkMutation; @@ -138,7 +167,7 @@ public static BulkMutation fromProto(@Nonnull MutateRowsRequest request) { /** Creates a copy of {@link BulkMutation}. */ @Override public BulkMutation clone() { - BulkMutation bulkMutation = BulkMutation.create(tableId); + BulkMutation bulkMutation = BulkMutation.create(targetId); bulkMutation.builder = this.builder.clone(); return bulkMutation; } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationToken.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationToken.java new file mode 100644 index 0000000000..f619d9dae0 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java new file mode 100644 index 0000000000..7ca9deeaee --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecord.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecord.java new file mode 100644 index 0000000000..2f0233e180 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordAdapter.java new file mode 100644 index 0000000000..9b892b14ea --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/CloseStream.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/CloseStream.java new file mode 100644 index 0000000000..344ed06c3c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java index ac4c548942..aa3d17096a 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutation.java @@ -33,25 +33,53 @@ public final class ConditionalRowMutation implements Serializable { private static final long serialVersionUID = -3699904745621909502L; - private final String tableId; + private final TargetId targetId; private transient CheckAndMutateRowRequest.Builder builder = CheckAndMutateRowRequest.newBuilder(); - private ConditionalRowMutation(String tableId, ByteString rowKey) { - this.tableId = tableId; + private ConditionalRowMutation(TargetId targetId, ByteString rowKey) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + + this.targetId = targetId; builder.setRowKey(rowKey); } - /** Creates a new instance of the mutation builder. */ + /** + * @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. */ + /** + * 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, rowKey); + 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 { @@ -80,7 +108,8 @@ 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"); + "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()); @@ -129,13 +158,16 @@ public CheckAndMutateRowRequest toProto(RequestContext requestContext) { Preconditions.checkState( !builder.getTrueMutationsList().isEmpty() || !builder.getFalseMutationsList().isEmpty(), "ConditionalRowMutations must have `then` or `otherwise` mutations."); - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); - return builder - .setTableName(tableName.toString()) - .setAppProfileId(requestContext.getAppProfileId()) - .build(); + + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); } /** @@ -146,9 +178,12 @@ public CheckAndMutateRowRequest toProto(RequestContext requestContext) { */ @BetaApi public static ConditionalRowMutation fromProto(@Nonnull CheckAndMutateRowRequest request) { - String tableId = NameUtil.extractTableIdFromTableName(request.getTableName()); + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + ConditionalRowMutation rowMutation = - ConditionalRowMutation.create(tableId, request.getRowKey()); + ConditionalRowMutation.create( + NameUtil.extractTargetId(tableName, authorizedViewName), request.getRowKey()); rowMutation.builder = request.toBuilder(); return rowMutation; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapter.java new file mode 100644 index 0000000000..ffed83e6f9 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java index 279ebf6407..d722bcbe6e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DefaultRowAdapter.java @@ -75,13 +75,13 @@ public Row createRowFromProto(com.google.bigtable.v2.Row row) { return builder.finishRow(); } - /** {@inheritDoc} */ - public class DefaultRowBuilder implements RowBuilder { + /** 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 int totalCellCount; private String family; private ByteString qualifier; @@ -133,7 +133,6 @@ public void finishCell() { RowCell rowCell = RowCell.create(family, qualifier, timestamp, labels, value); currentFamilyCells.add(rowCell); - totalCellCount++; } /** {@inheritDoc} */ @@ -142,7 +141,7 @@ public Row finishRow() { final ImmutableList sortedCells; // Optimization: If there are no cells, then just return the static empty list. - if (cellsByFamily.size() == 0) { + 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. @@ -169,7 +168,6 @@ public void reset() { cellsByFamily = new TreeMap<>(); currentFamilyCells = null; previousFamily = null; - totalCellCount = 0; family = null; qualifier = null; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteCells.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteCells.java new file mode 100644 index 0000000000..26fcdd1083 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteFamily.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/DeleteFamily.java new file mode 100644 index 0000000000..367811c386 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Entry.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Entry.java new file mode 100644 index 0000000000..44abf53d5f --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.java new file mode 100644 index 0000000000..ae5507ae75 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewId.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewId.java new file mode 100644 index 0000000000..f6f08d441a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MergeToCell.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MergeToCell.java new file mode 100644 index 0000000000..cca3aee182 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java index d1c0eda844..3eb6c6c7dd 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutateRowsException.java @@ -17,6 +17,7 @@ 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; @@ -32,20 +33,6 @@ * were part of that RPC. */ public final class MutateRowsException extends ApiException { - // Synthetic status to use for this ApiException subclass. - private static final StatusCode LOCAL_STATUS = - new StatusCode() { - @Override - public Code getCode() { - return Code.INTERNAL; - } - - @Override - public Object getTransportCode() { - return null; - } - }; - private final List failedMutations; /** @@ -53,16 +40,38 @@ public Object getTransportCode() { * applications. */ @InternalApi - public MutateRowsException( + public static MutateRowsException create( @Nullable Throwable rpcError, + StatusCode status, @Nonnull List failedMutations, boolean retryable) { - super("Some mutations failed to apply", rpcError, LOCAL_STATUS, 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. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java index 326d78cfe0..dc55756241 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Mutation.java @@ -17,9 +17,11 @@ 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; @@ -87,6 +89,19 @@ public static Mutation fromProtoUnsafe(List pro 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. * @@ -276,6 +291,42 @@ public Mutation deleteRow() { 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( diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java index 20c7ab2715..3a54f68748 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/MutationApi.java @@ -122,4 +122,94 @@ T deleteCells( /** 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java index 765fa01205..f448f22ef1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java @@ -15,6 +15,7 @@ */ 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; @@ -43,23 +44,37 @@ public final class Query implements Serializable { private static final long serialVersionUID = -316972783499434755L; - // bigtable can server the largest filter size of 20MB. - private static final int MAX_FILTER_SIZE = 20 * 1024 * 1024; + // bigtable can server the largest filter size of 20KB. + private static final int MAX_FILTER_SIZE = 20 * 1024; - private final String tableId; + private final TargetId targetId; private transient ReadRowsRequest.Builder builder = ReadRowsRequest.newBuilder(); /** - * Constructs a new Query 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}. + * @deprecated Please use {@link Query#create(TargetId)} instead. */ + @Deprecated public static Query create(String tableId) { - return new Query(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(String tableId) { - this.tableId = tableId; + private Query(TargetId targetId) { + Preconditions.checkNotNull(targetId, "target id can't be null."); + + this.targetId = targetId; } private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { @@ -170,7 +185,7 @@ public Query filter(Filters.Filter filter) { RowFilter rowFilter = filter.toProto(); Preconditions.checkArgument( - rowFilter.getSerializedSize() < MAX_FILTER_SIZE, "filter size can't be more than 20MB"); + rowFilter.getSerializedSize() < MAX_FILTER_SIZE, "filter size can't be more than 20KB"); builder.setFilter(rowFilter); return this; @@ -183,6 +198,26 @@ public Query limit(long 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 @@ -239,7 +274,8 @@ public List shard(SortedSet splitPoints) { List shards = Lists.newArrayListWithCapacity(shardedRowSets.size()); for (RowSet rowSet : shardedRowSets) { - Query queryShard = new Query(tableId); + Query queryShard; + queryShard = new Query(targetId); queryShard.builder.mergeFrom(this.builder.build()); queryShard.builder.setRows(rowSet); shards.add(queryShard); @@ -248,6 +284,29 @@ public List shard(SortedSet splitPoints) { 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()); @@ -259,14 +318,16 @@ public ByteStringRange getBound() { */ @InternalApi public ReadRowsRequest toProto(RequestContext requestContext) { - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); - - return builder - .setTableName(tableName) - .setAppProfileId(requestContext.getAppProfileId()) - .build(); + 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(); } /** @@ -277,15 +338,20 @@ public ReadRowsRequest toProto(RequestContext requestContext) { */ 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.extractTableIdFromTableName(request.getTableName())); + Query query = + new Query(NameUtil.extractTargetId(tableName, authorizedViewName, materializedViewName)); query.builder = request.toBuilder(); return query; } + @Override public Query clone() { - Query query = Query.create(tableId); + Query query = Query.create(targetId); query.builder = this.builder.clone(); return query; } @@ -297,6 +363,79 @@ private static ByteString wrapKey(String key) { 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) { @@ -306,7 +445,7 @@ public boolean equals(Object o) { return false; } Query query = (Query) o; - return Objects.equal(tableId, query.tableId) + 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()); @@ -315,7 +454,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hashCode( - tableId, builder.getRows(), builder.getFilter(), builder.getRowsLimit()); + targetId, builder.getRows(), builder.getFilter(), builder.getRowsLimit()); } @Override @@ -323,7 +462,7 @@ public String toString() { ReadRowsRequest request = builder.build(); return MoreObjects.toStringHelper(this) - .add("tableId", tableId) + .add("targetId", targetId) .add("keys", request.getRows().getRowKeysList()) .add("ranges", request.getRows().getRowRangesList()) .add("filter", request.getFilter()) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java index 4d7a10ab2a..a3cdff5912 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Range.java @@ -15,10 +15,13 @@ */ 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; @@ -395,6 +398,22 @@ 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) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery.java new file mode 100644 index 0000000000..2c9cf54354 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java index 5fa483d1bd..f51635f546 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRow.java @@ -33,25 +33,53 @@ public final class ReadModifyWriteRow implements Serializable { private static final long serialVersionUID = -8150045424541029193L; - private final String tableId; + private final TargetId targetId; private transient ReadModifyWriteRowRequest.Builder builder = ReadModifyWriteRowRequest.newBuilder(); - private ReadModifyWriteRow(@Nonnull String tableId, @Nonnull ByteString key) { - Preconditions.checkNotNull(tableId, "tableId can't be null."); + private ReadModifyWriteRow(TargetId targetId, ByteString key) { + Preconditions.checkNotNull(targetId, "target id can't be null."); Preconditions.checkNotNull(key, "key can't be null."); - this.tableId = tableId; + this.targetId = targetId; builder.setRowKey(key); } - public static ReadModifyWriteRow create(@Nonnull String tableId, @Nonnull String 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, ByteString.copyFromUtf8(key)); + 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)); } - public static ReadModifyWriteRow create(@Nonnull String tableId, @Nonnull ByteString key) { - return new ReadModifyWriteRow(tableId, 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 { @@ -129,14 +157,14 @@ public ReadModifyWriteRow increment( @InternalApi public ReadModifyWriteRowRequest toProto(RequestContext requestContext) { - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); - - return builder - .setTableName(tableName) - .setAppProfileId(requestContext.getAppProfileId()) - .build(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); } /** @@ -147,9 +175,12 @@ public ReadModifyWriteRowRequest toProto(RequestContext requestContext) { */ @BetaApi public static ReadModifyWriteRow fromProto(@Nonnull ReadModifyWriteRowRequest request) { - String tableId = NameUtil.extractTableIdFromTableName(request.getTableName()); + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); - ReadModifyWriteRow row = ReadModifyWriteRow.create(tableId, request.getRowKey()); + ReadModifyWriteRow row = + ReadModifyWriteRow.create( + NameUtil.extractTargetId(tableName, authorizedViewName), request.getRowKey()); row.builder = request.toBuilder(); return row; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java index 6c5456aac3..38d822afcb 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutation.java @@ -23,6 +23,7 @@ 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; @@ -34,60 +35,110 @@ public final class RowMutation implements MutationApi, Serializable { private static final long serialVersionUID = 6529002234913236318L; - private final String tableId; + private final TargetId targetId; private final ByteString key; private final Mutation mutation; - private RowMutation(String tableId, ByteString key, Mutation mutation) { - this.tableId = tableId; + 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; } - /** Creates a new instance of the mutation builder. */ - public static RowMutation create(@Nonnull String tableId, @Nonnull String key) { + /** + * @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. */ - public static RowMutation create(@Nonnull String tableId, @Nonnull ByteString key) { - return new RowMutation(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, 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 new instance of mutation builder 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. + * 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("[TABLE]", "[ROW_KEY]", mutation);
+   * RowMutation rowMutation = RowMutation.create(TableId.of("[TABLE]"), "[ROW_KEY]", mutation);
    * 
+ * + * @see AuthorizedViewId + * @see TableId */ - public static RowMutation create( - @Nonnull String tableId, @Nonnull String key, @Nonnull Mutation mutation) { - return create(tableId, ByteString.copyFromUtf8(key), mutation); + public static RowMutation create(TargetId targetId, String key, Mutation mutation) { + return create(targetId, ByteString.copyFromUtf8(key), mutation); } /** - * Creates new instance of mutation builder 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. + * @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("[TABLE]", [BYTE_STRING_ROW_KEY], mutation);
+   * RowMutation rowMutation = RowMutation.create(TableId.of("[TABLE]"), [BYTE_STRING_ROW_KEY], mutation);
    * 
+ * + * @see AuthorizedViewId + * @see TableId */ - public static RowMutation create( - @Nonnull String tableId, @Nonnull ByteString key, @Nonnull Mutation mutation) { - return new RowMutation(tableId, key, mutation); + public static RowMutation create(TargetId targetId, ByteString key, Mutation mutation) { + return new RowMutation(targetId, key, mutation); } @Override @@ -184,15 +235,39 @@ public RowMutation 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 MutateRowRequest toProto(RequestContext requestContext) { - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); + MutateRowRequest.Builder builder = MutateRowRequest.newBuilder(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } - return MutateRowRequest.newBuilder() + return builder .setAppProfileId(requestContext.getAppProfileId()) - .setTableName(tableName) .setRowKey(key) .addAllMutations(mutation.getMutations()) .build(); @@ -204,13 +279,17 @@ public MutateRowRequest toProto(RequestContext requestContext) { */ @InternalApi public MutateRowsRequest toBulkProto(RequestContext requestContext) { - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); + MutateRowsRequest.Builder builder = MutateRowsRequest.newBuilder(); + String resourceName = + targetId.toResourceName(requestContext.getProjectId(), requestContext.getInstanceId()); + if (targetId.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } - return MutateRowsRequest.newBuilder() + return builder .setAppProfileId(requestContext.getAppProfileId()) - .setTableName(tableName) .addEntries( Entry.newBuilder().setRowKey(key).addAllMutations(mutation.getMutations()).build()) .build(); @@ -229,9 +308,12 @@ public MutateRowsRequest toBulkProto(RequestContext requestContext) { */ @BetaApi public static RowMutation fromProto(@Nonnull MutateRowRequest request) { - String tableId = NameUtil.extractTableIdFromTableName(request.getTableName()); + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); return RowMutation.create( - tableId, request.getRowKey(), Mutation.fromProto(request.getMutationsList())); + NameUtil.extractTargetId(tableName, authorizedViewName), + request.getRowKey(), + Mutation.fromProto(request.getMutationsList())); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java index 9239b30497..2cd2529d53 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/RowMutationEntry.java @@ -15,6 +15,7 @@ */ 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; @@ -32,6 +33,8 @@ 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; @@ -54,6 +57,13 @@ 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. * @@ -170,8 +180,33 @@ public RowMutationEntry 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()) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java new file mode 100644 index 0000000000..78a444019c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SetCell.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SetCell.java new file mode 100644 index 0000000000..92f9b6d386 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java new file mode 100644 index 0000000000..f743128212 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java new file mode 100644 index 0000000000..73860dc1d8 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Value.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Value.java new file mode 100644 index 0000000000..a7ea9f0c50 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatement.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatement.java new file mode 100644 index 0000000000..82c1084afd --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java new file mode 100644 index 0000000000..20d063922c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatement.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatement.java new file mode 100644 index 0000000000..e54c86953b --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatementRefreshTimeoutException.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/PreparedStatementRefreshTimeoutException.java new file mode 100644 index 0000000000..413997aff8 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSet.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSet.java new file mode 100644 index 0000000000..a149c03728 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSetMetadata.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSetMetadata.java new file mode 100644 index 0000000000..303c00928e --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java new file mode 100644 index 0000000000..1307349c92 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Struct.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Struct.java new file mode 100644 index 0000000000..a043e714f0 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/StructReader.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/StructReader.java new file mode 100644 index 0000000000..0af8b8017a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java index e61dd72c17..eea295074e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettings.java @@ -16,17 +16,24 @@ 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. @@ -43,6 +50,7 @@ * .setDelayThreshold(Duration.ofSeconds(10)) * .build()) * .setRetryableCodes(Code.DEADLINE_EXCEEDED) + * .setLatencyBasedThrottling(true, 1000L) * .build(); * }

* @@ -50,11 +58,18 @@ * @see RetrySettings for retry configuration. */ @BetaApi("This surface is likely to change as the batching surface evolves.") -public final class BigtableBatchingCallSettings extends UnaryCallSettings { +public final class BigtableBatchingCallSettings + extends UnaryCallSettings { // This settings is just a simple wrapper for BatchingCallSettings to allow us to add // additional functionality. - private BatchingCallSettings batchingCallSettings; + 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); @@ -64,6 +79,10 @@ private BigtableBatchingCallSettings(Builder builder) { .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. */ @@ -72,12 +91,40 @@ public BatchingSettings getBatchingSettings() { } /** Returns an adapter that packs and unpacks batching elements. */ - BatchingDescriptor getBatchingDescriptor() { + 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) { + BatchingDescriptor + batchingDescriptor) { return new Builder(batchingDescriptor); } @@ -90,18 +137,37 @@ 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 { + public static class Builder + extends UnaryCallSettings.Builder { - private BatchingDescriptor batchingDescriptor; + private BatchingDescriptor + batchingDescriptor; private BatchingSettings batchingSettings; + private boolean isLatencyBasedThrottlingEnabled; + private Long targetRpcLatencyMs; + private DynamicFlowControlSettings dynamicFlowControlSettings; + + private boolean isServerInitiatedFlowControlEnabled; private Builder( @Nonnull - BatchingDescriptor batchingDescriptor) { + BatchingDescriptor + batchingDescriptor) { this.batchingDescriptor = Preconditions.checkNotNull(batchingDescriptor, "batching descriptor can't be null"); } @@ -110,6 +176,10 @@ 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. */ @@ -145,9 +215,154 @@ public Builder setRetrySettings(@Nonnull RetrySettings 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java index 15be8f7309..bcec4c5403 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimer.java @@ -15,154 +15,165 @@ */ package com.google.cloud.bigtable.data.v2.stub; -import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; - import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.ChannelPrimer; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.rpc.FixedTransportChannelProvider; +import com.google.api.core.InternalApi; +import com.google.api.core.SettableApiFuture; 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.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import com.google.protobuf.ByteString; -import io.grpc.ConnectivityState; -import io.grpc.ManagedChannel; +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.util.HashMap; -import java.util.List; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.Map; -import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; import java.util.logging.Logger; -import org.threeten.bp.Duration; /** * A channel warmer that ensures that a Bigtable channel is ready to be used before being added to - * the active {@link com.google.api.gax.grpc.ChannelPool}. + * 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. */ -@BetaApi("Channel priming is not currently stable and might change in the future") -class BigtableChannelPrimer implements ChannelPrimer { +@InternalApi +public class BigtableChannelPrimer implements ChannelPrimer { private static Logger LOG = Logger.getLogger(BigtableChannelPrimer.class.toString()); - static ByteString PRIMING_ROW_KEY = ByteString.copyFromUtf8("nonexistent-priming-row"); - private static Duration PRIME_REQUEST_TIMEOUT = Duration.ofSeconds(30); - - private final EnhancedBigtableStubSettings settingsTemplate; - private final List tableIds; + 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, - List tableIds) { - EnhancedBigtableStubSettings.Builder builder = - EnhancedBigtableStubSettings.newBuilder() - .setProjectId(projectId) - .setInstanceId(instanceId) + 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) - .setCredentialsProvider(FixedCredentialsProvider.create(credentials)) - .setExecutorProvider( - InstantiatingExecutorProvider.newBuilder().setExecutorThreadCount(1).build()); - - // Disable retries for priming request - builder - .readRowSettings() - .setRetrySettings( - builder - .readRowSettings() - .getRetrySettings() - .toBuilder() - .setMaxAttempts(1) - .setJittered(false) - .setInitialRpcTimeout(PRIME_REQUEST_TIMEOUT) - .setMaxRpcTimeout(PRIME_REQUEST_TIMEOUT) - .setTotalTimeout(PRIME_REQUEST_TIMEOUT) - .build()); - return new BigtableChannelPrimer(builder.build(), tableIds); - } + .build(); - private BigtableChannelPrimer( - EnhancedBigtableStubSettings settingsTemplate, List tableIds) { - Preconditions.checkNotNull(settingsTemplate, "settingsTemplate can't be null"); - this.settingsTemplate = settingsTemplate; - this.tableIds = ImmutableList.copyOf(tableIds); + this.headers = headers; } @Override - public void primeChannel(ManagedChannel managedChannel) { + public void primeChannel(Channel channel) { try { - primeChannelUnsafe(managedChannel); + primeChannelUnsafe(channel); } catch (IOException | RuntimeException e) { - LOG.warning( - String.format("Unexpected error while trying to prime a channel: %s", e.getMessage())); + LOG.log(Level.WARNING, "Unexpected error while trying to prime a channel", e); } } - private void primeChannelUnsafe(ManagedChannel managedChannel) throws IOException { - if (tableIds.isEmpty()) { - waitForChannelReady(managedChannel); - } else { - sendPrimeRequests(managedChannel); - } + private void primeChannelUnsafe(Channel channel) throws IOException { + sendPrimeRequestsBlocking(channel); } - private void waitForChannelReady(ManagedChannel managedChannel) { - for (int i = 0; i < 30; i++) { - ConnectivityState connectivityState = managedChannel.getState(true); - if (connectivityState == ConnectivityState.READY) { - break; - } - try { - TimeUnit.SECONDS.sleep(1); - } catch (InterruptedException e) { - break; - } + 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); } } - private void sendPrimeRequests(ManagedChannel managedChannel) throws IOException { - // Wrap the channel in a temporary stub - EnhancedBigtableStubSettings primingSettings = - settingsTemplate - .toBuilder() - .setTransportChannelProvider( - FixedTransportChannelProvider.create(GrpcTransportChannel.create(managedChannel))) - .build(); + @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; + } - try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(primingSettings)) { - Map> primeFutures = new HashMap<>(); - - // Prime all of the table ids in parallel - for (String tableId : tableIds) { - ApiFuture f = - stub.readRowCallable() - .futureCall(Query.create(tableId).rowKey(PRIMING_ROW_KEY).filter(FILTERS.block())); - - primeFutures.put(tableId, f); - } - - // Wait for all of the prime requests to complete. - for (Map.Entry> entry : primeFutures.entrySet()) { - try { - entry.getValue().get(); - } catch (Throwable e) { - if (e instanceof ExecutionException) { - e = e.getCause(); + @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)); + } } - LOG.warning( - String.format( - "Failed to prime channel for table: %s: %s", entry.getKey(), e.getMessage())); - } - } + }, + 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; + } + + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java new file mode 100644 index 0000000000..12cab879fc --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableClientContext.java @@ -0,0 +1,324 @@ +/* + * 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.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 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; + + 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 + 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(); + try { + return new BigtableClientContext(false, 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, + ClientInfo clientInfo, + ClientContext clientContext, + Metrics metrics, + ExecutorProvider backgroundExecutorProvider) + throws IOException { + this.isChild = isChild; + 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 { + return new BigtableClientContext( + true, + clientInfo.toBuilder().setInstanceName(instanceName).setAppProfileId(appProfileId).build(), + clientContext, + metrics, + backgroundExecutorProvider); + } + + public void close() throws Exception { + if (isChild) { + return; + } + + 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; + }); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStreamResumptionStrategy.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStreamResumptionStrategy.java new file mode 100644 index 0000000000..8eb907d673 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java index c6f1885985..d1faee3766 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,10 +22,20 @@ 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; @@ -62,11 +72,36 @@ public ServerStreamingCallable mutateRows throw new UnsupportedOperationException("Not implemented: checkAndMutateRowCallable()"); } + public UnaryCallable pingAndWarmCallable() { + throw new UnsupportedOperationException("Not implemented: pingAndWarmCallable()"); + } + public UnaryCallable readModifyWriteRowCallable() { throw new UnsupportedOperationException("Not implemented: readModifyWriteRowCallable()"); } + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index dfe0c07733..a411621176 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ package com.google.cloud.bigtable.data.v2.stub; import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; 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; @@ -28,6 +28,7 @@ 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; @@ -35,10 +36,20 @@ 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; @@ -50,9 +61,9 @@ 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; -import org.threeten.bp.Duration; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** For internal use only. */ @@ -78,8 +89,18 @@ public class BigtableStubSettings extends StubSettings { 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() { @@ -108,13 +129,44 @@ public ServerStreamingCallSettings mutate return checkAndMutateRowSettings; } + /** Returns the object with the settings used for calls to pingAndWarm. */ + public UnaryCallSettings pingAndWarmSettings() { + return pingAndWarmSettings; + } + /** Returns the object with the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings readModifyWriteRowSettings() { return readModifyWriteRowSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + /** + * 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() @@ -126,16 +178,28 @@ public BigtableStub createStub() throws IOException { "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; @@ -143,7 +207,9 @@ public static List getDefaultServiceScopes() { /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); } /** Returns a builder for the default ChannelProvider for this service. */ @@ -156,7 +222,6 @@ public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(BigtableStubSettings.class)) @@ -187,7 +252,21 @@ protected BigtableStubSettings(Builder settingsBuilder) throws IOException { mutateRowSettings = settingsBuilder.mutateRowSettings().build(); mutateRowsSettings = settingsBuilder.mutateRowsSettings().build(); checkAndMutateRowSettings = settingsBuilder.checkAndMutateRowSettings().build(); + pingAndWarmSettings = settingsBuilder.pingAndWarmSettings().build(); readModifyWriteRowSettings = settingsBuilder.readModifyWriteRowSettings().build(); + 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/java-bigtable") + .build(); } /** Builder for BigtableStubSettings. */ @@ -202,8 +281,21 @@ public static class Builder extends StubSettings.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; @@ -211,18 +303,28 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_4_codes", + "retry_policy_5_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); definitions.put( - "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + 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(); } @@ -233,59 +335,76 @@ public static class Builder extends StubSettings.Builder>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings, + prepareQuerySettings); initDefaults(this); } @@ -317,11 +445,21 @@ protected Builder(BigtableStubSettings settings) { 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, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings, + prepareQuerySettings); } private static Builder createDefault() { @@ -330,7 +468,8 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); return initDefaults(builder); } @@ -338,45 +477,69 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder .readRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); builder .sampleRowKeysSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .mutateRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_4_params")); + .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("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .checkAndMutateRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pingAndWarmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .readModifyWriteRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + 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; } - // NEXT_MAJOR_VER: remove 'throws Exception'. /** * 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) throws Exception { + ApiFunction, Void> settingsUpdater) { super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); return this; } @@ -414,12 +577,46 @@ public UnaryCallSettings.Builder mutateRowS return checkAndMutateRowSettings; } + /** Returns the builder for the settings used for calls to pingAndWarm. */ + public UnaryCallSettings.Builder + pingAndWarmSettings() { + return pingAndWarmSettings; + } + /** Returns the builder for the settings used for calls to readModifyWriteRow. */ public UnaryCallSettings.Builder readModifyWriteRowSettings() { 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallable.java new file mode 100644 index 0000000000..726ab47381 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallable.java deleted file mode 100644 index 549e10f44b..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallable.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.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.CheckAndMutateRowRequest; -import com.google.bigtable.v2.CheckAndMutateRowResponse; -import com.google.cloud.bigtable.data.v2.internal.RequestContext; -import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; -import com.google.common.util.concurrent.MoreExecutors; - -/** Simple wrapper for CheckAndMutateRow to wrap the request and response protobufs. */ -class CheckAndMutateRowCallable extends UnaryCallable { - private final UnaryCallable inner; - private final RequestContext requestContext; - - CheckAndMutateRowCallable( - UnaryCallable inner, - RequestContext requestContext) { - this.inner = inner; - this.requestContext = requestContext; - } - - @Override - public ApiFuture futureCall(ConditionalRowMutation request, ApiCallContext context) { - ApiFuture rawResponse = - inner.futureCall(request.toProto(requestContext), context); - - return ApiFutures.transform( - rawResponse, - new ApiFunction() { - @Override - public Boolean apply(CheckAndMutateRowResponse checkAndMutateRowResponse) { - return checkAndMutateRowResponse.getPredicateMatched(); - } - }, - MoreExecutors.directExecutor()); - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ClientOperationSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ClientOperationSettings.java new file mode 100644 index 0000000000..540eb08cc8 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.java new file mode 100644 index 0000000000..ca99ebd02b --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolder.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolder.java new file mode 100644 index 0000000000..7a153cfd5f --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesInterceptor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesInterceptor.java new file mode 100644 index 0000000000..77387851fa --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesServerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesServerStreamingCallable.java new file mode 100644 index 0000000000..0d012b8ea0 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/CookiesUnaryCallable.java new file mode 100644 index 0000000000..b0d42d5955 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallable.java new file mode 100644 index 0000000000..8b89a09647 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStats.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStats.java new file mode 100644 index 0000000000..ad659d4623 --- /dev/null +++ b/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;
    +    }
    +
    +    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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
    index 8f2505c58f..44bcc00fb6 100644
    --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
    +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java
    @@ -15,86 +15,114 @@
      */
     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.core.BackgroundResource;
    -import com.google.api.gax.core.FixedCredentialsProvider;
    -import com.google.api.gax.core.GaxProperties;
    -import com.google.api.gax.grpc.GaxGrpcProperties;
    +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.grpc.InstantiatingGrpcChannelProvider;
    +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.OpencensusTracerFactory;
     import com.google.api.gax.tracing.SpanName;
     import com.google.api.gax.tracing.TracedServerStreamingCallable;
     import com.google.api.gax.tracing.TracedUnaryCallable;
    -import com.google.auth.Credentials;
     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.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.ReadModifyWriteRowRequest;
    -import com.google.bigtable.v2.ReadModifyWriteRowResponse;
    +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.SampleRowKeysRequest;
    +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.stub.metrics.CompositeTracerFactory;
    -import com.google.cloud.bigtable.data.v2.stub.metrics.HeaderTracerStreamingCallable;
    -import com.google.cloud.bigtable.data.v2.stub.metrics.HeaderTracerUnaryCallable;
    -import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsTracerFactory;
    -import com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants;
    +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.ReadRowsConvertExceptionCallable;
     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.gaxx.retrying.ApiResultRetryAlgorithm;
    +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.ImmutableList;
     import com.google.common.collect.ImmutableMap;
     import com.google.protobuf.ByteString;
    -import io.opencensus.stats.Stats;
    -import io.opencensus.stats.StatsRecorder;
    -import io.opencensus.tags.TagKey;
    -import io.opencensus.tags.TagValue;
    -import io.opencensus.tags.Tagger;
    -import io.opencensus.tags.Tags;
    +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.
    @@ -110,123 +138,73 @@
      */
     @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 EnhancedBigtableStubSettings settings;
    -  private final ClientContext clientContext;
       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> sampleRowKeysCallable;
    +  private final UnaryCallable> bulkReadRowsCallable;
    +  @Deprecated private final UnaryCallable> sampleRowKeysCallable;
    +  private final UnaryCallable>
    +      sampleRowKeysCallableWithRequest;
       private final UnaryCallable mutateRowCallable;
    -  private final UnaryCallable bulkMutateRowsCallable;
    +  private final UnaryCallable bulkMutateRowsCallable;
    +  private final UnaryCallable externalBulkMutateRowsCallable;
       private final UnaryCallable checkAndMutateRowCallable;
       private final UnaryCallable readModifyWriteRowCallable;
     
    -  public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings)
    -      throws IOException {
    -    settings = finalizeSettings(settings, Tags.getTagger(), Stats.getStatsRecorder());
    -
    -    return new EnhancedBigtableStub(settings, ClientContext.create(settings));
    -  }
    +  private final ServerStreamingCallable
    +      generateInitialChangeStreamPartitionsCallable;
     
    -  public static EnhancedBigtableStubSettings finalizeSettings(
    -      EnhancedBigtableStubSettings settings, Tagger tagger, StatsRecorder stats)
    -      throws IOException {
    -    EnhancedBigtableStubSettings.Builder builder = settings.toBuilder();
    +  private final ServerStreamingCallable
    +      readChangeStreamCallable;
     
    -    // TODO: this implementation is on the cusp of unwieldy, if we end up adding more features
    -    // consider splitting it up by feature.
    +  private final ExecuteQueryCallable executeQueryCallable;
    +  private final UnaryCallable prepareQueryCallable;
     
    -    // Inject channel priming
    -    if (settings.isRefreshingChannel()) {
    -      // Fix the credentials so that they can be shared
    -      Credentials credentials = null;
    -      if (settings.getCredentialsProvider() != null) {
    -        credentials = settings.getCredentialsProvider().getCredentials();
    -      }
    -      builder.setCredentialsProvider(FixedCredentialsProvider.create(credentials));
    -
    -      // Inject the primer
    -      InstantiatingGrpcChannelProvider transportProvider =
    -          (InstantiatingGrpcChannelProvider) settings.getTransportChannelProvider();
    -
    -      builder.setTransportChannelProvider(
    -          transportProvider
    -              .toBuilder()
    -              .setChannelPrimer(
    -                  BigtableChannelPrimer.create(
    -                      credentials,
    -                      settings.getProjectId(),
    -                      settings.getInstanceId(),
    -                      settings.getAppProfileId(),
    -                      settings.getPrimedTableIds()))
    -              .build());
    -    }
    +  public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings)
    +      throws IOException {
    +    BigtableClientContext bigtableClientContext = BigtableClientContext.create(settings);
    +    return new EnhancedBigtableStub(settings.getPerOpSettings(), bigtableClientContext);
    +  }
     
    -    ImmutableMap attributes =
    -        ImmutableMap.builder()
    -            .put(RpcMeasureConstants.BIGTABLE_PROJECT_ID, TagValue.create(settings.getProjectId()))
    -            .put(
    -                RpcMeasureConstants.BIGTABLE_INSTANCE_ID, TagValue.create(settings.getInstanceId()))
    -            .put(
    -                RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID,
    -                TagValue.create(settings.getAppProfileId()))
    -            .build();
    -    // Inject Opencensus instrumentation
    -    builder.setTracerFactory(
    -        new CompositeTracerFactory(
    -            ImmutableList.of(
    -                // Add OpenCensus Tracing
    -                new OpencensusTracerFactory(
    -                    ImmutableMap.builder()
    -                        // Annotate traces with the same tags as metrics
    -                        .put(
    -                            RpcMeasureConstants.BIGTABLE_PROJECT_ID.getName(),
    -                            settings.getProjectId())
    -                        .put(
    -                            RpcMeasureConstants.BIGTABLE_INSTANCE_ID.getName(),
    -                            settings.getInstanceId())
    -                        .put(
    -                            RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID.getName(),
    -                            settings.getAppProfileId())
    -                        // Also annotate traces with library versions
    -                        .put("gax", GaxGrpcProperties.getGaxGrpcVersion())
    -                        .put("grpc", GaxGrpcProperties.getGrpcVersion())
    -                        .put(
    -                            "gapic",
    -                            GaxProperties.getLibraryVersion(EnhancedBigtableStubSettings.class))
    -                        .build()),
    -                // Add OpenCensus Metrics
    -                MetricsTracerFactory.create(tagger, stats, attributes),
    -                // Add user configured tracer
    -                settings.getTracerFactory())));
    -    builder.setHeaderTracer(
    -        builder
    -            .getHeaderTracer()
    -            .toBuilder()
    -            .setStats(stats)
    -            .setTagger(tagger)
    -            .setStatsAttributes(attributes)
    -            .build());
    -    return builder.build();
    -  }
    -
    -  public EnhancedBigtableStub(EnhancedBigtableStubSettings settings, ClientContext clientContext) {
    -    this.settings = settings;
    -    this.clientContext = clientContext;
    -    this.requestContext =
    -        RequestContext.create(
    -            settings.getProjectId(), settings.getInstanceId(), settings.getAppProfileId());
    +  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 = createBulkMutateRowsCallable();
    +    bulkMutateRowsCallable = createMutateRowsBaseCallable();
    +    externalBulkMutateRowsCallable =
    +        new MutateRowsErrorConverterUnaryCallable(bulkMutateRowsCallable);
         checkAndMutateRowCallable = createCheckAndMutateRowCallable();
         readModifyWriteRowCallable = createReadModifyWriteRowCallable();
    +    generateInitialChangeStreamPartitionsCallable =
    +        createGenerateInitialChangeStreamPartitionsCallable();
    +    readChangeStreamCallable =
    +        createReadChangeStreamCallable(new DefaultChangeStreamRecordAdapter());
    +    executeQueryCallable = createExecuteQueryCallable();
    +    prepareQueryCallable = createPrepareQueryCallable();
       }
     
       // 
    @@ -248,8 +226,8 @@ public EnhancedBigtableStub(EnhancedBigtableStubSettings settings, ClientContext
       @BetaApi("This surface is stable yet it might be removed in the future.")
       public  ServerStreamingCallable createReadRowsRawCallable(
           RowAdapter rowAdapter) {
    -    return createReadRowsBaseCallable(settings.readRowsSettings(), rowAdapter)
    -        .withDefaultCallContext(clientContext.getDefaultCallContext());
    +    return createReadRowsBaseCallable(perOpSettings.readRowsSettings, rowAdapter)
    +        .withDefaultCallContext(bigtableClientContext.getClientContext().getDefaultCallContext());
       }
     
       /**
    @@ -269,7 +247,7 @@ public  ServerStreamingCallable createReadRowsRawCa
       public  ServerStreamingCallable createReadRowsCallable(
           RowAdapter rowAdapter) {
         ServerStreamingCallable readRowsCallable =
    -        createReadRowsBaseCallable(settings.readRowsSettings(), rowAdapter);
    +        createReadRowsBaseCallable(perOpSettings.readRowsSettings, rowAdapter);
     
         ServerStreamingCallable readRowsUserCallable =
             new ReadRowsUserCallable<>(readRowsCallable, requestContext);
    @@ -277,9 +255,15 @@ public  ServerStreamingCallable createReadRowsCallable(
         SpanName span = getSpanName("ReadRows");
         ServerStreamingCallable traced =
             new TracedServerStreamingCallable<>(
    -            readRowsUserCallable, clientContext.getTracerFactory(), span);
    -
    -    return traced.withDefaultCallContext(clientContext.getDefaultCallContext());
    +            readRowsUserCallable,
    +            bigtableClientContext.getClientContext().getTracerFactory(),
    +            span);
    +
    +    return traced.withDefaultCallContext(
    +        bigtableClientContext
    +            .getClientContext()
    +            .getDefaultCallContext()
    +            .withRetrySettings(perOpSettings.readRowsSettings.getRetrySettings()));
       }
     
       /**
    @@ -297,19 +281,38 @@ public  ServerStreamingCallable createReadRowsCallable(
        * 
*/ public UnaryCallable createReadRowCallable(RowAdapter rowAdapter) { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable readRowsCallable = createReadRowsBaseCallable( ServerStreamingCallSettings.newBuilder() - .setRetryableCodes(settings.readRowSettings().getRetryableCodes()) - .setRetrySettings(settings.readRowSettings().getRetrySettings()) - .setIdleTimeout(settings.readRowSettings().getRetrySettings().getTotalTimeout()) + .setRetryableCodes(perOpSettings.readRowSettings.getRetryableCodes()) + .setRetrySettings(perOpSettings.readRowSettings.getRetrySettings()) + .setIdleTimeoutDuration(Duration.ZERO) + .setWaitTimeoutDuration(Duration.ZERO) .build(), - rowAdapter); - - UnaryCallable readRowCallable = - new ReadRowsUserCallable<>(readRowsCallable, requestContext).first(); + rowAdapter, + new SimpleStreamResumptionStrategy<>()); + ServerStreamingCallable readRowCallable = + new TransformingServerStreamingCallable<>( + readRowsCallable, + (query) -> query.limit(1).toProto(requestContext), + Functions.identity()); + + return new BigtableUnaryOperationCallable<>( + readRowCallable, + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.readRowSettings.getRetrySettings()), + clientContext.getTracerFactory(), + getSpanName("ReadRow"), + /* allowNoResponse= */ true); + } - return createUserFacingUnaryCallable("ReadRow", readRowCallable); + private ServerStreamingCallable createReadRowsBaseCallable( + ServerStreamingCallSettings readRowsSettings, RowAdapter rowAdapter) { + return createReadRowsBaseCallable( + readRowsSettings, rowAdapter, new ReadRowsResumptionStrategy(rowAdapter)); } /** @@ -320,7 +323,7 @@ public UnaryCallable createReadRowCallable(RowAdapter *
  • 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 header tracer for tracking GFE metrics. + *
  • Add bigtable tracer for tracking bigtable specific metrics. *
  • Retry/resume on failure. *
  • Filter out marker rows. * @@ -328,29 +331,28 @@ public UnaryCallable createReadRowCallable(RowAdapter *

    NOTE: the caller is responsible for adding tracing & metrics. */ private ServerStreamingCallable createReadRowsBaseCallable( - ServerStreamingCallSettings readRowsSettings, RowAdapter rowAdapter) { - + ServerStreamingCallSettings readRowsSettings, + RowAdapter rowAdapter, + StreamResumptionStrategy resumptionStrategy) { ServerStreamingCallable base = GrpcRawCallableFactory.createServerStreamingCallable( GrpcCallSettings.newBuilder() .setMethodDescriptor(BigtableGrpc.getReadRowsMethod()) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ReadRowsRequest readRowsRequest) { - return ImmutableMap.of( - "table_name", readRowsRequest.getTableName(), - "app_profile_id", readRowsRequest.getAppProfileId()); - } - }) + 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 ReadRowsConvertExceptionCallable<>(base); + new ConvertExceptionCallable<>(withStatsHeaders); ServerStreamingCallable merging = new RowMergingCallable<>(convertException, rowAdapter); @@ -359,35 +361,189 @@ public Map extract(ReadRowsRequest readRowsRequest) { // ReadRowsRequest -> ReadRowsResponse callable). ServerStreamingCallSettings innerSettings = ServerStreamingCallSettings.newBuilder() - .setResumptionStrategy(new ReadRowsResumptionStrategy<>(rowAdapter)) + .setResumptionStrategy(resumptionStrategy) .setRetryableCodes(readRowsSettings.getRetryableCodes()) .setRetrySettings(readRowsSettings.getRetrySettings()) .setIdleTimeout(readRowsSettings.getIdleTimeout()) + .setWaitTimeout(readRowsSettings.getWaitTimeout()) .build(); ServerStreamingCallable watched = - Callables.watched(merging, innerSettings, clientContext); + Callables.watched(merging, innerSettings, bigtableClientContext.getClientContext()); - ServerStreamingCallable withHeaderTracer = - new HeaderTracerStreamingCallable<>( - watched, settings.getHeaderTracer(), getSpanName("ReadRows").toString()); + 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<>(withHeaderTracer); + new ReadRowsRetryCompletedCallable<>(withBigtableTracer); ServerStreamingCallable retrying2 = - Callables.retrying(retrying1, innerSettings, clientContext); + 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 table id to a {@link com.google.bigtable.v2.SampleRowKeysRequest}. + *
    • 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. @@ -395,37 +551,44 @@ public Map extract(ReadRowsRequest readRowsRequest) { *
    • Add tracing & metrics. *
    */ - private UnaryCallable> createSampleRowKeysCallable() { + private UnaryCallable> + createSampleRowKeysCallableWithRequest() { String methodName = "SampleRowKeys"; - ServerStreamingCallable base = - GrpcRawCallableFactory.createServerStreamingCallable( - GrpcCallSettings.newBuilder() - .setMethodDescriptor(BigtableGrpc.getSampleRowKeysMethod()) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract( - SampleRowKeysRequest sampleRowKeysRequest) { - return ImmutableMap.of( - "table_name", sampleRowKeysRequest.getTableName(), - "app_profile_id", sampleRowKeysRequest.getAppProfileId()); - } - }) - .build(), - settings.sampleRowKeysSettings().getRetryableCodes()); + 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> spoolable = base.all(); + UnaryCallable> + withStatsHeaders = new StatsHeadersUnaryCallable<>(spoolable); - UnaryCallable> withHeaderTracer = - new HeaderTracerUnaryCallable<>( - spoolable, settings.getHeaderTracer(), getSpanName(methodName).toString()); + UnaryCallable> + withAttemptTracer = new BigtableTracerUnaryCallable<>(withStatsHeaders); - UnaryCallable> retryable = - Callables.retrying(withHeaderTracer, settings.sampleRowKeysSettings(), clientContext); + UnaryCallable> + retryable = withRetries(withAttemptTracer, perOpSettings.sampleRowKeysSettings); return createUserFacingUnaryCallable( - methodName, new SampleRowKeysCallable(retryable, requestContext)); + methodName, + new SampleRowKeysCallableWithRequest(retryable, requestContext) + .withDefaultCallContext( + bigtableClientContext + .getClientContext() + .getDefaultCallContext() + .withRetrySettings(perOpSettings.sampleRowKeysSettings.getRetrySettings()))); } /** @@ -437,32 +600,14 @@ public Map extract( * */ private UnaryCallable createMutateRowCallable() { - String methodName = "MutateRow"; - UnaryCallable base = - GrpcRawCallableFactory.createUnaryCallable( - GrpcCallSettings.newBuilder() - .setMethodDescriptor(BigtableGrpc.getMutateRowMethod()) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(MutateRowRequest mutateRowRequest) { - return ImmutableMap.of( - "table_name", mutateRowRequest.getTableName(), - "app_profile_id", mutateRowRequest.getAppProfileId()); - } - }) - .build(), - settings.mutateRowSettings().getRetryableCodes()); - - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>( - base, settings.getHeaderTracer(), getSpanName(methodName).toString()); - - UnaryCallable retrying = - Callables.retrying(withHeaderTracer, settings.mutateRowSettings(), clientContext); - - return createUserFacingUnaryCallable( - methodName, new MutateRowCallable(retrying, requestContext)); + return createUnaryCallable( + BigtableGrpc.getMutateRowMethod(), + req -> + composeRequestParams( + req.getAppProfileId(), req.getTableName(), req.getAuthorizedViewName()), + perOpSettings.mutateRowSettings, + req -> req.toProto(requestContext), + resp -> null); } /** @@ -475,24 +620,96 @@ public Map extract(MutateRowRequest mutateRowRequest) { * 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}. + *
  • 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 createBulkMutateRowsCallable() { - UnaryCallable baseCallable = createMutateRowsBaseCallable(); + 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<>(); - UnaryCallable userFacing = - new BulkMutateRowsUserFacingCallable(baseCallable, requestContext); + 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 traced = - new TracedUnaryCallable<>(userFacing, clientContext.getTracerFactory(), spanName); - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>(traced, settings.getHeaderTracer(), spanName.toString()); - return withHeaderTracer.withDefaultCallContext(clientContext.getDefaultCallContext()); + UnaryCallable tracedBatcherUnaryCallable = + new TracedBatcherUnaryCallable<>(userFacing); + + UnaryCallable traced = + new TracedUnaryCallable<>( + tracedBatcherUnaryCallable, clientContext.getTracerFactory(), spanName); + + return traced.withDefaultCallContext( + clientContext + .getDefaultCallContext() + .withRetrySettings(perOpSettings.bulkMutateRowsSettings.getRetrySettings())); } /** @@ -513,14 +730,53 @@ private UnaryCallable createBulkMutateRowsCallable() { * com.google.cloud.bigtable.data.v2.models.MutateRowsException}. *

  • Split the responses using {@link MutateRowsBatchingDescriptor}. * + * + * @deprecated Please use {@link #newMutateRowsBatcher(TargetId, GrpcCallContext)} */ - public Batcher newMutateRowsBatcher(@Nonnull String tableId) { + @Deprecated + public Batcher newMutateRowsBatcher( + @Nonnull String tableId, @Nullable GrpcCallContext ctx) { return new BatcherImpl<>( - settings.bulkMutateRowsSettings().getBatchingDescriptor(), + perOpSettings.bulkMutateRowsSettings.getBatchingDescriptor(), bulkMutateRowsCallable, BulkMutation.create(tableId), - settings.bulkMutateRowsSettings().getBatchingSettings(), - clientContext.getExecutor()); + 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())); } /** @@ -538,131 +794,320 @@ public Batcher newMutateRowsBatcher(@Nonnull String tabl *
  • Split the responses using {@link ReadRowsBatchingDescriptor}. * */ - public Batcher newBulkReadRowsBatcher(@Nonnull Query query) { + public Batcher newBulkReadRowsBatcher( + @Nonnull Query query, @Nullable GrpcCallContext ctx) { Preconditions.checkNotNull(query, "query cannot be null"); return new BatcherImpl<>( - settings.bulkReadRowsSettings().getBatchingDescriptor(), - readRowsCallable().all(), + perOpSettings.bulkReadRowsSettings.getBatchingDescriptor(), + bulkReadRowsCallable, query, - settings.bulkReadRowsSettings().getBatchingSettings(), - clientContext.getExecutor()); + perOpSettings.bulkReadRowsSettings.getBatchingSettings(), + bigtableClientContext.getClientContext().getExecutor(), + null, + MoreObjects.firstNonNull( + ctx, bigtableClientContext.getClientContext().getDefaultCallContext())); } /** - * Internal helper to create the base MutateRows callable chain. The chain is responsible for - * retrying individual entry in case of error. + * Creates a callable chain to handle CheckAndMutateRow RPCs. THe chain will: * - *

    NOTE: the caller is responsible for adding tracing & metrics. + *

      + *
    • 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: * - * @see MutateRowsRetryingCallable for more details + *
      + *
    • Convert {@link ReadModifyWriteRow}s into {@link + * com.google.bigtable.v2.ReadModifyWriteRowRequest}s. + *
    • Convert the responses into {@link Row}. + *
    • Add tracing & metrics. + *
    */ - private UnaryCallable createMutateRowsBaseCallable() { - ServerStreamingCallable base = - GrpcRawCallableFactory.createServerStreamingCallable( - GrpcCallSettings.newBuilder() - .setMethodDescriptor(BigtableGrpc.getMutateRowsMethod()) - .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(MutateRowsRequest mutateRowsRequest) { - return ImmutableMap.of( - "table_name", mutateRowsRequest.getTableName(), - "app_profile_id", mutateRowsRequest.getAppProfileId()); - } - }) - .build(), - settings.bulkMutateRowsSettings().getRetryableCodes()); + 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())); + } - RetryAlgorithm retryAlgorithm = - new RetryAlgorithm<>( - new ApiResultRetryAlgorithm(), - new ExponentialRetryAlgorithm( - settings.bulkMutateRowsSettings().getRetrySettings(), clientContext.getClock())); - RetryingExecutorWithContext retryingExecutor = - new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + /** + * 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); - return new MutateRowsRetryingCallable( - clientContext.getDefaultCallContext(), - base, - retryingExecutor, - settings.bulkMutateRowsSettings().getRetryableCodes()); + 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 CheckAndMutateRow RPCs. THe chain will: + * Creates a callable chain to handle streaming ReadChangeStream RPCs. The chain will: * *
      - *
    • Convert {@link ConditionalRowMutation}s into {@link - * com.google.bigtable.v2.CheckAndMutateRowRequest}s. + *
    • 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. *
    */ - private UnaryCallable createCheckAndMutateRowCallable() { - String methodName = "CheckAndMutateRow"; - UnaryCallable base = - GrpcRawCallableFactory.createUnaryCallable( - GrpcCallSettings.newBuilder() - .setMethodDescriptor(BigtableGrpc.getCheckAndMutateRowMethod()) + public + ServerStreamingCallable + createReadChangeStreamCallable( + ChangeStreamRecordAdapter changeStreamRecordAdapter) { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getReadChangeStreamMethod()) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract( - CheckAndMutateRowRequest checkAndMutateRowRequest) { - return ImmutableMap.of( - "table_name", checkAndMutateRowRequest.getTableName(), - "app_profile_id", checkAndMutateRowRequest.getAppProfileId()); - } - }) + r -> composeRequestParams(r.getAppProfileId(), r.getTableName(), "")) .build(), - settings.checkAndMutateRowSettings().getRetryableCodes()); + 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(); - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>( - base, settings.getHeaderTracer(), getSpanName(methodName).toString()); + ServerStreamingCallable watched = + Callables.watched(merging, innerSettings, clientContext); - UnaryCallable retrying = - Callables.retrying(withHeaderTracer, settings.checkAndMutateRowSettings(), clientContext); + ServerStreamingCallable withAttemptTracer = + new BigtableTracerStreamingCallable<>(watched); - return createUserFacingUnaryCallable( - methodName, new CheckAndMutateRowCallable(retrying, requestContext)); + 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 ReadModifyWriteRow RPCs. The chain will: + * Creates a callable chain to handle streaming ExecuteQuery RPCs. The chain will: * *
      - *
    • Convert {@link ReadModifyWriteRow}s into {@link - * com.google.bigtable.v2.ReadModifyWriteRowRequest}s. - *
    • Convert the responses into {@link Row}. + *
    • 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} *
    */ - private UnaryCallable createReadModifyWriteRowCallable() { - UnaryCallable base = - GrpcRawCallableFactory.createUnaryCallable( - GrpcCallSettings.newBuilder() - .setMethodDescriptor(BigtableGrpc.getReadModifyWriteRowMethod()) + @InternalApi("For internal use only") + public ExecuteQueryCallable createExecuteQueryCallable() { + ClientContext clientContext = bigtableClientContext.getClientContext(); + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getExecuteQueryMethod()) .setParamsExtractor( - new RequestParamsExtractor() { + new RequestParamsExtractor() { @Override - public Map extract(ReadModifyWriteRowRequest request) { + public Map extract(ExecuteQueryRequest executeQueryRequest) { return ImmutableMap.of( - "table_name", request.getTableName(), - "app_profile_id", request.getAppProfileId()); + "name", executeQueryRequest.getInstanceName(), + "app_profile_id", executeQueryRequest.getAppProfileId()); } }) .build(), - settings.readModifyWriteRowSettings().getRetryableCodes()); - String methodName = "ReadModifyWriteRow"; - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>( - base, settings.getHeaderTracer(), getSpanName(methodName).toString()); + 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(); - UnaryCallable retrying = - Callables.retrying(withHeaderTracer, settings.readModifyWriteRowSettings(), clientContext); + // 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); - return createUserFacingUnaryCallable( - methodName, new ReadModifyWriteRowCallable(retrying, requestContext)); + 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); } /** @@ -673,10 +1118,104 @@ private UnaryCallable createUserFacin String methodName, UnaryCallable inner) { UnaryCallable traced = - new TracedUnaryCallable<>(inner, clientContext.getTracerFactory(), getSpanName(methodName)); + 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 traced.withDefaultCallContext(clientContext.getDefaultCallContext()); + 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); + } + // // @@ -685,24 +1224,40 @@ 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 #createBulkMutateRowsCallable()} ()} during stub + * Returns the callable chain created in {@link #createMutateRowsBaseCallable()} during stub * construction. */ public UnaryCallable bulkMutateRowsCallable() { + return externalBulkMutateRowsCallable; + } + + @InternalApi + public UnaryCallable internalBulkMutateRowsCallable() { return bulkMutateRowsCallable; } @@ -721,6 +1276,29 @@ public UnaryCallable checkAndMutateRowCallable( 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) { @@ -729,8 +1307,10 @@ private SpanName getSpanName(String methodName) { @Override public void close() { - for (BackgroundResource backgroundResource : clientContext.getBackgroundResources()) { - backgroundResource.shutdown(); + try { + bigtableClientContext.close(); + } catch (Exception e) { + throw new IllegalStateException("failed to close client context", e); } } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index eaea47f4ef..9a7944fbf3 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -16,12 +16,13 @@ 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.LimitExceededBehavior; -import com.google.api.gax.core.FixedCredentialsProvider; +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; @@ -30,28 +31,38 @@ import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.auth.Credentials; +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.stub.metrics.HeaderTracer; -import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor; -import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsBatchingDescriptor; +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 com.google.common.collect.ImmutableSet; +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.Set; -import java.util.logging.Logger; +import java.util.Optional; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.threeten.bp.Duration; /** @@ -76,65 +87,28 @@ * .setInstanceId("my-instance-id") * .setAppProfileId("default"); * - * settingsBuilder.readRowsSettings() + * settingsBuilder.stubSettings().readRowsSettings() * .setRetryableCodes(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); * * BigtableDataSettings settings = builder.build(); * } */ public class EnhancedBigtableStubSettings extends StubSettings { - private static final Logger logger = - Logger.getLogger(EnhancedBigtableStubSettings.class.getName()); - // 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 = ""; - private static final Set IDEMPOTENT_RETRY_CODES = - ImmutableSet.of(Code.DEADLINE_EXCEEDED, 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(Code.ABORTED).build(); - - private static final RetrySettings READ_ROWS_RETRY_SETTINGS = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(10)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMinutes(1)) - .setMaxAttempts(10) - .setJittered(true) - .setInitialRpcTimeout(Duration.ofMinutes(5)) - .setRpcTimeoutMultiplier(2.0) - .setMaxRpcTimeout(Duration.ofMinutes(5)) - .setTotalTimeout(Duration.ofHours(12)) - .build(); + // 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 final DirectPathConfig DIRECT_PATH_CONFIG = + Optional.ofNullable(System.getenv("CBT_ENABLE_DIRECTPATH")) + .map(Boolean::parseBoolean) + .map(b -> b ? DirectPathConfig.FORCED_ON : DirectPathConfig.FORCED_OFF) + .orElse(DirectPathConfig.DEFAULT); - 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(); + // 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")); /** * Scopes that are equivalent to JWT's audience. @@ -150,56 +124,50 @@ public class EnhancedBigtableStubSettings extends StubSettings primedTableIds; - private HeaderTracer headerTracer; - - private final ServerStreamingCallSettings readRowsSettings; - private final UnaryCallSettings readRowSettings; - private final UnaryCallSettings> sampleRowKeysSettings; - private final UnaryCallSettings mutateRowSettings; - private final BigtableBatchingCallSettings bulkMutateRowsSettings; - private final BigtableBulkReadRowsCallSettings bulkReadRowsSettings; - private final UnaryCallSettings checkAndMutateRowSettings; - private final UnaryCallSettings readModifyWriteRowSettings; + + 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 EnhancedBigtableStubSettings(Builder builder) { super(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"); - + directPathConfig = builder.directPathConfig; projectId = builder.projectId; instanceId = builder.instanceId; appProfileId = builder.appProfileId; isRefreshingChannel = builder.isRefreshingChannel; - primedTableIds = builder.primedTableIds; - headerTracer = builder.headerTracer; + metricsProvider = builder.metricsProvider; + metricsEndpoint = builder.metricsEndpoint; + areInternalMetricsEnabled = builder.areInternalMetricsEnabled; + jwtAudience = builder.jwtAudience; - // 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(); + perOpSettings = new ClientOperationSettings(builder.perOpSettings); + featureFlags = builder.featureFlags.build(); } /** Create a new builder. */ @@ -212,6 +180,11 @@ public String getProjectId() { return projectId; } + @InternalApi + public DirectPathConfig getDirectPathConfig() { + return this.directPathConfig; + } + /** Returns the target instance id. */ public String getInstanceId() { return instanceId; @@ -222,39 +195,108 @@ public String getAppProfileId() { return appProfileId; } - /** Returns if channels will gracefully refresh connections to Cloud Bigtable service */ - @BetaApi("This API depends on experimental gRPC APIs") + /** + * 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; } - /** Gets the tables that will be primed during a channel refresh. */ - @BetaApi("Channel priming is not currently stable and might change in the future") + /** + * @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 primedTableIds; + 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 tracer for capturing metrics in the header. */ - HeaderTracer getHeaderTracer() { - return headerTracer; + /** + * 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() { - return BigtableStubSettings.defaultGrpcTransportProviderBuilder() - .setPoolSize(getDefaultChannelPoolSize()) + 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 - // Attempts direct access to CBT service over gRPC to improve throughput, - // whether the attempt is allowed is totally controlled by service owner. - .setAttemptDirectPath(true); + Duration.ofSeconds(10)); // wait this long before considering the connection dead } - static int getDefaultChannelPoolSize() { - // TODO: tune channels - return 2 * Runtime.getRuntime().availableProcessors(); + /** 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") @@ -268,6 +310,11 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setJwtEnabledScopes(JWT_ENABLED_SCOPES); } + @Override + public String getServiceName() { + return "bigtable"; + } + /** * Returns the object with the settings used for calls to ReadRows. * @@ -277,21 +324,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde * *
      *
    • {@link ServerStreamingCallSettings.Builder#setIdleTimeout Default idle timeout} is set to - * 5 mins. + * 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 row} in a - * response stream is 5 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. + *
    • 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 readRowsSettings; + return perOpSettings.readRowsSettings; } /** @@ -308,13 +359,13 @@ public ServerStreamingCallSettings readRowsSettings() { * 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 + *
  • 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 sampleRowKeysSettings; + return perOpSettings.sampleRowKeysSettings; } /** @@ -339,7 +390,7 @@ public UnaryCallSettings> sampleRowKeysSettings() { * @see RetrySettings for more explanation. */ public UnaryCallSettings readRowSettings() { - return readRowSettings; + return perOpSettings.readRowSettings; } /** @@ -364,7 +415,7 @@ public UnaryCallSettings readRowSettings() { * @see RetrySettings for more explanation. */ public UnaryCallSettings mutateRowSettings() { - return mutateRowSettings; + return perOpSettings.mutateRowSettings; } /** @@ -400,18 +451,18 @@ public UnaryCallSettings mutateRowSettings() { * after batching initialization or last processed batch. * * - *

    When the pending {@link FlowControlSettings.Builder#setMaxOutstandingElementCount request - * count} reaches a default of 1000 entries per channel or their {@link - * FlowControlSettings.Builder#setMaxOutstandingRequestBytes accumulated size} reaches default - * value of 100MB, then this operation will by default be {@link - * FlowControlSettings.Builder#setLimitExceededBehavior blocked} until some of the pending batch - * are resolved. + *

    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 bulkMutateRowsSettings; + return perOpSettings.bulkMutateRowsSettings; } /** @@ -452,7 +503,7 @@ public BigtableBatchingCallSettings bulkMutateRowsSettings() { * @see BatchingSettings for batch related configuration explanation. */ public BigtableBulkReadRowsCallSettings bulkReadRowsSettings() { - return bulkReadRowsSettings; + return perOpSettings.bulkReadRowsSettings; } /** @@ -466,7 +517,7 @@ public BigtableBulkReadRowsCallSettings bulkReadRowsSettings() { * @see RetrySettings for more explanation. */ public UnaryCallSettings checkAndMutateRowSettings() { - return checkAndMutateRowSettings; + return perOpSettings.checkAndMutateRowSettings; } /** @@ -480,33 +531,80 @@ public UnaryCallSettings checkAndMutateRowSetti * @see RetrySettings for more explanation. */ public UnaryCallSettings readModifyWriteRowSettings() { - return 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 ImmutableList primedTableIds; - private HeaderTracer headerTracer; - - private final ServerStreamingCallSettings.Builder readRowsSettings; - private final UnaryCallSettings.Builder readRowSettings; - private final UnaryCallSettings.Builder> sampleRowKeysSettings; - private final UnaryCallSettings.Builder mutateRowSettings; - private final BigtableBatchingCallSettings.Builder bulkMutateRowsSettings; - private final BigtableBulkReadRowsCallSettings.Builder bulkReadRowsSettings; - private final UnaryCallSettings.Builder - checkAndMutateRowSettings; - private final UnaryCallSettings.Builder readModifyWriteRowSettings; + private String jwtAudience; + + 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. @@ -517,11 +615,15 @@ public static class Builder extends StubSettings.Builder headers = - ImmutableMap.builder() - .putAll( - BigtableStubSettings.defaultApiClientHeaderProviderBuilder().build().getHeaders()) - // GrpcHeaderInterceptor treats the `user-agent` as a magic string - .put("user-agent", "bigtable-java/" + Version.VERSION) - .build(); - setInternalHeaderProvider(FixedHeaderProvider.create(headers)); - - // Per-method settings using baseSettings for defaults. - readRowsSettings = ServerStreamingCallSettings.newBuilder(); - - readRowsSettings - .setRetryableCodes(READ_ROWS_RETRY_CODES) - .setRetrySettings(READ_ROWS_RETRY_SETTINGS) - .setIdleTimeout(Duration.ofMinutes(5)); - - // Point reads should use same defaults as streaming reads, but with a shorter timeout - readRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - readRowSettings - .setRetryableCodes(readRowsSettings.getRetryableCodes()) - .setRetrySettings( - readRowsSettings() - .getRetrySettings() - .toBuilder() - .setTotalTimeout(IDEMPOTENT_RETRY_SETTINGS.getTotalTimeout()) - .build()); - - sampleRowKeysSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - sampleRowKeysSettings - .setRetryableCodes(IDEMPOTENT_RETRY_CODES) - .setRetrySettings(IDEMPOTENT_RETRY_SETTINGS); - - mutateRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - copyRetrySettings(baseDefaults.mutateRowSettings(), mutateRowSettings); - - long maxBulkMutateElementPerBatch = 100L; - // Enables bulkMutate to support 10 outstanding batches upto per channel or up to 20K entries. - long maxBulkMutateOutstandingElementCount = - Math.min(20_000L, 10L * maxBulkMutateElementPerBatch * getDefaultChannelPoolSize()); - - 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(LimitExceededBehavior.Block) - .setMaxOutstandingRequestBytes(100L * 1024 * 1024) - .setMaxOutstandingElementCount(maxBulkMutateOutstandingElementCount) - .build()) - .build()); - - long maxBulkReadElementPerBatch = 100L; - long maxBulkReadRequestSizePerBatch = 400L * 1024L; - // Enables bulkRead to support 10 outstanding batches per channel - long maxBulkReadOutstandingElementCount = - 10L * maxBulkReadElementPerBatch * getDefaultChannelPoolSize(); - - 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(LimitExceededBehavior.Block) - .setMaxOutstandingElementCount(maxBulkReadOutstandingElementCount) - .build()) - .build()); - - checkAndMutateRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - copyRetrySettings(baseDefaults.checkAndMutateRowSettings(), checkAndMutateRowSettings); - - readModifyWriteRowSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - copyRetrySettings(baseDefaults.readModifyWriteRowSettings(), readModifyWriteRowSettings); + 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); } private Builder(EnhancedBigtableStubSettings settings) { @@ -626,31 +653,16 @@ private Builder(EnhancedBigtableStubSettings settings) { instanceId = settings.instanceId; appProfileId = settings.appProfileId; isRefreshingChannel = settings.isRefreshingChannel; - primedTableIds = settings.primedTableIds; - headerTracer = settings.headerTracer; + metricsProvider = settings.metricsProvider; + metricsEndpoint = settings.getMetricsEndpoint(); + areInternalMetricsEnabled = settings.areInternalMetricsEnabled; + jwtAudience = settings.jwtAudience; + this.directPathConfig = settings.getDirectPathConfig(); - // Per method 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(); - } - // + this.perOpSettings = new ClientOperationSettings.Builder(settings.perOpSettings); - /** - * 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()); + featureFlags = settings.featureFlags.toBuilder(); } - // // /** @@ -719,114 +731,288 @@ public String getAppProfileId() { /** * Sets if channels will gracefully refresh connections to Cloud Bigtable service. * - *

    When enabled, this will wait for the connection to complete the SSL handshake. The effect - * can be enhanced by configuring table ids that can be used warm serverside caches using {@link - * #setPrimedTableIds(String...)}. + *

    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. */ - @BetaApi("This API depends on experimental gRPC APIs") + @Deprecated public Builder setRefreshingChannel(boolean isRefreshingChannel) { this.isRefreshingChannel = isRefreshingChannel; return this; } - /** Configures which tables will be primed when a connection is created. */ - @BetaApi("Channel priming is not currently stable and might change in the future") + @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) { - this.primedTableIds = ImmutableList.copyOf(tableIds); return this; } - /** Gets if channels will gracefully refresh connections to Cloud Bigtable service */ - @BetaApi("This API depends on experimental gRPC APIs") + /** + * 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; } - /** Gets the tables that will be primed during a channel refresh. */ - @BetaApi("Channel priming is not currently stable and might change in the future") + /** + * @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 primedTableIds; + 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; } - /** Configure the header tracer for surfacing metrics in the header. */ - Builder setHeaderTracer(HeaderTracer headerTracer) { - this.headerTracer = headerTracer; + /** + * 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; } - /** Gets the header tracer that'll be used to surface metrics in the header. */ - HeaderTracer getHeaderTracer() { - return headerTracer; + /** + * 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 readRowsSettings; + return perOpSettings.readRowsSettings; } /** Returns the builder for the settings used for point reads using readRow. */ public UnaryCallSettings.Builder readRowSettings() { - return readRowSettings; + return perOpSettings.readRowSettings; } /** Returns the builder for the settings used for calls to SampleRowKeysSettings. */ public UnaryCallSettings.Builder> sampleRowKeysSettings() { - return sampleRowKeysSettings; + return perOpSettings.sampleRowKeysSettings; } /** Returns the builder for the settings used for calls to MutateRow. */ public UnaryCallSettings.Builder mutateRowSettings() { - return mutateRowSettings; + return perOpSettings.mutateRowSettings; } /** Returns the builder for the settings used for calls to MutateRows. */ public BigtableBatchingCallSettings.Builder bulkMutateRowsSettings() { - return bulkMutateRowsSettings; + return perOpSettings.bulkMutateRowsSettings; } /** Returns the builder for the settings used for calls to MutateRows. */ public BigtableBulkReadRowsCallSettings.Builder bulkReadRowsSettings() { - return bulkReadRowsSettings; + return perOpSettings.bulkReadRowsSettings; } /** Returns the builder for the settings used for calls to CheckAndMutateRow. */ public UnaryCallSettings.Builder checkAndMutateRowSettings() { - return checkAndMutateRowSettings; + return perOpSettings.checkAndMutateRowSettings; } /** Returns the builder with the settings used for calls to ReadModifyWriteRow. */ public UnaryCallSettings.Builder readModifyWriteRowSettings() { - return 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 (isRefreshingChannel) { - Preconditions.checkArgument( - getTransportChannelProvider() instanceof InstantiatingGrpcChannelProvider, - "refreshingChannel only works with InstantiatingGrpcChannelProviders"); - InstantiatingGrpcChannelProvider.Builder channelProviderBuilder = - ((InstantiatingGrpcChannelProvider) getTransportChannelProvider()).toBuilder(); - Credentials credentials = null; - if (getCredentialsProvider() != null) { - try { - credentials = getCredentialsProvider().getCredentials(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - // Use shared credentials - this.setCredentialsProvider(FixedCredentialsProvider.create(credentials)); - channelProviderBuilder.setChannelPrimer( - BigtableChannelPrimer.create( - credentials, projectId, instanceId, appProfileId, primedTableIds)); - this.setTransportChannelProvider(channelProviderBuilder.build()); + 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); } // @@ -839,16 +1025,12 @@ public String toString() { .add("instanceId", instanceId) .add("appProfileId", appProfileId) .add("isRefreshingChannel", isRefreshingChannel) - .add("primedTableIds", primedTableIds) - .add("headerTracer", headerTracer) - .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("perOpSettings", perOpSettings) + .add("metricsProvider", metricsProvider) + .add("metricsEndpoint", metricsEndpoint) + .add("areInternalMetricsEnabled", areInternalMetricsEnabled) + .add("jwtAudience", jwtAudience) + .add("directPathConfig", getDirectPathConfig().toString()) .add("parent", super.toString()) .toString(); } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java index 336518dd09..3e7bedaa9b 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java index 30771e20e4..65d822e8f5 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,27 +22,36 @@ 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.RequestParamsExtractor; +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.common.collect.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; -import java.util.Map; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -58,6 +67,7 @@ public class GrpcBigtableStub extends BigtableStub { .setFullMethodName("google.bigtable.v2.Bigtable/ReadRows") .setRequestMarshaller(ProtoUtils.marshaller(ReadRowsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ReadRowsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -69,6 +79,7 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(SampleRowKeysRequest.getDefaultInstance())) .setResponseMarshaller( ProtoUtils.marshaller(SampleRowKeysResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -78,6 +89,7 @@ public class GrpcBigtableStub extends BigtableStub { .setFullMethodName("google.bigtable.v2.Bigtable/MutateRow") .setRequestMarshaller(ProtoUtils.marshaller(MutateRowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(MutateRowResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -87,6 +99,7 @@ public class GrpcBigtableStub extends BigtableStub { .setFullMethodName("google.bigtable.v2.Bigtable/MutateRows") .setRequestMarshaller(ProtoUtils.marshaller(MutateRowsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(MutateRowsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) .build(); private static final MethodDescriptor @@ -98,6 +111,18 @@ public class GrpcBigtableStub extends BigtableStub { 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 @@ -109,6 +134,61 @@ public class GrpcBigtableStub extends BigtableStub { 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; @@ -118,13 +198,76 @@ public class GrpcBigtableStub extends BigtableStub { 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)); } @@ -164,52 +307,62 @@ protected GrpcBigtableStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(readRowsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ReadRowsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); - } + 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(); }) .build(); GrpcCallSettings sampleRowKeysTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(sampleRowKeysMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(SampleRowKeysRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); - } + 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(); }) .build(); GrpcCallSettings mutateRowTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(mutateRowMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(MutateRowRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); - } + 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(); }) .build(); GrpcCallSettings mutateRowsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(mutateRowsMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(MutateRowsRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); - } + 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(); }) .build(); GrpcCallSettings @@ -217,29 +370,108 @@ public Map extract(MutateRowsRequest request) { GrpcCallSettings.newBuilder() .setMethodDescriptor(checkAndMutateRowMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(CheckAndMutateRowRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); - } + 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(); }) .build(); + GrpcCallSettings pingAndWarmTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pingAndWarmMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "name", PING_AND_WARM_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", PING_AND_WARM_1_PATH_TEMPLATE); + return builder.build(); + }) + .build(); GrpcCallSettings readModifyWriteRowTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(readModifyWriteRowMethodDescriptor) .setParamsExtractor( - new RequestParamsExtractor() { - @Override - public Map extract(ReadModifyWriteRowRequest request) { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); - } + 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(); }) .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(); + }) + .build(); + GrpcCallSettings + readChangeStreamTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readChangeStreamMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("table_name", String.valueOf(request.getTableName())); + return builder.build(); + }) + .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(); + }) + .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(); + }) + .build(); this.readRowsCallable = callableFactory.createServerStreamingCallable( @@ -258,11 +490,28 @@ public Map extract(ReadModifyWriteRowRequest request) { 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()); @@ -299,15 +548,50 @@ public ServerStreamingCallable mutateRows 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() { - shutdown(); + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } } @Override diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MetadataExtractorInterceptor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MetadataExtractorInterceptor.java new file mode 100644 index 0000000000..abf4192cf8 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MetadataExtractorInterceptor.java @@ -0,0 +1,241 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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.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 ResponseParams responseParams; + @Nullable private volatile PeerInfo peerInfo; + @Nullable private volatile Duration gfeTiming; + @Nullable private volatile Util.IpProtocol ipProtocol; + private boolean isAlts = false; + + @Nullable + public ResponseParams getResponseParams() { + return responseParams; + } + + @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() { + responseParams = null; + peerInfo = null; + gfeTiming = null; + ipProtocol = Util.IpProtocol.UNKNOWN; + } + + void onResponseHeaders(Metadata md, Attributes attributes) { + responseParams = extractResponseParams(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 (responseParams == null) { + responseParams = extractResponseParams(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); + if (Strings.isNullOrEmpty(encodedStr)) { + return null; + } + + try { + byte[] decoded = Base64.getUrlDecoder().decode(encodedStr); + PeerInfo peerInfo = PeerInfo.parseFrom(decoded); + PeerInfo.TransportType effectiveTransport = peerInfo.getTransportType(); + + // 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 (effectiveTransport == PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN) { + boolean isAlts = AltsContextUtil.check(attributes); + if (isAlts) { + effectiveTransport = PeerInfo.TransportType.TRANSPORT_TYPE_DIRECT_ACCESS; + } else if (gfeTiming != null) { + effectiveTransport = PeerInfo.TransportType.TRANSPORT_TYPE_CLOUD_PATH; + } + } + if (effectiveTransport != PeerInfo.TransportType.TRANSPORT_TYPE_UNKNOWN) { + peerInfo = peerInfo.toBuilder().setTransportType(effectiveTransport).build(); + } + return peerInfo; + } catch (Exception e) { + throw new IllegalArgumentException( + "Failed to parse " + + PEER_INFO_KEY.name() + + " from the response header value: " + + encodedStr); + } + } + + @Nullable + private static ResponseParams extractResponseParams(Metadata metadata) { + byte[] responseParams = metadata.get(LOCATION_METADATA_KEY); + if (responseParams != null) { + try { + return ResponseParams.parseFrom(responseParams); + } catch (InvalidProtocolBufferException e) { + // Fail silently and return null + } + } + return null; + } + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallable.java deleted file mode 100644 index 36f47c2d1f..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallable.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.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.MutateRowRequest; -import com.google.bigtable.v2.MutateRowResponse; -import com.google.cloud.bigtable.data.v2.internal.RequestContext; -import com.google.cloud.bigtable.data.v2.models.RowMutation; -import com.google.common.util.concurrent.MoreExecutors; - -/** Simple wrapper for MutateRow to wrap the request and response protobufs. */ -class MutateRowCallable extends UnaryCallable { - private final UnaryCallable inner; - private final RequestContext requestContext; - - MutateRowCallable( - UnaryCallable inner, RequestContext requestContext) { - - this.inner = inner; - this.requestContext = requestContext; - } - - @Override - public ApiFuture futureCall(RowMutation request, ApiCallContext context) { - ApiFuture rawResponse = - inner.futureCall(request.toProto(requestContext), context); - - return ApiFutures.transform( - rawResponse, - new ApiFunction() { - @Override - public Void apply(MutateRowResponse mutateRowResponse) { - return null; - } - }, - MoreExecutors.directExecutor()); - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowsErrorConverterUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/MutateRowsErrorConverterUnaryCallable.java new file mode 100644 index 0000000000..2b118df61e --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimer.java new file mode 100644 index 0000000000..86c564bcc0 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java new file mode 100644 index 0000000000..121a581101 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallable.java deleted file mode 100644 index 09e133678e..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallable.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.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.ReadModifyWriteRowRequest; -import com.google.bigtable.v2.ReadModifyWriteRowResponse; -import com.google.cloud.bigtable.data.v2.internal.RequestContext; -import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; -import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; -import com.google.cloud.bigtable.data.v2.models.Row; -import com.google.common.util.concurrent.MoreExecutors; - -/** Simple wrapper for ReadModifyWriteRow to wrap the request and response protobufs. */ -class ReadModifyWriteRowCallable extends UnaryCallable { - private final UnaryCallable inner; - private final RequestContext requestContext; - private final DefaultRowAdapter rowAdapter; - - ReadModifyWriteRowCallable( - UnaryCallable inner, - RequestContext requestContext) { - this.inner = inner; - this.requestContext = requestContext; - this.rowAdapter = new DefaultRowAdapter(); - } - - @Override - public ApiFuture futureCall(ReadModifyWriteRow request, ApiCallContext context) { - ApiFuture rawResponse = - inner.futureCall(request.toProto(requestContext), context); - - return ApiFutures.transform( - rawResponse, - new ApiFunction() { - @Override - public Row apply(ReadModifyWriteRowResponse readModifyWriteRowResponse) { - return convertResponse(readModifyWriteRowResponse); - } - }, - MoreExecutors.directExecutor()); - } - - private Row convertResponse(ReadModifyWriteRowResponse response) { - return rowAdapter.createRowFromProto(response.getRow()); - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java new file mode 100644 index 0000000000..0133dd3c2b --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java similarity index 67% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java index 7658e41492..034a4048d0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java @@ -1,11 +1,11 @@ /* - * Copyright 2018 Google LLC + * 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 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * 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; @@ -20,22 +21,24 @@ 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.SampleRowKeysRequest; 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.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 SampleRowKeysCallable extends UnaryCallable> { +class SampleRowKeysCallableWithRequest + extends UnaryCallable> { private final RequestContext requestContext; - private final UnaryCallable> inner; + private final UnaryCallable< + com.google.bigtable.v2.SampleRowKeysRequest, List> + inner; - SampleRowKeysCallable( - UnaryCallable> inner, + SampleRowKeysCallableWithRequest( + UnaryCallable> inner, RequestContext requestContext) { this.requestContext = requestContext; @@ -43,18 +46,10 @@ class SampleRowKeysCallable extends UnaryCallable> { } @Override - public ApiFuture> futureCall(String tableId, ApiCallContext context) { - String tableName = - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), tableId); - - SampleRowKeysRequest request = - SampleRowKeysRequest.newBuilder() - .setTableName(tableName) - .setAppProfileId(requestContext.getAppProfileId()) - .build(); - - ApiFuture> rawResponse = inner.futureCall(request, context); + public ApiFuture> futureCall( + SampleRowKeysRequest request, ApiCallContext context) { + ApiFuture> rawResponse = + inner.futureCall(request.toProto(requestContext), context); return ApiFutures.transform( rawResponse, diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallable.java new file mode 100644 index 0000000000..29b104965e --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMerger.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMerger.java new file mode 100644 index 0000000000..30c6eb94b6 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallable.java new file mode 100644 index 0000000000..5c6c07451b --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachine.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachine.java new file mode 100644 index 0000000000..976992a255 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallable.java new file mode 100644 index 0000000000..ce07018c52 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamResumptionStrategy.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamResumptionStrategy.java new file mode 100644 index 0000000000..716e9eaf0c --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallable.java new file mode 100644 index 0000000000..0c78199ccd --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java new file mode 100644 index 0000000000..df27fbd842 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsView.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsView.java new file mode 100644 index 0000000000..2ec4fdfed4 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracer.java deleted file mode 100644 index 33bf9c42b9..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracer.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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.gax.tracing.ApiTracer; -import com.google.common.collect.ImmutableList; -import java.util.ArrayList; -import java.util.List; -import org.threeten.bp.Duration; - -/** Combines multiple {@link ApiTracer}s into a single {@link ApiTracer}. */ -class CompositeTracer implements ApiTracer { - private final List children; - - CompositeTracer(List children) { - this.children = ImmutableList.copyOf(children); - } - - @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 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) { - for (ApiTracer child : children) { - child.attemptStarted(attemptNumber); - } - } - - @Override - public void attemptSucceeded() { - for (ApiTracer child : children) { - child.attemptSucceeded(); - } - } - - @Override - public void attemptCancelled() { - for (ApiTracer child : children) { - child.attemptCancelled(); - } - } - - @Override - public void attemptFailed(Throwable error, Duration delay) { - for (ApiTracer child : children) { - child.attemptFailed(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); - } - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java new file mode 100644 index 0000000000..66041e8aca --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider.java new file mode 100644 index 0000000000..02cdf7c257 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracer.java deleted file mode 100644 index f3eb0ef1e2..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracer.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.InternalApi; -import com.google.auto.value.AutoValue; -import com.google.common.base.MoreObjects; -import io.grpc.Metadata; -import io.opencensus.stats.MeasureMap; -import io.opencensus.stats.Stats; -import io.opencensus.stats.StatsRecorder; -import io.opencensus.tags.TagContextBuilder; -import io.opencensus.tags.TagKey; -import io.opencensus.tags.TagValue; -import io.opencensus.tags.Tagger; -import io.opencensus.tags.Tags; -import java.util.Collections; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.annotation.Nonnull; - -@InternalApi -@AutoValue -public abstract class HeaderTracer { - - 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+)"); - - @AutoValue.Builder - public abstract static class Builder { - // - public abstract Builder setTagger(@Nonnull Tagger tagger); - - public abstract Builder setStats(@Nonnull StatsRecorder stats); - - public abstract Builder setStatsAttributes(@Nonnull Map statsAttributes); - - abstract HeaderTracer autoBuild(); - - public HeaderTracer build() { - HeaderTracer headerTracer = autoBuild(); - return headerTracer; - } - // - } - - public abstract Tagger getTagger(); - - public abstract StatsRecorder getStats(); - - public abstract Map getStatsAttributes(); - - /** - * If the header has a server-timing field, extract the metric and publish it to OpenCensus. - * Otherwise increment the gfe header missing counter by 1. - */ - public void recordGfeMetadata(@Nonnull Metadata metadata, @Nonnull String spanName) { - MeasureMap measures = getStats().newMeasureMap(); - if (metadata.get(SERVER_TIMING_HEADER_KEY) != null) { - String serverTiming = metadata.get(SERVER_TIMING_HEADER_KEY); - Matcher matcher = SERVER_TIMING_HEADER_PATTERN.matcher(serverTiming); - measures.put(RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT, 0L); - if (matcher.find()) { - long latency = Long.valueOf(matcher.group("dur")); - measures.put(RpcMeasureConstants.BIGTABLE_GFE_LATENCY, latency); - } - } else { - measures.put(RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT, 1L); - } - measures.record(newTagCtxBuilder(spanName).build()); - } - - public void recordGfeMissingHeader(@Nonnull String spanName) { - MeasureMap measures = - getStats().newMeasureMap().put(RpcMeasureConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT, 1L); - measures.record(newTagCtxBuilder(spanName).build()); - } - - private TagContextBuilder newTagCtxBuilder(String span) { - TagContextBuilder tagContextBuilder = getTagger().currentBuilder(); - if (span != null) { - tagContextBuilder.putLocal(RpcMeasureConstants.BIGTABLE_OP, TagValue.create(span)); - } - // Copy client level tags in - for (Map.Entry entry : getStatsAttributes().entrySet()) { - tagContextBuilder.putLocal(entry.getKey(), entry.getValue()); - } - return tagContextBuilder; - } - - public static Builder newBuilder() { - return new AutoValue_HeaderTracer.Builder() - .setTagger(Tags.getTagger()) - .setStats(Stats.getStatsRecorder()) - .setStatsAttributes(Collections.emptyMap()); - } - - public abstract Builder toBuilder(); - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("stats", getStats()) - .add("tagger", getTagger()) - .add("statsAttributes", getStatsAttributes()) - .toString(); - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable.java deleted file mode 100644 index fdca9297aa..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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.InternalApi; -import com.google.api.gax.grpc.GrpcResponseMetadata; -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.common.base.Preconditions; -import io.grpc.Metadata; -import javax.annotation.Nonnull; - -/** - * This callable will inject a {@link GrpcResponseMetadata} to access the headers and trailers - * returned by gRPC methods upon completion. The {@link HeaderTracer} will process metrics that were - * injected in the header/trailer and publish them to OpenCensus. If {@link - * GrpcResponseMetadata#getMetadata()} returned null, it probably means that the request has never - * reached GFE, and it'll increment the gfe_header_missing_counter in this case. - * - *

    If GFE metrics are not registered in {@link RpcViews}, skip injecting GrpcResponseMetadata. - * This is for the case where direct path is enabled, all the requests won't go through GFE and - * therefore won't have the server-timing header. - * - *

    This class is considered an internal implementation detail and not meant to be used by - * applications. - */ -@InternalApi -public class HeaderTracerStreamingCallable - extends ServerStreamingCallable { - - private final ServerStreamingCallable innerCallable; - private final HeaderTracer headerTracer; - private final String spanName; - - public HeaderTracerStreamingCallable( - @Nonnull ServerStreamingCallable callable, - @Nonnull HeaderTracer headerTracer, - @Nonnull String spanName) { - this.innerCallable = Preconditions.checkNotNull(callable, "Inner callable must be set"); - this.headerTracer = Preconditions.checkNotNull(headerTracer, "HeaderTracer must be set"); - this.spanName = Preconditions.checkNotNull(spanName, "Span name must be set"); - } - - @Override - public void call( - RequestT request, ResponseObserver responseObserver, ApiCallContext context) { - final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); - if (RpcViews.isGfeMetricsRegistered()) { - HeaderTracerResponseObserver innerObserver = - new HeaderTracerResponseObserver<>( - responseObserver, headerTracer, responseMetadata, spanName); - innerCallable.call(request, innerObserver, responseMetadata.addHandlers(context)); - } else { - innerCallable.call(request, responseObserver, context); - } - } - - private class HeaderTracerResponseObserver implements ResponseObserver { - - private ResponseObserver outerObserver; - private HeaderTracer headerTracer; - private GrpcResponseMetadata responseMetadata; - private String spanName; - - HeaderTracerResponseObserver( - ResponseObserver observer, - HeaderTracer headerTracer, - GrpcResponseMetadata metadata, - String spanName) { - this.outerObserver = observer; - this.headerTracer = headerTracer; - this.responseMetadata = metadata; - this.spanName = spanName; - } - - @Override - public void onStart(final StreamController controller) { - outerObserver.onStart(controller); - } - - @Override - public void onResponse(ResponseT response) { - outerObserver.onResponse(response); - } - - @Override - public void onError(Throwable t) { - // server-timing metric will be added through GrpcResponseMetadata#onHeaders(Metadata), - // so it's not checking trailing metadata here. - Metadata metadata = responseMetadata.getMetadata(); - if (metadata != null) { - headerTracer.recordGfeMetadata(metadata, spanName); - } else { - headerTracer.recordGfeMissingHeader(spanName); - } - outerObserver.onError(t); - } - - @Override - public void onComplete() { - Metadata metadata = responseMetadata.getMetadata(); - if (metadata != null) { - headerTracer.recordGfeMetadata(metadata, spanName); - } else { - headerTracer.recordGfeMissingHeader(spanName); - } - outerObserver.onComplete(); - } - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable.java deleted file mode 100644 index 17d84b2a2e..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.ApiFuture; -import com.google.api.core.InternalApi; -import com.google.api.gax.grpc.GrpcResponseMetadata; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.common.base.Preconditions; -import com.google.common.util.concurrent.MoreExecutors; -import io.grpc.Metadata; -import javax.annotation.Nonnull; - -/** - * This callable will inject a {@link GrpcResponseMetadata} to access the headers and trailers - * returned by gRPC methods upon completion. The {@link HeaderTracer} will process metrics that were - * injected in the header/trailer and publish them to OpenCensus. If {@link - * GrpcResponseMetadata#getMetadata()} returned null, it probably means that the request has never - * reached GFE, and it'll increment the gfe_header_missing_counter in this case. - * - *

    If GFE metrics are not registered in {@link RpcViews}, skip injecting GrpcResponseMetadata. - * This is for the case where direct path is enabled, all the requests won't go through GFE and - * therefore won't have the server-timing header. - * - *

    This class is considered an internal implementation detail and not meant to be used by - * applications. - */ -@InternalApi -public class HeaderTracerUnaryCallable - extends UnaryCallable { - - private final UnaryCallable innerCallable; - private final HeaderTracer headerTracer; - private final String spanName; - - public HeaderTracerUnaryCallable( - @Nonnull UnaryCallable innerCallable, - @Nonnull HeaderTracer headerTracer, - @Nonnull String spanName) { - this.innerCallable = Preconditions.checkNotNull(innerCallable, "Inner callable must be set"); - this.headerTracer = Preconditions.checkNotNull(headerTracer, "HeaderTracer must be set"); - this.spanName = Preconditions.checkNotNull(spanName, "Span name must be set"); - } - - @Override - public ApiFuture futureCall(RequestT request, ApiCallContext context) { - if (RpcViews.isGfeMetricsRegistered()) { - final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); - ApiFuture future = - innerCallable.futureCall(request, responseMetadata.addHandlers(context)); - future.addListener( - new Runnable() { - @Override - public void run() { - Metadata metadata = responseMetadata.getMetadata(); - if (metadata != null) { - headerTracer.recordGfeMetadata(metadata, spanName); - } else { - headerTracer.recordGfeMissingHeader(spanName); - } - } - }, - MoreExecutors.directExecutor()); - return future; - } else { - return innerCallable.futureCall(request, context); - } - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsProvider.java new file mode 100644 index 0000000000..251bb41619 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/NoopMetricsProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/NoopMetricsProvider.java new file mode 100644 index 0000000000..66d0dfdcae --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java index 9e8f6084a2..c4948a20bf 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/RpcViews.java @@ -15,29 +15,15 @@ */ package com.google.cloud.bigtable.data.v2.stub.metrics; -import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.cloud.bigtable.data.v2.internal.csm.opencensus.RpcViewConstants; import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.ImmutableSet; import io.opencensus.stats.Stats; import io.opencensus.stats.View; import io.opencensus.stats.ViewManager; -@BetaApi +@Deprecated public class RpcViews { - @VisibleForTesting - private 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); - - private static final ImmutableSet GFE_VIEW_SET = - ImmutableSet.of( - RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, - RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW); - private static boolean gfeMetricsRegistered = false; /** Registers all Bigtable specific views. */ @@ -55,16 +41,18 @@ public static void registerBigtableClientGfeViews() { registerBigtableClientGfeViews(Stats.getViewManager()); } + @InternalApi @VisibleForTesting - static void registerBigtableClientViews(ViewManager viewManager) { - for (View view : BIGTABLE_CLIENT_VIEWS_SET) { + public static void registerBigtableClientViews(ViewManager viewManager) { + for (View view : RpcViewConstants.BIGTABLE_CLIENT_VIEWS_SET) { viewManager.registerView(view); } } + @InternalApi @VisibleForTesting - static void registerBigtableClientGfeViews(ViewManager viewManager) { - for (View view : GFE_VIEW_SET) { + public static void registerBigtableClientGfeViews(ViewManager viewManager) { + for (View view : RpcViewConstants.GFE_VIEW_SET) { viewManager.registerView(view); } gfeMetricsRegistered = true; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersServerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersServerStreamingCallable.java new file mode 100644 index 0000000000..edc794c230 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersUnaryCallable.java new file mode 100644 index 0000000000..1e7b67a6fb --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java index ff40aca387..a5e3ebea68 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java @@ -15,60 +15,38 @@ */ package com.google.cloud.bigtable.data.v2.stub.metrics; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StatusCode.Code; -import io.grpc.Status; -import io.grpc.StatusException; -import io.grpc.StatusRuntimeException; -import io.opencensus.tags.TagValue; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import javax.annotation.Nullable; +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. */ -class Util { - private static final TagValue OK_STATUS = TagValue.create(StatusCode.Code.OK.toString()); - - /** Convert an exception into a value that can be used as an OpenCensus tag value. */ - static TagValue extractStatus(@Nullable Throwable error) { - final String statusString; - - if (error == null) { - return OK_STATUS; - } else if (error instanceof CancellationException) { - statusString = Status.Code.CANCELLED.toString(); - } else if (error instanceof ApiException) { - statusString = ((ApiException) error).getStatusCode().getCode().toString(); - } else if (error instanceof StatusRuntimeException) { - statusString = ((StatusRuntimeException) error).getStatus().getCode().toString(); - } else if (error instanceof StatusException) { - statusString = ((StatusException) error).getStatus().getCode().toString(); - } else { - statusString = Code.UNKNOWN.toString(); - } - - return TagValue.create(statusString); - } +@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); /** - * Await the result of the future and convert it into a value that can be used as an OpenCensus - * tag value. + * Add attempt number and client timestamp from api call context to request headers. Attempt + * number starts from 0. */ - static TagValue extractStatus(Future future) { - Throwable error = null; - - try { - future.get(); - } catch (InterruptedException e) { - error = e; - Thread.currentThread().interrupt(); - } catch (ExecutionException e) { - error = e.getCause(); - } catch (RuntimeException e) { - error = e; + 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 extractStatus(error); + return headers.build(); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java index 8048cceaad..94980a80a2 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/BulkMutateRowsUserFacingCallable.java @@ -30,18 +30,22 @@ * applications. */ @InternalApi -public final class BulkMutateRowsUserFacingCallable extends UnaryCallable { - private final UnaryCallable innerCallable; +public final class BulkMutateRowsUserFacingCallable + extends UnaryCallable { + + private final UnaryCallable innerCallable; private final RequestContext requestContext; public BulkMutateRowsUserFacingCallable( - UnaryCallable innerCallable, RequestContext requestContext) { + UnaryCallable innerCallable, + RequestContext requestContext) { this.innerCallable = innerCallable; this.requestContext = requestContext; } @Override - public ApiFuture futureCall(BulkMutation request, ApiCallContext context) { + public ApiFuture futureCall( + BulkMutation request, ApiCallContext context) { return innerCallable.futureCall(request.toProto(requestContext), context); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java index e85270f619..4796ad48a0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallable.java @@ -19,14 +19,15 @@ 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.MutateRowsRequest.Builder; import com.google.bigtable.v2.MutateRowsResponse; import com.google.bigtable.v2.MutateRowsResponse.Entry; import com.google.cloud.bigtable.data.v2.models.MutateRowsException; @@ -35,8 +36,8 @@ 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 com.google.rpc.Code; import java.util.List; import java.util.Set; import java.util.concurrent.Callable; @@ -84,13 +85,13 @@ * *

    Package-private for internal use. */ -class MutateRowsAttemptCallable implements Callable { +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 Code getCode() { + public StatusCode.Code getCode() { return Code.UNKNOWN; } @@ -108,20 +109,22 @@ public Object getTransportCode() { // Everything needed to build a retry request @Nullable private List originalIndexes; @Nonnull private final Set retryableCodes; - @Nullable private final List permanentFailures; + @Nonnull private final List permanentFailures; + @Nonnull private final RetryAlgorithm retryAlgorithm; + @Nonnull private TimedAttemptSettings attemptSettings; // Parent controller - private RetryingFuture externalFuture; + private RetryingFuture externalFuture; // Simple wrappers for handling result futures - private final ApiFunction, Void> attemptSuccessfulCallback = - new ApiFunction, Void>() { - @Override - public Void apply(List responses) { - handleAttemptSuccess(responses); - return null; - } - }; + private final ApiFunction, MutateRowsAttemptResult> + attemptSuccessfulCallback = + new ApiFunction, MutateRowsAttemptResult>() { + @Override + public MutateRowsAttemptResult apply(List responses) { + return handleAttemptSuccess(responses); + } + }; private final ApiFunction> attemptFailedCallback = new ApiFunction>() { @@ -136,16 +139,20 @@ public List apply(Throwable throwable) { @Nonnull UnaryCallable> innerCallable, @Nonnull MutateRowsRequest originalRequest, @Nonnull ApiCallContext callContext, - @Nonnull Set retryableCodes) { + @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) { + public void setExternalFuture(RetryingFuture externalFuture) { this.externalFuture = externalFuture; } @@ -158,7 +165,7 @@ public void setExternalFuture(RetryingFuture externalFuture) { * return of this method should just be ignored. */ @Override - public Void call() { + public MutateRowsAttemptResult call() { try { // externalFuture is set from MutateRowsRetryingCallable before invoking this method. It // shouldn't be null unless the code changed @@ -169,20 +176,22 @@ public Void call() { // variables in ApiTracer and avoid exceptions when the tracer marks the attempt as finished callContext .getTracer() - .attemptStarted(externalFuture.getAttemptSettings().getOverallAttemptCount()); + .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 (!externalFuture.getAttemptSettings().getRpcTimeout().isZero()) { + if (currentCallContext.getTimeout() == null + && !externalFuture.getAttemptSettings().getRpcTimeout().isZero()) { currentCallContext = currentCallContext.withTimeout(externalFuture.getAttemptSettings().getRpcTimeout()); } // Handle concurrent cancellation - externalFuture.setAttemptFuture(new NonCancellableFuture()); + externalFuture.setAttemptFuture(new NonCancellableFuture<>()); if (externalFuture.isDone()) { return null; } @@ -198,13 +207,13 @@ public Void call() { // Inspect the results and either propagate the success, or prepare to retry the failed // mutations - ApiFuture transformed = + 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)); + externalFuture.setAttemptFuture(ApiFutures.immediateFailedFuture(e)); } return null; @@ -223,16 +232,18 @@ private void handleAttemptError(Throwable rpcError) { allFailures.addAll(permanentFailures); - Builder builder = lastRequest.toBuilder().clearEntries(); + 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 (!failedMutation.getError().isRetryable()) { + 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 @@ -245,7 +256,8 @@ private void handleAttemptError(Throwable rpcError) { currentRequest = builder.build(); originalIndexes = newOriginalIndexes; - throw new MutateRowsException(rpcError, allFailures.build(), entryError.isRetryable()); + throw MutateRowsException.create( + rpcError, entryError.getStatusCode(), allFailures.build(), builder.getEntriesCount() > 0); } /** @@ -253,18 +265,21 @@ private void handleAttemptError(Throwable rpcError) { * 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. + * completed. We don't currently handle RetryInfo on entry level failures. */ - private void handleAttemptSuccess(List responses) { + private MutateRowsAttemptResult handleAttemptSuccess(List responses) { List allFailures = Lists.newArrayList(permanentFailures); MutateRowsRequest lastRequest = currentRequest; - Builder builder = lastRequest.toBuilder().clearEntries(); + 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()) { - if (entry.getStatus().getCode() == Code.OK_VALUE) { + seenIndices[Ints.checkedCast(entry.getIndex())] = true; + + if (entry.getStatus().getCode() == com.google.rpc.Code.OK_VALUE) { continue; } @@ -286,13 +301,34 @@ private void handleAttemptSuccess(List responses) { } } + // 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; - throw new MutateRowsException(null, allFailures, isRetryable); + return MutateRowsAttemptResult.create(allFailures, isRetryable); } + return MutateRowsAttemptResult.success(); } /** @@ -326,10 +362,10 @@ private static ApiException createSyntheticErrorForRpcFailure(Throwable overallR ApiException requestApiException = (ApiException) overallRequestError; return ApiExceptionFactory.createException( - "Didn't receive a result for this mutation entry", overallRequestError, requestApiException.getStatusCode(), - requestApiException.isRetryable()); + requestApiException.isRetryable(), + requestApiException.getErrorDetails()); } return ApiExceptionFactory.createException( diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptResult.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptResult.java new file mode 100644 index 0000000000..d668c2a50f --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchResource.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchResource.java new file mode 100644 index 0000000000..2702dcf642 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java index a3ec50bc2d..87f5c88d3e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptor.java @@ -17,6 +17,7 @@ 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; @@ -36,7 +37,7 @@ */ @InternalApi("For internal use only") public class MutateRowsBatchingDescriptor - implements BatchingDescriptor { + implements BatchingDescriptor { @Override public BatchingRequestBuilder newRequestBuilder( @@ -45,7 +46,15 @@ public BatchingRequestBuilder newRequestBuilder( } @Override - public void splitResponse(Void response, List> entries) { + 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); } @@ -90,6 +99,17 @@ 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}. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsPartialErrorRetryAlgorithm.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsPartialErrorRetryAlgorithm.java new file mode 100644 index 0000000000..9c7035db96 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java index ff0daf78bb..354a5ea54a 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryingCallable.java @@ -16,6 +16,7 @@ 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; @@ -39,30 +40,36 @@ * @see MutateRowsAttemptCallable for more details. */ @InternalApi -public class MutateRowsRetryingCallable extends UnaryCallable { +public class MutateRowsRetryingCallable + extends UnaryCallable { private final ApiCallContext callContextPrototype; private final ServerStreamingCallable callable; - private final RetryingExecutorWithContext executor; + 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 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) { + public RetryingFuture futureCall( + MutateRowsRequest request, ApiCallContext inputContext) { ApiCallContext context = callContextPrototype.nullToSelf(inputContext); MutateRowsAttemptCallable retryCallable = - new MutateRowsAttemptCallable(callable.all(), request, context, retryCodes); + new MutateRowsAttemptCallable(callable.all(), request, context, retryCodes, retryAlgorithm); - RetryingFuture retryingFuture = executor.createFuture(retryCallable, context); + RetryingFuture retryingFuture = + executor.createFuture(retryCallable, context); retryCallable.setExternalFuture(retryingFuture); retryCallable.call(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java index 57f987fb7c..181006b6c3 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/FilterMarkerRowsCallable.java @@ -22,6 +22,7 @@ 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}. @@ -47,17 +48,18 @@ public void call( innerCallable.call(request, innerObserver, context); } - private class FilteringResponseObserver implements ResponseObserver { + 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 - public void onStart(final StreamController controller) { + protected void onStartImpl(final StreamController controller) { innerController = controller; outerObserver.onStart( @@ -81,7 +83,7 @@ public void request(int count) { } @Override - public void onResponse(RowT response) { + protected void onResponseImpl(RowT response) { if (rowAdapter.isScanMarkerRow(response)) { if (!autoFlowControl) { innerController.request(1); @@ -92,12 +94,12 @@ public void onResponse(RowT response) { } @Override - public void onError(Throwable t) { + protected void onErrorImpl(Throwable t) { outerObserver.onError(t); } @Override - public void onComplete() { + protected void onCompleteImpl() { outerObserver.onComplete(); } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/LargeReadRowsResumptionStrategy.java new file mode 100644 index 0000000000..93b6b548dd --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable.java deleted file mode 100644 index 69dd2b5b8a..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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.readrows; - -import com.google.api.core.InternalApi; -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; - -/** - * This callable converts the "Received rst stream" exception into a retryable {@link ApiException}. - */ -@InternalApi -public final class ReadRowsConvertExceptionCallable - extends ServerStreamingCallable { - - private final ServerStreamingCallable innerCallable; - - public ReadRowsConvertExceptionCallable( - ServerStreamingCallable innerCallable) { - this.innerCallable = innerCallable; - } - - @Override - public void call( - ReadRowsRequest request, ResponseObserver responseObserver, ApiCallContext context) { - ReadRowsConvertExceptionResponseObserver observer = - new ReadRowsConvertExceptionResponseObserver<>(responseObserver); - innerCallable.call(request, observer, context); - } - - private class ReadRowsConvertExceptionResponseObserver implements ResponseObserver { - - private final ResponseObserver outerObserver; - - ReadRowsConvertExceptionResponseObserver(ResponseObserver outerObserver) { - this.outerObserver = outerObserver; - } - - @Override - public void onStart(StreamController controller) { - outerObserver.onStart(controller); - } - - @Override - public void onResponse(RowT response) { - outerObserver.onResponse(response); - } - - @Override - public void onError(Throwable t) { - outerObserver.onError(convertException(t)); - } - - @Override - public void onComplete() { - outerObserver.onComplete(); - } - } - - private Throwable convertException(Throwable t) { - // Long lived connections sometimes are disconnected via an RST frame. This error is - // transient and should be retried. - if (t instanceof InternalException) { - if (t.getMessage() != null && t.getMessage().contains("Received Rst stream")) { - return new InternalException(t, ((InternalException) t).getStatusCode(), true); - } - } - return t; - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallable.java deleted file mode 100644 index c2584e0c93..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.ApiFuture; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.bigtable.data.v2.models.Query; - -/** - * Enhancement for `readRowsCallable().first()` to gracefully limit the row count instead of - * cancelling the RPC - */ -class ReadRowsFirstCallable extends UnaryCallable { - private final UnaryCallable inner; - - ReadRowsFirstCallable(UnaryCallable inner) { - this.inner = inner; - } - - @Override - public ApiFuture futureCall(Query query, ApiCallContext context) { - return inner.futureCall(query.limit(1), context); - } -} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java index ab312ec41c..de5ef19cb1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsResumptionStrategy.java @@ -18,24 +18,24 @@ import com.google.api.core.InternalApi; import com.google.api.gax.retrying.StreamResumptionStrategy; import com.google.bigtable.v2.ReadRowsRequest; -import com.google.bigtable.v2.ReadRowsRequest.Builder; 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 StreamResumptionStrategy} 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. + * 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 - implements StreamResumptionStrategy { + extends BigtableStreamResumptionStrategy { private final RowAdapter rowAdapter; private ByteString lastKey = ByteString.EMPTY; // Number of rows processed excluding Marker row. @@ -69,6 +69,12 @@ public RowT processResponse(RowT response) { return response; } + @Override + public Throwable processError(Throwable throwable) { + // Noop + return throwable; + } + /** * {@inheritDoc} * @@ -85,7 +91,8 @@ public ReadRowsRequest getResumeRequest(ReadRowsRequest originalRequest) { return originalRequest; } - RowSet remaining = RowSetUtil.split(originalRequest.getRows(), lastKey).getRight(); + 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 @@ -97,7 +104,7 @@ public ReadRowsRequest getResumeRequest(ReadRowsRequest originalRequest) { return ReadRowsRetryCompletedCallable.FULFILLED_REQUEST_MARKER; } - Builder builder = originalRequest.toBuilder().setRows(remaining); + ReadRowsRequest.Builder builder = originalRequest.toBuilder().setRows(remaining); if (originalRequest.getRowsLimit() > 0) { Preconditions.checkState( diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java index 6c698a51ca..c25eb4e015 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryCompletedCallable.java @@ -48,6 +48,7 @@ public ReadRowsRetryCompletedCallable(ServerStreamingCallable responseObserver, ApiCallContext context) { diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java index 94ced791c5..3f1db6d0d8 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallable.java @@ -19,7 +19,6 @@ 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.UnaryCallable; import com.google.bigtable.v2.ReadRowsRequest; import com.google.cloud.bigtable.data.v2.internal.RequestContext; import com.google.cloud.bigtable.data.v2.models.Query; @@ -34,14 +33,11 @@ public class ReadRowsUserCallable extends ServerStreamingCallable { private final ServerStreamingCallable inner; private final RequestContext requestContext; - private final ReadRowsFirstCallable firstCallable; public ReadRowsUserCallable( ServerStreamingCallable inner, RequestContext requestContext) { this.inner = inner; this.requestContext = requestContext; - - this.firstCallable = new ReadRowsFirstCallable<>(super.first()); } @Override @@ -49,12 +45,4 @@ public void call(Query request, ResponseObserver responseObserver, ApiCall ReadRowsRequest innerRequest = request.toProto(requestContext); inner.call(innerRequest, responseObserver, context); } - - // Optimization: since the server supports row limits, override the first callable. - // This way unnecessary data doesn't need to be buffered and the number of CANCELLED request - // statuses is minimized - @Override - public UnaryCallable first() { - return firstCallable; - } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java index dcb7347dda..54edf57a31 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMerger.java @@ -20,13 +20,14 @@ 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 - * com.google.bigtable.v2.ReadRowsResponse.CellChunk}s into this class and pops fully merged logical - * rows. Example usage: + * ReadRowsResponse.CellChunk}s into this class and pops fully merged logical rows. Example usage: * *

    {@code
      * RowMerger rowMerger = new RowMerger<>(myRowBuilder);
    @@ -58,81 +59,47 @@
     @InternalApi
     public class RowMerger implements Reframer {
       private final StateMachine stateMachine;
    -  private ReadRowsResponse buffer;
    -  private int nextChunk;
    -  private RowT nextRow;
    +  private Queue mergedRows;
     
    -  public RowMerger(RowBuilder rowBuilder) {
    -    stateMachine = new StateMachine<>(rowBuilder);
    -
    -    nextChunk = 0;
    -    buffer = ReadRowsResponse.getDefaultInstance();
    +  public RowMerger(RowBuilder rowBuilder, boolean reversed) {
    +    stateMachine = new StateMachine<>(rowBuilder, reversed);
    +    mergedRows = new ArrayDeque<>();
       }
     
       @Override
       public void push(ReadRowsResponse response) {
    -    Preconditions.checkState(
    -        buffer.getChunksCount() <= nextChunk, "Previous response not fully consumed");
    -
    -    buffer = response;
    -    nextChunk = 0;
    -
         // 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() {
    -    // Check if there an assembled row to consume
    -    if (nextRow != null) {
    -      return true;
    -    }
    -
    -    // Otherwise try to assemble a new row (readNextRow will set nextRow)
    -    boolean newRowCompleted = readNextRow();
    -    return newRowCompleted;
    +    return !mergedRows.isEmpty();
       }
     
       @Override
       public boolean hasPartialFrame() {
    -    // Check if any of the buffers in this class contain data.
    -    // `hasFullFrame()` will check if `nextRow` has a row ready to go or if chunks in `buffer` can
    -    // be used to create a new `nextRow`
    -    if (hasFullFrame()) {
    -      return true;
    -    }
    -
    -    // 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 stateMachine.isRowInProgress();
    +    // 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() {
    -    RowT row = nextRow;
    -    nextRow = null;
    -    return row;
    -  }
    -
    -  private boolean readNextRow() {
    -    // StateMachine might have a complete row already from receiving a scan marker.
    -    if (stateMachine.hasCompleteRow()) {
    -      nextRow = stateMachine.consumeRow();
    -      return true;
    -    }
    -
    -    while (nextChunk < buffer.getChunksCount()) {
    -      stateMachine.handleChunk(buffer.getChunks(nextChunk++));
    -
    -      if (stateMachine.hasCompleteRow()) {
    -        nextRow = stateMachine.consumeRow();
    -        return true;
    -      }
    -    }
    -    return false;
    +    return Preconditions.checkNotNull(
    +        mergedRows.poll(), "RowMerger.pop() called when there are no rows");
       }
     }
    diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java
    index 04814dd781..6f48166200 100644
    --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java
    +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallable.java
    @@ -49,7 +49,7 @@ public RowMergingCallable(
       public void call(
           ReadRowsRequest request, ResponseObserver responseObserver, ApiCallContext context) {
         RowBuilder rowBuilder = rowAdapter.createRowBuilder();
    -    RowMerger merger = new RowMerger<>(rowBuilder);
    +    RowMerger merger = new RowMerger<>(rowBuilder, request.getReversed());
         ReframingResponseObserver innerObserver =
             new ReframingResponseObserver<>(responseObserver, merger);
         inner.call(request, innerObserver, context);
    diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java
    index b6b6db678f..9a6d1007a9 100644
    --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java
    +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java
    @@ -15,6 +15,8 @@
      */
     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;
    @@ -22,6 +24,7 @@
     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;
     
     /**
    @@ -76,6 +79,7 @@
      */
     final class StateMachine {
       private final RowBuilder adapter;
    +  private boolean reversed;
       private State currentState;
       private ByteString lastCompleteRowKey;
     
    @@ -102,9 +106,11 @@ final class StateMachine {
        * 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) {
    +  StateMachine(RowBuilder adapter, boolean reversed) {
         this.adapter = adapter;
    +    this.reversed = reversed;
         reset();
       }
     
    @@ -184,6 +190,7 @@ RowT consumeRow() {
       boolean hasCompleteRow() {
         return currentState == AWAITING_ROW_CONSUME;
       }
    +
       /**
        * Checks if the state machine is in the middle of processing a row.
        *
    @@ -249,6 +256,21 @@ State handleChunk(CellChunk chunk) {
           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;
    @@ -256,14 +278,24 @@ State handleLastScannedRow(ByteString rowKey) {
     
             @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) {
    -            validate(
    -                ByteStringComparator.INSTANCE.compare(lastCompleteRowKey, chunk.getRowKey()) < 0,
    -                "AWAITING_NEW_ROW: key must be strictly increasing");
    +
    +            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();
    @@ -321,7 +353,8 @@ State handleChunk(CellChunk chunk) {
                     "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");
    +                "AWAITING_NEW_CELL: must have data when valueSize promises more data in the next"
    +                    + " chunk");
     
                 expectedCellSize = chunk.getValueSize();
                 remainingCellBytes = expectedCellSize - chunk.getValue().size();
    @@ -459,9 +492,9 @@ private void validate(boolean condition, String message) {
         }
       }
     
    -  static class InvalidInputException extends RuntimeException {
    +  static class InvalidInputException extends InternalException {
         InvalidInputException(String message) {
    -      super(message);
    +      super(message, null, GrpcStatusCode.of(Status.Code.INTERNAL), false);
         }
       }
     }
    diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext.java
    new file mode 100644
    index 0000000000..09d3fc473e
    --- /dev/null
    +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable.java new file mode 100644 index 0000000000..687bcdce30 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategy.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategy.java new file mode 100644 index 0000000000..e6e2562c33 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallable.java new file mode 100644 index 0000000000..e36bfa57fc --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallable.java new file mode 100644 index 0000000000..c1d3d1c3a7 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachine.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachine.java new file mode 100644 index 0000000000..351656dcd4 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger.java new file mode 100644 index 0000000000..a4f2c618e9 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallable.java new file mode 100644 index 0000000000..c788fe9230 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStream.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStream.java new file mode 100644 index 0000000000..1523e09235 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStreamImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlServerStreamImpl.java new file mode 100644 index 0000000000..caeb2e4788 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelObserver.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelObserver.java new file mode 100644 index 0000000000..2230e14bf2 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPool.java new file mode 100644 index 0000000000..4a127a5502 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolObserver.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolObserver.java new file mode 100644 index 0000000000..0b6d3c8664 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettings.java new file mode 100644 index 0000000000..c88e0f056a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/BigtableTransportChannelProvider.java new file mode 100644 index 0000000000..e0d120d277 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthChecker.java new file mode 100644 index 0000000000..9634b778ae --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPrimer.java new file mode 100644 index 0000000000..29dac62a51 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java index c46eb55ff9..3a5458836f 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java @@ -17,8 +17,8 @@ import com.google.api.core.InternalApi; import com.google.api.gax.rpc.ResponseObserver; -import com.google.api.gax.rpc.StateCheckingResponseObserver; 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; @@ -56,8 +56,7 @@ * }

    */ @InternalApi -public class ReframingResponseObserver - extends StateCheckingResponseObserver { +public class ReframingResponseObserver extends SafeResponseObserver { // Used as a nonblocking mutex for deliver(). // 0 means unlocked // 1 means locked without contention @@ -97,6 +96,7 @@ public class ReframingResponseObserver public ReframingResponseObserver( ResponseObserver observer, Reframer reframer) { + super(observer); this.outerResponseObserver = observer; this.reframer = reframer; } @@ -277,7 +277,7 @@ private void deliverUnsafe() { // 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.lazySet(1); + lock.set(1); // Process the upstream message if one exists. pollUpstream(); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java index c7f3d18b62..d71a044235 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ApiResultRetryAlgorithm.java @@ -16,36 +16,38 @@ package com.google.cloud.bigtable.gaxx.retrying; import com.google.api.core.InternalApi; -import com.google.api.gax.retrying.ResultRetryAlgorithm; -import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.api.gax.retrying.BasicResultRetryAlgorithm; +import com.google.api.gax.retrying.RetryingContext; import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.DeadlineExceededException; -import org.threeten.bp.Duration; /** For internal use, public for technical reasons. */ @InternalApi -public class ApiResultRetryAlgorithm implements ResultRetryAlgorithm { - // Duration to sleep on if the error is DEADLINE_EXCEEDED. - public static final Duration DEADLINE_SLEEP_DURATION = Duration.ofMillis(1); +public class ApiResultRetryAlgorithm extends BasicResultRetryAlgorithm { + /** Returns true if previousThrowable is an {@link ApiException} that is retryable. */ @Override - public TimedAttemptSettings createNextAttempt( - Throwable prevThrowable, ResponseT prevResponse, TimedAttemptSettings prevSettings) { - if (prevThrowable != null && prevThrowable instanceof DeadlineExceededException) { - return TimedAttemptSettings.newBuilder() - .setGlobalSettings(prevSettings.getGlobalSettings()) - .setRetryDelay(prevSettings.getRetryDelay()) - .setRpcTimeout(prevSettings.getRpcTimeout()) - .setRandomizedRetryDelay(DEADLINE_SLEEP_DURATION) - .setAttemptCount(prevSettings.getAttemptCount() + 1) - .setFirstAttemptStartTimeNanos(prevSettings.getFirstAttemptStartTimeNanos()) - .build(); - } - return null; + 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(Throwable prevThrowable, ResponseT prevResponse) { - return (prevThrowable instanceof ApiException) && ((ApiException) prevThrowable).isRetryable(); + 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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/AttemptCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/AttemptCallable.java new file mode 100644 index 0000000000..6d5c75ea99 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/Callables.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/Callables.java new file mode 100644 index 0000000000..d25ec22a3a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/LargeRowRetryAlgorithm.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/LargeRowRetryAlgorithm.java new file mode 100644 index 0000000000..2ec43cadd1 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java new file mode 100644 index 0000000000..c02318fd26 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingCallable.java new file mode 100644 index 0000000000..d9cea20fce --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingServerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingServerStreamingCallable.java new file mode 100644 index 0000000000..504cf4f2b7 --- /dev/null +++ b/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/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ServerStreamingAttemptCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ServerStreamingAttemptCallable.java new file mode 100644 index 0000000000..7f5c39ec0a --- /dev/null +++ b/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/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json new file mode 100644 index 0000000000..7194bc2752 --- /dev/null +++ b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json @@ -0,0 +1,4961 @@ +[ + { + "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$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/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json new file mode 100644 index 0000000000..9123849654 --- /dev/null +++ b/google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.data.v2/reflect-config.json @@ -0,0 +1,3476 @@ +[ + { + "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.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.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.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.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.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.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.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.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.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.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.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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/VersionTest.java new file mode 100644 index 0000000000..e07f7a4a5a --- /dev/null +++ b/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(?:-SNAPSHOT)?"); + + assertThat(Version.VERSION).isGreaterThan("1.22.0"); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java index f2ee6767ab..d99725029d 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,9 @@ 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; @@ -34,27 +37,47 @@ 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.TableName; 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; @@ -67,6 +90,7 @@ 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; @@ -86,10 +110,10 @@ @Generated("by gapic-generator-java") public class BaseBigtableInstanceAdminClientTest { - private static MockServiceHelper mockServiceHelper; - private BaseBigtableInstanceAdminClient client; private static MockBigtableInstanceAdmin mockBigtableInstanceAdmin; + private static MockServiceHelper mockServiceHelper; private LocalChannelProvider channelProvider; + private BaseBigtableInstanceAdminClient client; @BeforeClass public static void startStaticServer() { @@ -130,6 +154,10 @@ public void createInstanceTest() throws Exception { .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() @@ -188,6 +216,10 @@ public void createInstanceTest2() throws Exception { .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() @@ -246,6 +278,10 @@ public void getInstanceTest() throws Exception { .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); @@ -286,6 +322,10 @@ public void getInstanceTest2() throws Exception { .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); @@ -406,6 +446,10 @@ public void updateInstanceTest() throws Exception { .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); @@ -414,6 +458,10 @@ public void updateInstanceTest() throws Exception { .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); @@ -428,6 +476,10 @@ public void updateInstanceTest() throws Exception { Assert.assertEquals(request.getState(), actualRequest.getState()); Assert.assertEquals(request.getType(), actualRequest.getType()); 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(), @@ -445,6 +497,10 @@ public void updateInstanceExceptionTest() throws Exception { .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"); @@ -460,6 +516,10 @@ public void partialUpdateInstanceTest() throws Exception { .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() @@ -887,6 +947,8 @@ public void updateClusterTest() throws Exception { 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( @@ -918,6 +980,60 @@ public void updateClusterExceptionTest() throws Exception { } } + @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(); @@ -1365,17 +1481,92 @@ public void deleteAppProfileExceptionTest2() throws 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); Policy actualResponse = client.getIamPolicy(resource); Assert.assertEquals(expectedResponse, actualResponse); @@ -1397,7 +1588,7 @@ public void getIamPolicyExceptionTest() throws Exception { mockBigtableInstanceAdmin.addException(exception); try { - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); client.getIamPolicy(resource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1411,6 +1602,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -1451,11 +1643,12 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); Policy policy = Policy.newBuilder().build(); Policy actualResponse = client.setIamPolicy(resource, policy); @@ -1479,7 +1672,7 @@ public void setIamPolicyExceptionTest() throws Exception { mockBigtableInstanceAdmin.addException(exception); try { - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); Policy policy = Policy.newBuilder().build(); client.setIamPolicy(resource, policy); Assert.fail("No exception raised"); @@ -1494,6 +1687,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -1537,7 +1731,7 @@ public void testIamPermissionsTest() throws Exception { TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); List permissions = new ArrayList<>(); TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); @@ -1561,7 +1755,7 @@ public void testIamPermissionsExceptionTest() throws Exception { mockBigtableInstanceAdmin.addException(exception); try { - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); List permissions = new ArrayList<>(); client.testIamPermissions(resource, permissions); Assert.fail("No exception raised"); @@ -1608,4 +1802,918 @@ public void testIamPermissionsExceptionTest2() throws Exception { // 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java index 5755c23aa4..9f5a50c41e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,9 @@ 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; @@ -29,28 +31,42 @@ 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; @@ -58,13 +74,22 @@ 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; @@ -98,8 +123,8 @@ public class BaseBigtableTableAdminClientTest { private static MockBigtableTableAdmin mockBigtableTableAdmin; private static MockServiceHelper mockServiceHelper; - private BaseBigtableTableAdminClient client; private LocalChannelProvider channelProvider; + private BaseBigtableTableAdminClient client; @BeforeClass public static void startStaticServer() { @@ -140,6 +165,10 @@ public void createTableTest() throws Exception { .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); @@ -187,6 +216,10 @@ public void createTableTest2() throws Exception { .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); @@ -234,6 +267,10 @@ public void createTableFromSnapshotTest() throws Exception { .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() @@ -293,6 +330,10 @@ public void createTableFromSnapshotTest2() throws Exception { .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() @@ -350,6 +391,10 @@ public void createTableFromSnapshotTest3() throws Exception { .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() @@ -409,6 +454,10 @@ public void createTableFromSnapshotTest4() throws Exception { .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() @@ -554,6 +603,10 @@ public void getTableTest() throws Exception { .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); @@ -595,6 +648,10 @@ public void getTableTest2() throws Exception { .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); @@ -628,6 +685,62 @@ public void getTableExceptionTest2() throws 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(); @@ -697,29 +810,36 @@ public void deleteTableExceptionTest2() throws Exception { } @Test - public void modifyColumnFamiliesTest() throws Exception { + 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(); - mockBigtableTableAdmin.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - List modifications = new ArrayList<>(); - Table actualResponse = client.modifyColumnFamilies(name, modifications); + Table actualResponse = client.undeleteTableAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ModifyColumnFamiliesRequest actualRequest = - ((ModifyColumnFamiliesRequest) actualRequests.get(0)); + UndeleteTableRequest actualRequest = ((UndeleteTableRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(modifications, actualRequest.getModificationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -727,44 +847,52 @@ public void modifyColumnFamiliesTest() throws Exception { } @Test - public void modifyColumnFamiliesExceptionTest() throws Exception { + 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]"); - List modifications = new ArrayList<>(); - client.modifyColumnFamilies(name, modifications); + client.undeleteTableAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } 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 modifyColumnFamiliesTest2() throws Exception { + 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(); - mockBigtableTableAdmin.addResponse(expectedResponse); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); String name = "name3373707"; - List modifications = new ArrayList<>(); - Table actualResponse = client.modifyColumnFamilies(name, modifications); + Table actualResponse = client.undeleteTableAsync(name).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ModifyColumnFamiliesRequest actualRequest = - ((ModifyColumnFamiliesRequest) actualRequests.get(0)); + UndeleteTableRequest actualRequest = ((UndeleteTableRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(modifications, actualRequest.getModificationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -772,40 +900,113 @@ public void modifyColumnFamiliesTest2() throws Exception { } @Test - public void modifyColumnFamiliesExceptionTest2() throws Exception { + public void undeleteTableExceptionTest2() 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); + client.undeleteTableAsync(name).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } 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 dropRowRangeTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockBigtableTableAdmin.addResponse(expectedResponse); + 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); - DropRowRangeRequest request = - DropRowRangeRequest.newBuilder() - .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + 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); - client.dropRowRange(request); + 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()); - DropRowRangeRequest actualRequest = ((DropRowRangeRequest) actualRequests.get(0)); + CreateAuthorizedViewRequest actualRequest = + ((CreateAuthorizedViewRequest) actualRequests.get(0)); - Assert.assertEquals(request.getName(), actualRequest.getName()); - Assert.assertEquals(request.getRowKeyPrefix(), actualRequest.getRowKeyPrefix()); - Assert.assertEquals( - request.getDeleteAllDataFromTable(), actualRequest.getDeleteAllDataFromTable()); + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(authorizedViewId, actualRequest.getAuthorizedViewId()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -813,41 +1014,47 @@ public void dropRowRangeTest() throws Exception { } @Test - public void dropRowRangeExceptionTest() throws Exception { + public void createAuthorizedViewExceptionTest2() 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); + 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 (InvalidArgumentException e) { - // Expected exception. + } 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 generateConsistencyTokenTest() throws Exception { - GenerateConsistencyTokenResponse expectedResponse = - GenerateConsistencyTokenResponse.newBuilder() - .setConsistencyToken("consistencyToken-1985152319") + public void listAuthorizedViewsTest() throws Exception { + AuthorizedView responsesElement = AuthorizedView.newBuilder().build(); + ListAuthorizedViewsResponse expectedResponse = + ListAuthorizedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizedViews(Arrays.asList(responsesElement)) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - GenerateConsistencyTokenResponse actualResponse = client.generateConsistencyToken(name); - Assert.assertEquals(expectedResponse, actualResponse); + 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()); - GenerateConsistencyTokenRequest actualRequest = - ((GenerateConsistencyTokenRequest) actualRequests.get(0)); + ListAuthorizedViewsRequest actualRequest = ((ListAuthorizedViewsRequest) actualRequests.get(0)); - Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -855,13 +1062,13 @@ public void generateConsistencyTokenTest() throws Exception { } @Test - public void generateConsistencyTokenExceptionTest() throws Exception { + public void listAuthorizedViewsExceptionTest() 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); + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.listAuthorizedViews(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -869,24 +1076,29 @@ public void generateConsistencyTokenExceptionTest() throws Exception { } @Test - public void generateConsistencyTokenTest2() throws Exception { - GenerateConsistencyTokenResponse expectedResponse = - GenerateConsistencyTokenResponse.newBuilder() - .setConsistencyToken("consistencyToken-1985152319") + public void listAuthorizedViewsTest2() throws Exception { + AuthorizedView responsesElement = AuthorizedView.newBuilder().build(); + ListAuthorizedViewsResponse expectedResponse = + ListAuthorizedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizedViews(Arrays.asList(responsesElement)) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - String name = "name3373707"; + String parent = "parent-995424086"; - GenerateConsistencyTokenResponse actualResponse = client.generateConsistencyToken(name); - Assert.assertEquals(expectedResponse, actualResponse); + 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()); - GenerateConsistencyTokenRequest actualRequest = - ((GenerateConsistencyTokenRequest) actualRequests.get(0)); + ListAuthorizedViewsRequest actualRequest = ((ListAuthorizedViewsRequest) actualRequests.get(0)); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -894,13 +1106,13 @@ public void generateConsistencyTokenTest2() throws Exception { } @Test - public void generateConsistencyTokenExceptionTest2() throws Exception { + public void listAuthorizedViewsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - String name = "name3373707"; - client.generateConsistencyToken(name); + String parent = "parent-995424086"; + client.listAuthorizedViews(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -908,23 +1120,28 @@ public void generateConsistencyTokenExceptionTest2() throws Exception { } @Test - public void checkConsistencyTest() throws Exception { - CheckConsistencyResponse expectedResponse = - CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + 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); - TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - String consistencyToken = "consistencyToken-1985152319"; + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); - CheckConsistencyResponse actualResponse = client.checkConsistency(name, consistencyToken); + AuthorizedView actualResponse = client.getAuthorizedView(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CheckConsistencyRequest actualRequest = ((CheckConsistencyRequest) actualRequests.get(0)); + GetAuthorizedViewRequest actualRequest = ((GetAuthorizedViewRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertEquals(consistencyToken, actualRequest.getConsistencyToken()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -932,14 +1149,14 @@ public void checkConsistencyTest() throws Exception { } @Test - public void checkConsistencyExceptionTest() throws Exception { + public void getAuthorizedViewExceptionTest() 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); + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.getAuthorizedView(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -947,23 +1164,27 @@ public void checkConsistencyExceptionTest() throws Exception { } @Test - public void checkConsistencyTest2() throws Exception { - CheckConsistencyResponse expectedResponse = - CheckConsistencyResponse.newBuilder().setConsistent(true).build(); + 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"; - String consistencyToken = "consistencyToken-1985152319"; - CheckConsistencyResponse actualResponse = client.checkConsistency(name, consistencyToken); + AuthorizedView actualResponse = client.getAuthorizedView(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CheckConsistencyRequest actualRequest = ((CheckConsistencyRequest) actualRequests.get(0)); + GetAuthorizedViewRequest actualRequest = ((GetAuthorizedViewRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(consistencyToken, actualRequest.getConsistencyToken()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -971,14 +1192,13 @@ public void checkConsistencyTest2() throws Exception { } @Test - public void checkConsistencyExceptionTest2() throws Exception { + public void getAuthorizedViewExceptionTest2() 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); + client.getAuthorizedView(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -986,42 +1206,37 @@ public void checkConsistencyExceptionTest2() throws Exception { } @Test - public void snapshotTableTest() throws Exception { - Snapshot expectedResponse = - Snapshot.newBuilder() + public void updateAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.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") + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) .build(); Operation resultOperation = Operation.newBuilder() - .setName("snapshotTableTest") + .setName("updateAuthorizedViewTest") .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"; + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); - Snapshot actualResponse = - client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + AuthorizedView actualResponse = + client.updateAuthorizedViewAsync(authorizedView, updateMask).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + UpdateAuthorizedViewRequest actualRequest = + ((UpdateAuthorizedViewRequest) 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.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1029,16 +1244,935 @@ public void snapshotTableTest() throws Exception { } @Test - public void snapshotTableExceptionTest() throws Exception { + public void updateAuthorizedViewExceptionTest() 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(); + 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()); @@ -1048,42 +2182,91 @@ public void snapshotTableExceptionTest() throws Exception { } @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") + 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("snapshotTableTest") + .setName("createBackupTest") .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"; + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + Backup backup = Backup.newBuilder().build(); - Snapshot actualResponse = - client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Backup actualResponse = client.createBackupAsync(parent, backupId, backup).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + CreateBackupRequest actualRequest = ((CreateBackupRequest) 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.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(), @@ -1091,61 +2274,45 @@ public void snapshotTableTest2() throws Exception { } @Test - public void snapshotTableExceptionTest2() throws Exception { + public void getBackupExceptionTest() 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(); + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + client.getBackup(name); 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()); + } catch (InvalidArgumentException e) { + // Expected exception. } } @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)) + 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(resultOperation); + mockBigtableTableAdmin.addResponse(expectedResponse); 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(); + Backup actualResponse = client.getBackup(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + GetBackupRequest actualRequest = ((GetBackupRequest) 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(), @@ -1153,61 +2320,47 @@ public void snapshotTableTest3() throws Exception { } @Test - public void snapshotTableExceptionTest3() throws Exception { + public void getBackupExceptionTest2() 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(); + client.getBackup(name); 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()); + } catch (InvalidArgumentException e) { + // Expected exception. } } @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)) + 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(resultOperation); + mockBigtableTableAdmin.addResponse(expectedResponse); - String name = "name3373707"; - String cluster = "cluster872092154"; - String snapshotId = "snapshotId-1113817601"; - String description = "description-1724546052"; + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); - Snapshot actualResponse = - client.snapshotTableAsync(name, cluster, snapshotId, description).get(); + Backup actualResponse = client.updateBackup(backup, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - SnapshotTableRequest actualRequest = ((SnapshotTableRequest) actualRequests.get(0)); + UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertEquals(cluster, actualRequest.getCluster()); - Assert.assertEquals(snapshotId, actualRequest.getSnapshotId()); - Assert.assertEquals(description, actualRequest.getDescription()); + Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1215,46 +2368,32 @@ public void snapshotTableTest4() throws Exception { } @Test - public void snapshotTableExceptionTest4() throws Exception { + public void updateBackupExceptionTest() 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(); + Backup backup = Backup.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateBackup(backup, updateMask); 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()); + } catch (InvalidArgumentException e) { + // Expected exception. } } @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(); + public void deleteBackupTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); mockBigtableTableAdmin.addResponse(expectedResponse); - SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); - Snapshot actualResponse = client.getSnapshot(name); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteBackup(name); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -1264,13 +2403,13 @@ public void getSnapshotTest() throws Exception { } @Test - public void getSnapshotExceptionTest() throws Exception { + public void deleteBackupExceptionTest() 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); + BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + client.deleteBackup(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1278,27 +2417,17 @@ public void getSnapshotExceptionTest() throws 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(); + public void deleteBackupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); mockBigtableTableAdmin.addResponse(expectedResponse); String name = "name3373707"; - Snapshot actualResponse = client.getSnapshot(name); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteBackup(name); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetSnapshotRequest actualRequest = ((GetSnapshotRequest) actualRequests.get(0)); + DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -1308,13 +2437,13 @@ public void getSnapshotTest2() throws Exception { } @Test - public void getSnapshotExceptionTest2() throws Exception { + public void deleteBackupExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { String name = "name3373707"; - client.getSnapshot(name); + client.deleteBackup(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1322,27 +2451,27 @@ public void getSnapshotExceptionTest2() throws Exception { } @Test - public void listSnapshotsTest() throws Exception { - Snapshot responsesElement = Snapshot.newBuilder().build(); - ListSnapshotsResponse expectedResponse = - ListSnapshotsResponse.newBuilder() + public void listBackupsTest() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) + .addAllBackups(Arrays.asList(responsesElement)) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); - ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); + ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); + Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); + ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( @@ -1352,13 +2481,13 @@ public void listSnapshotsTest() throws Exception { } @Test - public void listSnapshotsExceptionTest() throws Exception { + 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.listSnapshots(parent); + client.listBackups(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1366,29 +2495,86 @@ public void listSnapshotsExceptionTest() throws Exception { } @Test - public void listSnapshotsTest2() throws Exception { - Snapshot responsesElement = Snapshot.newBuilder().build(); - ListSnapshotsResponse expectedResponse = - ListSnapshotsResponse.newBuilder() + public void listBackupsTest2() throws Exception { + Backup responsesElement = Backup.newBuilder().build(); + ListBackupsResponse expectedResponse = + ListBackupsResponse.newBuilder() .setNextPageToken("") - .addAllSnapshots(Arrays.asList(responsesElement)) + .addAllBackups(Arrays.asList(responsesElement)) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); String parent = "parent-995424086"; - ListSnapshotsPagedResponse pagedListResponse = client.listSnapshots(parent); + 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); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + RestoreTableRequest request = + RestoreTableRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setTableId("tableId-1552905847") + .build(); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); + Table actualResponse = client.restoreTableAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListSnapshotsRequest actualRequest = ((ListSnapshotsRequest) actualRequests.get(0)); + RestoreTableRequest actualRequest = ((RestoreTableRequest) actualRequests.get(0)); - Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getTableId(), actualRequest.getTableId()); + Assert.assertEquals(request.getBackup(), actualRequest.getBackup()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1396,33 +2582,64 @@ public void listSnapshotsTest2() throws Exception { } @Test - public void listSnapshotsExceptionTest2() throws Exception { + public void restoreTableExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - String parent = "parent-995424086"; - client.listSnapshots(parent); + RestoreTableRequest request = + RestoreTableRequest.newBuilder() + .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) + .setTableId("tableId-1552905847") + .build(); + client.restoreTableAsync(request).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } 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 deleteSnapshotTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockBigtableTableAdmin.addResponse(expectedResponse); + 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); - SnapshotName name = SnapshotName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); - client.deleteSnapshot(name); + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); - Assert.assertEquals(name.toString(), actualRequest.getName()); + 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(), @@ -1430,33 +2647,63 @@ public void deleteSnapshotTest() throws Exception { } @Test - public void deleteSnapshotExceptionTest() throws Exception { + public void copyBackupExceptionTest() 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); + 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 (InvalidArgumentException e) { - // Expected exception. + } 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 deleteSnapshotTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockBigtableTableAdmin.addResponse(expectedResponse); + 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); - String name = "name3373707"; + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); - client.deleteSnapshot(name); + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteSnapshotRequest actualRequest = ((DeleteSnapshotRequest) actualRequests.get(0)); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); - Assert.assertEquals(name, actualRequest.getName()); + 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(), @@ -1464,53 +2711,63 @@ public void deleteSnapshotTest2() throws Exception { } @Test - public void deleteSnapshotExceptionTest2() throws Exception { + public void copyBackupExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - String name = "name3373707"; - client.deleteSnapshot(name); + 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 (InvalidArgumentException e) { - // Expected exception. + } 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 createBackupTest() throws Exception { + 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("createBackupTest") + .setName("copyBackupTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockBigtableTableAdmin.addResponse(resultOperation); - ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String parent = "parent-995424086"; String backupId = "backupId2121930365"; - Backup backup = Backup.newBuilder().build(); + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); - Backup actualResponse = client.createBackupAsync(parent, backupId, backup).get(); + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); - Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertEquals(backupId, actualRequest.getBackupId()); - Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(sourceBackup.toString(), actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1518,15 +2775,16 @@ public void createBackupTest() throws Exception { } @Test - public void createBackupExceptionTest() throws Exception { + public void copyBackupExceptionTest3() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String parent = "parent-995424086"; String backupId = "backupId2121930365"; - Backup backup = Backup.newBuilder().build(); - client.createBackupAsync(parent, backupId, backup).get(); + 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()); @@ -1536,20 +2794,22 @@ public void createBackupExceptionTest() throws Exception { } @Test - public void createBackupTest2() throws Exception { + 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("createBackupTest") + .setName("copyBackupTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); @@ -1557,18 +2817,21 @@ public void createBackupTest2() throws Exception { String parent = "parent-995424086"; String backupId = "backupId2121930365"; - Backup backup = Backup.newBuilder().build(); + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); - Backup actualResponse = client.createBackupAsync(parent, backupId, backup).get(); + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateBackupRequest actualRequest = ((CreateBackupRequest) actualRequests.get(0)); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertEquals(backupId, actualRequest.getBackupId()); - Assert.assertEquals(backup, actualRequest.getBackup()); + Assert.assertEquals(sourceBackup, actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1576,15 +2839,16 @@ public void createBackupTest2() throws Exception { } @Test - public void createBackupExceptionTest2() throws Exception { + 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"; - Backup backup = Backup.newBuilder().build(); - client.createBackupAsync(parent, backupId, backup).get(); + 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()); @@ -1594,29 +2858,27 @@ public void createBackupExceptionTest2() throws Exception { } @Test - public void getBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) - .setSourceTable("sourceTable-95372173") - .setExpireTime(Timestamp.newBuilder().build()) - .setStartTime(Timestamp.newBuilder().build()) - .setEndTime(Timestamp.newBuilder().build()) - .setSizeBytes(-1796325715) - .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); - Backup actualResponse = client.getBackup(name); + Policy actualResponse = client.getIamPolicy(resource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(resource.toString(), actualRequest.getResource()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1624,13 +2886,14 @@ public void getBackupTest() throws Exception { } @Test - public void getBackupExceptionTest() throws Exception { + public void getIamPolicyExceptionTest() 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); + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.getIamPolicy(resource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1638,29 +2901,26 @@ public void getBackupExceptionTest() throws Exception { } @Test - public void getBackupTest2() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) - .setSourceTable("sourceTable-95372173") - .setExpireTime(Timestamp.newBuilder().build()) - .setStartTime(Timestamp.newBuilder().build()) - .setEndTime(Timestamp.newBuilder().build()) - .setSizeBytes(-1796325715) - .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + 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 name = "name3373707"; + String resource = "resource-341064690"; - Backup actualResponse = client.getBackup(name); + Policy actualResponse = client.getIamPolicy(resource); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetBackupRequest actualRequest = ((GetBackupRequest) actualRequests.get(0)); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(resource, actualRequest.getResource()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1668,13 +2928,13 @@ public void getBackupTest2() throws Exception { } @Test - public void getBackupExceptionTest2() throws Exception { + public void getIamPolicyExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - String name = "name3373707"; - client.getBackup(name); + String resource = "resource-341064690"; + client.getIamPolicy(resource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1682,31 +2942,74 @@ public void getBackupExceptionTest2() throws Exception { } @Test - public void updateBackupTest() throws Exception { - Backup expectedResponse = - Backup.newBuilder() - .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) - .setSourceTable("sourceTable-95372173") - .setExpireTime(Timestamp.newBuilder().build()) - .setStartTime(Timestamp.newBuilder().build()) - .setEndTime(Timestamp.newBuilder().build()) - .setSizeBytes(-1796325715) - .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - Backup backup = Backup.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + Policy policy = Policy.newBuilder().build(); - Backup actualResponse = client.updateBackup(backup, updateMask); + 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()); - UpdateBackupRequest actualRequest = ((UpdateBackupRequest) actualRequests.get(0)); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); - Assert.assertEquals(backup, actualRequest.getBackup()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(policy, actualRequest.getPolicy()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1714,14 +3017,14 @@ public void updateBackupTest() throws Exception { } @Test - public void updateBackupExceptionTest() throws Exception { + public void setIamPolicyExceptionTest2() 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); + String resource = "resource-341064690"; + Policy policy = Policy.newBuilder().build(); + client.setIamPolicy(resource, policy); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1729,19 +3032,24 @@ public void updateBackupExceptionTest() throws Exception { } @Test - public void deleteBackupTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); mockBigtableTableAdmin.addResponse(expectedResponse); - BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + ResourceName resource = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + List permissions = new ArrayList<>(); - client.deleteBackup(name); + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1749,13 +3057,15 @@ public void deleteBackupTest() throws Exception { } @Test - public void deleteBackupExceptionTest() throws Exception { + public void testIamPermissionsExceptionTest() 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); + 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. @@ -1763,19 +3073,23 @@ public void deleteBackupExceptionTest() throws Exception { } @Test - public void deleteBackupTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); + public void testIamPermissionsTest2() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); mockBigtableTableAdmin.addResponse(expectedResponse); - String name = "name3373707"; + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); - client.deleteBackup(name); + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteBackupRequest actualRequest = ((DeleteBackupRequest) actualRequests.get(0)); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); - Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1783,13 +3097,14 @@ public void deleteBackupTest2() throws Exception { } @Test - public void deleteBackupExceptionTest2() throws Exception { + public void testIamPermissionsExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - String name = "name3373707"; - client.deleteBackup(name); + String resource = "resource-341064690"; + List permissions = new ArrayList<>(); + client.testIamPermissions(resource, permissions); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1797,29 +3112,37 @@ public void deleteBackupExceptionTest2() throws Exception { } @Test - public void listBackupsTest() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() - .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + public void createSchemaBundleTest() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") .build(); - mockBigtableTableAdmin.addResponse(expectedResponse); - - ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); - - ListBackupsPagedResponse pagedListResponse = client.listBackups(parent); + Operation resultOperation = + Operation.newBuilder() + .setName("createSchemaBundleTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + String schemaBundleId = "schemaBundleId2039843326"; + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getBackupsList().get(0), resources.get(0)); + SchemaBundle actualResponse = + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + 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(), @@ -1827,43 +3150,55 @@ public void listBackupsTest() throws Exception { } @Test - public void listBackupsExceptionTest() throws Exception { + public void createSchemaBundleExceptionTest() 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); + 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 (InvalidArgumentException e) { - // Expected exception. + } 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 listBackupsTest2() throws Exception { - Backup responsesElement = Backup.newBuilder().build(); - ListBackupsResponse expectedResponse = - ListBackupsResponse.newBuilder() - .setNextPageToken("") - .addAllBackups(Arrays.asList(responsesElement)) + public void createSchemaBundleTest2() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") .build(); - mockBigtableTableAdmin.addResponse(expectedResponse); + 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(); - 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)); + SchemaBundle actualResponse = + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); + Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListBackupsRequest actualRequest = ((ListBackupsRequest) actualRequests.get(0)); + 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(), @@ -1871,52 +3206,52 @@ public void listBackupsTest2() throws Exception { } @Test - public void listBackupsExceptionTest2() throws Exception { + public void createSchemaBundleExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { String parent = "parent-995424086"; - client.listBackups(parent); + String schemaBundleId = "schemaBundleId2039843326"; + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + client.createSchemaBundleAsync(parent, schemaBundleId, schemaBundle).get(); Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. + } 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 restoreTableTest() throws Exception { - Table expectedResponse = - Table.newBuilder() - .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) - .putAllClusterStates(new HashMap()) - .putAllColumnFamilies(new HashMap()) - .setRestoreInfo(RestoreInfo.newBuilder().build()) + 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("restoreTableTest") + .setName("updateSchemaBundleTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockBigtableTableAdmin.addResponse(resultOperation); - RestoreTableRequest request = - RestoreTableRequest.newBuilder() - .setParent(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) - .setTableId("tableId-1552905847") - .build(); + SchemaBundle schemaBundle = SchemaBundle.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); - Table actualResponse = client.restoreTableAsync(request).get(); + SchemaBundle actualResponse = client.updateSchemaBundleAsync(schemaBundle, updateMask).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - RestoreTableRequest actualRequest = ((RestoreTableRequest) actualRequests.get(0)); + UpdateSchemaBundleRequest actualRequest = ((UpdateSchemaBundleRequest) actualRequests.get(0)); - Assert.assertEquals(request.getParent(), actualRequest.getParent()); - Assert.assertEquals(request.getTableId(), actualRequest.getTableId()); - Assert.assertEquals(request.getBackup(), actualRequest.getBackup()); + Assert.assertEquals(schemaBundle, actualRequest.getSchemaBundle()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1924,17 +3259,14 @@ public void restoreTableTest() throws Exception { } @Test - public void restoreTableExceptionTest() throws Exception { + public void updateSchemaBundleExceptionTest() 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(); + 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()); @@ -1944,25 +3276,27 @@ public void restoreTableExceptionTest() throws Exception { } @Test - public void getIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) + public void getSchemaBundleTest() throws Exception { + SchemaBundle expectedResponse = + SchemaBundle.newBuilder() + .setName( + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]") + .toString()) + .setEtag("etag3123477") .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); - Policy actualResponse = client.getIamPolicy(resource); + SchemaBundle actualResponse = client.getSchemaBundle(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + GetSchemaBundleRequest actualRequest = ((GetSchemaBundleRequest) actualRequests.get(0)); - Assert.assertEquals(resource.toString(), actualRequest.getResource()); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -1970,13 +3304,14 @@ public void getIamPolicyTest() throws Exception { } @Test - public void getIamPolicyExceptionTest() throws Exception { + public void getSchemaBundleExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - client.getIamPolicy(resource); + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); + client.getSchemaBundle(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -1984,25 +3319,26 @@ public void getIamPolicyExceptionTest() throws Exception { } @Test - public void getIamPolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) + 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 resource = "resource-341064690"; + String name = "name3373707"; - Policy actualResponse = client.getIamPolicy(resource); + SchemaBundle actualResponse = client.getSchemaBundle(name); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + GetSchemaBundleRequest actualRequest = ((GetSchemaBundleRequest) actualRequests.get(0)); - Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -2010,13 +3346,13 @@ public void getIamPolicyTest2() throws Exception { } @Test - public void getIamPolicyExceptionTest2() throws Exception { + public void getSchemaBundleExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - String resource = "resource-341064690"; - client.getIamPolicy(resource); + String name = "name3373707"; + client.getSchemaBundle(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -2024,27 +3360,29 @@ public void getIamPolicyExceptionTest2() throws Exception { } @Test - public void setIamPolicyTest() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) + public void listSchemaBundlesTest() throws Exception { + SchemaBundle responsesElement = SchemaBundle.newBuilder().build(); + ListSchemaBundlesResponse expectedResponse = + ListSchemaBundlesResponse.newBuilder() + .setNextPageToken("") + .addAllSchemaBundles(Arrays.asList(responsesElement)) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - Policy policy = Policy.newBuilder().build(); + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - Policy actualResponse = client.setIamPolicy(resource, policy); - Assert.assertEquals(expectedResponse, actualResponse); + 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()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + ListSchemaBundlesRequest actualRequest = ((ListSchemaBundlesRequest) actualRequests.get(0)); - Assert.assertEquals(resource.toString(), actualRequest.getResource()); - Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -2052,14 +3390,13 @@ public void setIamPolicyTest() throws Exception { } @Test - public void setIamPolicyExceptionTest() throws Exception { + public void listSchemaBundlesExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - Policy policy = Policy.newBuilder().build(); - client.setIamPolicy(resource, policy); + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.listSchemaBundles(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -2067,27 +3404,29 @@ public void setIamPolicyExceptionTest() throws Exception { } @Test - public void setIamPolicyTest2() throws Exception { - Policy expectedResponse = - Policy.newBuilder() - .setVersion(351608024) - .addAllBindings(new ArrayList()) - .setEtag(ByteString.EMPTY) + public void listSchemaBundlesTest2() throws Exception { + SchemaBundle responsesElement = SchemaBundle.newBuilder().build(); + ListSchemaBundlesResponse expectedResponse = + ListSchemaBundlesResponse.newBuilder() + .setNextPageToken("") + .addAllSchemaBundles(Arrays.asList(responsesElement)) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - String resource = "resource-341064690"; - Policy policy = Policy.newBuilder().build(); + String parent = "parent-995424086"; - Policy actualResponse = client.setIamPolicy(resource, policy); - Assert.assertEquals(expectedResponse, actualResponse); + 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()); - SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + ListSchemaBundlesRequest actualRequest = ((ListSchemaBundlesRequest) actualRequests.get(0)); - Assert.assertEquals(resource, actualRequest.getResource()); - Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertEquals(parent, actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -2095,14 +3434,13 @@ public void setIamPolicyTest2() throws Exception { } @Test - public void setIamPolicyExceptionTest2() throws Exception { + public void listSchemaBundlesExceptionTest2() 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); + String parent = "parent-995424086"; + client.listSchemaBundles(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -2110,23 +3448,20 @@ public void setIamPolicyExceptionTest2() throws Exception { } @Test - public void testIamPermissionsTest() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + public void deleteSchemaBundleTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); mockBigtableTableAdmin.addResponse(expectedResponse); - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - List permissions = new ArrayList<>(); + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); - TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteSchemaBundle(name); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + DeleteSchemaBundleRequest actualRequest = ((DeleteSchemaBundleRequest) actualRequests.get(0)); - Assert.assertEquals(resource.toString(), actualRequest.getResource()); - Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -2134,14 +3469,14 @@ public void testIamPermissionsTest() throws Exception { } @Test - public void testIamPermissionsExceptionTest() throws Exception { + public void deleteSchemaBundleExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - ResourceName resource = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - List permissions = new ArrayList<>(); - client.testIamPermissions(resource, permissions); + SchemaBundleName name = + SchemaBundleName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[SCHEMA_BUNDLE]"); + client.deleteSchemaBundle(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -2149,23 +3484,19 @@ public void testIamPermissionsExceptionTest() throws Exception { } @Test - public void testIamPermissionsTest2() throws Exception { - TestIamPermissionsResponse expectedResponse = - TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + public void deleteSchemaBundleTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); mockBigtableTableAdmin.addResponse(expectedResponse); - String resource = "resource-341064690"; - List permissions = new ArrayList<>(); + String name = "name3373707"; - TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); - Assert.assertEquals(expectedResponse, actualResponse); + client.deleteSchemaBundle(name); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + DeleteSchemaBundleRequest actualRequest = ((DeleteSchemaBundleRequest) actualRequests.get(0)); - Assert.assertEquals(resource, actualRequest.getResource()); - Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -2173,14 +3504,13 @@ public void testIamPermissionsTest2() throws Exception { } @Test - public void testIamPermissionsExceptionTest2() throws Exception { + public void deleteSchemaBundleExceptionTest2() 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); + String name = "name3373707"; + client.deleteSchemaBundle(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTest.java deleted file mode 100644 index 2c3d81c084..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTest.java +++ /dev/null @@ -1,924 +0,0 @@ -/* - * 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.CreateInstanceMetadata; -import com.google.bigtable.admin.v2.GetInstanceRequest; -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.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.Cluster; -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.PartialListClustersException; -import com.google.cloud.bigtable.admin.v2.models.PartialListInstancesException; -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.stub.BigtableInstanceAdminStub; -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.util.List; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.runners.MockitoJUnitRunner; -import org.mockito.stubbing.Answer; - -@RunWith(MockitoJUnitRunner.class) -public class BigtableInstanceAdminClientTest { - - 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 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 BigtableInstanceAdminClient adminClient; - - @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 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; - - @Before - public void setUp() { - adminClient = BigtableInstanceAdminClient.create(PROJECT_ID, mockStub); - - Mockito.when(mockStub.createInstanceOperationCallable()).thenReturn(mockCreateInstanceCallable); - Mockito.when(mockStub.partialUpdateInstanceOperationCallable()) - .thenReturn(mockUpdateInstanceCallable); - Mockito.when(mockStub.getInstanceCallable()).thenReturn(mockGetInstanceCallable); - Mockito.when(mockStub.listInstancesCallable()).thenReturn(mockListInstancesCallable); - Mockito.when(mockStub.deleteInstanceCallable()).thenReturn(mockDeleteInstanceCallable); - - Mockito.when(mockStub.createClusterOperationCallable()).thenReturn(mockCreateClusterCallable); - Mockito.when(mockStub.getClusterCallable()).thenReturn(mockGetClusterCallable); - Mockito.when(mockStub.listClustersCallable()).thenReturn(mockListClustersCallable); - Mockito.when(mockStub.updateClusterOperationCallable()).thenReturn(mockUpdateClusterCallable); - Mockito.when(mockStub.deleteClusterCallable()).thenReturn(mockDeleteClusterCallable); - - Mockito.when(mockStub.createAppProfileCallable()).thenReturn(mockCreateAppProfileCallable); - Mockito.when(mockStub.getAppProfileCallable()).thenReturn(mockGetAppProfileCallable); - Mockito.when(mockStub.listAppProfilesPagedCallable()).thenReturn(mockListAppProfilesCallable); - Mockito.when(mockStub.updateAppProfileOperationCallable()) - .thenReturn(mockUpdateAppProfileCallable); - Mockito.when(mockStub.deleteAppProfileCallable()).thenReturn(mockDeleteAppProfileCallable); - - Mockito.when(mockStub.getIamPolicyCallable()).thenReturn(mockGetIamPolicyCallable); - Mockito.when(mockStub.setIamPolicyCallable()).thenReturn(mockSetIamPolicyCallable); - Mockito.when(mockStub.testIamPermissionsCallable()).thenReturn(mockTestIamPermissionsCallable); - } - - @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 - 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 testUpdateInstance() { - // 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 - 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 - 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 - 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 - 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 - 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") - .setServeNodes(3) - .setStorageType(StorageType.SSD)); - // Verify - assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); - } - - @Test - public void testGetCluster() { - // Setup - 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 - 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 - 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 - 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 testDeleteCluster() { - // Setup - 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 - 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 testGetAppProfile() { - // Setup - 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 - 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.getNextPageToken()).thenReturn("next-page"); - 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 - 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 testDeleteAppProfile() throws Exception { - // Setup - 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 - 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())) - .build()); - } - - @Test - public void testSetIamPolicy() { - // Setup - 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())) - .build()); - } - - @Test - public void testTestIamPermissions() { - // Setup - 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 - 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(Matchers.any(GetInstanceRequest.class))) - .thenReturn(ApiFutures.immediateFuture(expectedResponse)); - - // Execute - boolean found = adminClient.exists(INSTANCE_ID); - - // Verify - assertThat(found).isTrue(); - } - - @Test - public void testExistsFalse() { - // Setup - NotFoundException exception = - new NotFoundException("fake-error", null, GrpcStatusCode.of(Status.Code.NOT_FOUND), false); - - Mockito.when(mockGetInstanceCallable.futureCall(Matchers.any(GetInstanceRequest.class))) - .thenReturn( - ApiFutures.immediateFailedFuture(exception)); - - // Execute - boolean found = adminClient.exists(INSTANCE_ID); - - // Verify - assertThat(found).isFalse(); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTests.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTests.java new file mode 100644 index 0000000000..84ff973033 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java index fd761ff915..9337dcef9a 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminSettingsTest.java @@ -89,9 +89,7 @@ public void testStubSettings() throws IOException { .containsExactly(Code.INVALID_ARGUMENT); assertThat( - builder - .build() - .toBuilder() + builder.build().toBuilder() .build() .getStubSettings() .createInstanceSettings() @@ -123,6 +121,16 @@ public void testStubSettings() throws IOException { "getIamPolicySettings", "setIamPolicySettings", "testIamPermissionsSettings", + "createMaterializedViewSettings", + "getMaterializedViewSettings", + "listMaterializedViewsSettings", + "updateMaterializedViewSettings", + "deleteMaterializedViewSettings", + "createLogicalViewSettings", + "getLogicalViewSettings", + "listLogicalViewsSettings", + "updateLogicalViewSettings", + "deleteLogicalViewSettings", }; @Test @@ -144,7 +152,7 @@ public void testToString() throws IOException { BigtableInstanceAdminSettings settings = builder.build(); checkToString(settings); assertThat(settings.toString()).contains("endpoint=example.com:1234"); - assertThat(settings.toString()).contains("totalTimeout=PT13H32M"); + assertThat(settings.toString()).contains("totalTimeoutDuration=PT13H32M"); } void checkToString(BigtableInstanceAdminSettings settings) { @@ -155,6 +163,6 @@ void checkToString(BigtableInstanceAdminSettings settings) { for (String subSettings : SETTINGS_LIST) { assertThat(toString).contains(subSettings + "="); } - assertThat(toString.contains(settings.getStubSettings().toString())); + assertThat(toString).contains(settings.getStubSettings().toString()); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java deleted file mode 100644 index eeb87ada2d..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java +++ /dev/null @@ -1,785 +0,0 @@ -/* - * 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.Backup.State; -import com.google.bigtable.admin.v2.BackupInfo; -import com.google.bigtable.admin.v2.ColumnFamily; -import com.google.bigtable.admin.v2.CreateBackupMetadata; -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.RestoreSourceType; -import com.google.bigtable.admin.v2.RestoreTableMetadata; -import com.google.bigtable.admin.v2.Table.View; -import com.google.bigtable.admin.v2.TableName; -import com.google.cloud.Identity; -import com.google.cloud.Policy; -import com.google.cloud.Role; -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.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.Backup; -import com.google.cloud.bigtable.admin.v2.models.CreateBackupRequest; -import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; -import com.google.cloud.bigtable.admin.v2.models.ModifyColumnFamiliesRequest; -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.Table; -import com.google.cloud.bigtable.admin.v2.models.UpdateBackupRequest; -import com.google.cloud.bigtable.admin.v2.stub.EnhancedBigtableTableAdminStub; -import com.google.common.collect.Lists; -import com.google.common.io.BaseEncoding; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.ByteString; -import com.google.protobuf.Empty; -import com.google.protobuf.Timestamp; -import com.google.protobuf.util.Timestamps; -import io.grpc.Status; -import io.grpc.Status.Code; -import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.Matchers; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.stubbing.Answer; -import org.threeten.bp.Instant; - -@RunWith(JUnit4.class) -public class BigtableTableAdminClientTest { - @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); - - private static final String PROJECT_ID = "my-project"; - private static final String INSTANCE_ID = "my-instance"; - 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 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 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 - mockCreateBackupCallable; - - @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 UnaryCallable - mockRestoreTableCallable; - - @Mock - private OperationCallable< - com.google.bigtable.admin.v2.RestoreTableRequest, - com.google.bigtable.admin.v2.Table, - RestoreTableMetadata> - mockRestoreTableOperationCallable; - - @Mock - private UnaryCallable - mockGetIamPolicyCallable; - - @Mock - private UnaryCallable - mockSetIamPolicyCallable; - - @Mock - private UnaryCallable< - com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> - mockTestIamPermissionsCallable; - - @Before - public void setUp() { - adminClient = BigtableTableAdminClient.create(PROJECT_ID, INSTANCE_ID, mockStub); - - Mockito.when(mockStub.createTableCallable()).thenReturn(mockCreateTableCallable); - Mockito.when(mockStub.modifyColumnFamiliesCallable()).thenReturn(mockModifyTableCallable); - Mockito.when(mockStub.deleteTableCallable()).thenReturn(mockDeleteTableCallable); - Mockito.when(mockStub.getTableCallable()).thenReturn(mockGetTableCallable); - Mockito.when(mockStub.listTablesPagedCallable()).thenReturn(mockListTableCallable); - Mockito.when(mockStub.dropRowRangeCallable()).thenReturn(mockDropRowRangeCallable); - Mockito.when(mockStub.awaitReplicationCallable()).thenReturn(mockAwaitReplicationCallable); - Mockito.when(mockStub.createBackupOperationCallable()) - .thenReturn(mockCreateBackupOperationCallable); - Mockito.when(mockStub.createBackupCallable()).thenReturn(mockCreateBackupCallable); - Mockito.when(mockStub.getBackupCallable()).thenReturn(mockGetBackupCallable); - Mockito.when(mockStub.listBackupsPagedCallable()).thenReturn(mockListBackupCallable); - Mockito.when(mockStub.updateBackupCallable()).thenReturn(mockUpdateBackupCallable); - Mockito.when(mockStub.deleteBackupCallable()).thenReturn(mockDeleteBackupCallable); - Mockito.when(mockStub.restoreTableCallable()).thenReturn(mockRestoreTableCallable); - Mockito.when(mockStub.restoreTableOperationCallable()) - .thenReturn(mockRestoreTableOperationCallable); - Mockito.when(mockStub.getIamPolicyCallable()).thenReturn(mockGetIamPolicyCallable); - Mockito.when(mockStub.setIamPolicyCallable()).thenReturn(mockSetIamPolicyCallable); - Mockito.when(mockStub.testIamPermissionsCallable()).thenReturn(mockTestIamPermissionsCallable); - } - - @Test - public void close() { - adminClient.close(); - Mockito.verify(mockStub).close(); - } - - @Test - public void testCreateTable() { - // Setup - com.google.bigtable.admin.v2.CreateTableRequest expectedRequest = - com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() - .setParent(INSTANCE_NAME) - .setTableId(TABLE_ID) - .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)); - - // Verify - assertThat(result).isEqualTo(Table.fromProto(expectedResponse)); - } - - @Test - public void testModifyFamilies() { - // Setup - 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()))) - .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()) - .build(); - - Mockito.when(mockModifyTableCallable.futureCall(expectedRequest)) - .thenReturn(ApiFutures.immediateFuture(fakeResponse)); - - // Execute - Table actualResult = - adminClient.modifyFamilies(ModifyColumnFamiliesRequest.of(TABLE_ID).addFamily("cf")); - - // Verify - assertThat(actualResult).isEqualTo(Table.fromProto(fakeResponse)); - } - - @Test - public void testDeleteTable() { - // Setup - DeleteTableRequest expectedRequest = - DeleteTableRequest.newBuilder().setName(TABLE_NAME).build(); - - final AtomicBoolean wasCalled = new AtomicBoolean(false); - - Mockito.when(mockDeleteTableCallable.futureCall(expectedRequest)) - .thenAnswer( - new Answer>() { - @Override - public ApiFuture answer(InvocationOnMock invocationOnMock) { - wasCalled.set(true); - return ApiFutures.immediateFuture(Empty.getDefaultInstance()); - } - }); - - // Execute - adminClient.deleteTable(TABLE_ID); - - // Verify - assertThat(wasCalled.get()).isTrue(); - } - - @Test - public void testGetTable() { - // Setup - 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 testListTables() { - // Setup - 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.getNextPageToken()).thenReturn("next-page"); - 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 - 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( - new Answer>() { - @Override - public ApiFuture answer(InvocationOnMock invocationOnMock) { - wasCalled.set(true); - return ApiFutures.immediateFuture(expectedResponse); - } - }); - - // Execute - adminClient.dropRowRange(TABLE_ID, "rowKeyPrefix"); - - // Verify - assertThat(wasCalled.get()).isTrue(); - } - - @Test - public void testAwaitReplication() { - // Setup - TableName expectedRequest = TableName.parse(TABLE_NAME); - - final AtomicBoolean wasCalled = new AtomicBoolean(false); - - Mockito.when(mockAwaitReplicationCallable.futureCall(expectedRequest)) - .thenAnswer( - new Answer>() { - @Override - public ApiFuture answer(InvocationOnMock invocationOnMock) { - wasCalled.set(true); - return ApiFutures.immediateFuture(null); - } - }); - - // Execute - adminClient.awaitReplication(TABLE_ID); - - // Verify - assertThat(wasCalled.get()).isTrue(); - } - - @Test - public void testExistsTrue() { - // Setup - com.google.bigtable.admin.v2.Table expectedResponse = - com.google.bigtable.admin.v2.Table.newBuilder().setName(TABLE_NAME).build(); - - Mockito.when(mockGetTableCallable.futureCall(Matchers.any(GetTableRequest.class))) - .thenReturn(ApiFutures.immediateFuture(expectedResponse)); - - // Execute - boolean found = adminClient.exists(TABLE_ID); - - // Verify - assertThat(found).isTrue(); - } - - @Test - public void testExistsFalse() { - // Setup - NotFoundException exception = - new NotFoundException("fake error", null, GrpcStatusCode.of(Status.Code.NOT_FOUND), false); - - Mockito.when(mockGetTableCallable.futureCall(Matchers.any(GetTableRequest.class))) - .thenReturn( - ApiFutures.immediateFailedFuture(exception)); - - // Execute - boolean found = adminClient.exists(TABLE_ID); - - // Verify - assertThat(found).isFalse(); - } - - @Test - public void testCreateBackup() { - // Setup - 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); - 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 testGetBackup() { - // Setup - 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) - .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)); - } - - @Test - public void testUpdateBackup() { - // Setup - Timestamp expireTime = 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) - .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.getSizeBytes()).isEqualTo(sizeBytes); - } - - @Test - public void testRestoreTable() throws ExecutionException, InterruptedException { - // Setup - 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); - Mockito.when(mockRestoreTableCallable.futureCall(req.toProto(PROJECT_ID, INSTANCE_ID))) - .thenReturn( - ApiFutures.immediateFuture( - Operation.newBuilder() - .setMetadata( - Any.pack( - 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())) - .build())); - 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 testDeleteBackup() { - // Setup - 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 - 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.getNextPageToken()).thenReturn("next-page"); - 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 testGetBackupIamPolicy() { - // Setup - 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())) - .build()); - } - - @Test - public void testSetIamPolicy() { - // Setup - 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())) - .build()); - } - - @Test - public void testTestIamPermissions() { - // Setup - 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"); - } - - 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); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java new file mode 100644 index 0000000000..8104ee146c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java index 773bd56665..0aac3b8c99 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminSettingsTest.java @@ -24,11 +24,13 @@ 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; -import org.threeten.bp.Duration; @RunWith(JUnit4.class) public class BigtableTableAdminSettingsTest { @@ -93,9 +95,7 @@ public void testStubSettings() throws IOException { .containsExactly(Code.INVALID_ARGUMENT); assertThat( - builder - .build() - .toBuilder() + builder.build().toBuilder() .build() .getStubSettings() .createTableSettings() @@ -130,6 +130,26 @@ public void testStubSettings() throws IOException { "deleteBackupSettings", "restoreTableSettings", "restoreTableOperationSettings", + "undeleteTableSettings", + "undeleteTableOperationSettings", + "updateTableSettings", + "updateTableOperationSettings", + "copyBackupSettings", + "copyBackupOperationSettings", + "createAuthorizedViewSettings", + "createAuthorizedViewOperationSettings", + "updateAuthorizedViewSettings", + "updateAuthorizedViewOperationSettings", + "deleteAuthorizedViewSettings", + "listAuthorizedViewsSettings", + "getAuthorizedViewSettings", + "createSchemaBundleSettings", + "createSchemaBundleOperationSettings", + "updateSchemaBundleSettings", + "updateSchemaBundleOperationSettings", + "getSchemaBundleSettings", + "listSchemaBundlesSettings", + "deleteSchemaBundleSettings" }; @Test @@ -149,23 +169,25 @@ public void testToString() throws IOException { stubSettings .getBackupSettings() .setRetrySettings( - RetrySettings.newBuilder().setTotalTimeout(Duration.ofMinutes(812)).build()); + 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("totalTimeout=PT13H32M"); - assertThat(settings.toString()).contains("totalTimeout=PT13H32M"); - - int nonStaticFields = 0; - for (Field field : BigtableTableAdminStubSettings.class.getDeclaredFields()) { - if (!Modifier.isStatic(field.getModifiers())) { - nonStaticFields++; - } - } + 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(SETTINGS_LIST.length).isEqualTo(nonStaticFields); + assertThat(nonStaticFields).containsExactlyElementsIn(SETTINGS_LIST); } void checkToString(BigtableTableAdminSettings settings) { @@ -179,6 +201,6 @@ void checkToString(BigtableTableAdminSettings settings) { for (String subSettings : SETTINGS_LIST) { assertThat(toString).contains(subSettings + "="); } - assertThat(toString.contains(settings.getStubSettings().toString())); + assertThat(toString).contains(settings.getStubSettings().toString()); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/HiddenGapicApiTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/HiddenGapicApiTest.java deleted file mode 100644 index 354a725b6e..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/HiddenGapicApiTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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; - -import static com.google.common.truth.Truth.assertWithMessage; - -import com.google.api.core.InternalApi; -import com.google.cloud.bigtable.admin.v2.stub.BigtableInstanceAdminStub; -import com.google.cloud.bigtable.admin.v2.stub.BigtableTableAdminStub; -import com.google.cloud.bigtable.admin.v2.stub.GrpcBigtableInstanceAdminCallableFactory; -import com.google.cloud.bigtable.admin.v2.stub.GrpcBigtableInstanceAdminStub; -import com.google.cloud.bigtable.admin.v2.stub.GrpcBigtableTableAdminCallableFactory; -import com.google.cloud.bigtable.admin.v2.stub.GrpcBigtableTableAdminStub; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * Tests that the underlying GAPIC api is marked as {@code @InternalApi}. This transformation - * happens in synth.py. - */ -@RunWith(Parameterized.class) -public class HiddenGapicApiTest { - private Class testClass; - - @Parameters - public static Object[] data() { - return new Object[] { - GrpcBigtableInstanceAdminCallableFactory.class, - GrpcBigtableInstanceAdminStub.class, - BaseBigtableInstanceAdminSettings.class, - GrpcBigtableTableAdminCallableFactory.class, - GrpcBigtableTableAdminStub.class, - BaseBigtableTableAdminSettings.class, - BigtableInstanceAdminStub.class, - BigtableTableAdminStub.class, - BaseBigtableInstanceAdminClient.class, - BaseBigtableTableAdminClient.class, - }; - } - - public HiddenGapicApiTest(Class testClass) { - this.testClass = testClass; - } - - @Test - public void test() { - assertWithMessage("%s should be annotated with @InternaOnly", testClass.getName()) - .that(testClass.getAnnotation(InternalApi.class)) - .isNotNull(); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java index 40b544556c..643504c3c8 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java index 95ffe9d66e..7a1d8d08a0 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,21 +23,38 @@ 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; @@ -88,7 +105,7 @@ public void reset() { @Override public void createInstance( CreateInstanceRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -100,7 +117,7 @@ public void createInstance( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateInstance, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -108,7 +125,7 @@ public void createInstance( @Override public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Instance) { requests.add(request); responseObserver.onNext(((Instance) response)); @@ -120,7 +137,7 @@ public void getInstance(GetInstanceRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetInstance, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Instance.class.getName(), Exception.class.getName()))); } @@ -129,7 +146,7 @@ public void getInstance(GetInstanceRequest request, StreamObserver res @Override public void listInstances( ListInstancesRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListInstancesResponse) { requests.add(request); responseObserver.onNext(((ListInstancesResponse) response)); @@ -141,7 +158,7 @@ public void listInstances( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListInstances, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListInstancesResponse.class.getName(), Exception.class.getName()))); } @@ -149,7 +166,7 @@ public void listInstances( @Override public void updateInstance(Instance request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Instance) { requests.add(request); responseObserver.onNext(((Instance) response)); @@ -161,7 +178,7 @@ public void updateInstance(Instance request, StreamObserver responseOb new IllegalArgumentException( String.format( "Unrecognized response type %s for method UpdateInstance, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Instance.class.getName(), Exception.class.getName()))); } @@ -170,7 +187,7 @@ public void updateInstance(Instance request, StreamObserver responseOb @Override public void partialUpdateInstance( PartialUpdateInstanceRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -181,8 +198,9 @@ public void partialUpdateInstance( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method PartialUpdateInstance, expected %s or %s", - response.getClass().getName(), + "Unrecognized response type %s for method PartialUpdateInstance, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -191,7 +209,7 @@ public void partialUpdateInstance( @Override public void deleteInstance( DeleteInstanceRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -203,7 +221,7 @@ public void deleteInstance( new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteInstance, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -212,7 +230,7 @@ public void deleteInstance( @Override public void createCluster( CreateClusterRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -224,7 +242,7 @@ public void createCluster( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateCluster, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -232,7 +250,7 @@ public void createCluster( @Override public void getCluster(GetClusterRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Cluster) { requests.add(request); responseObserver.onNext(((Cluster) response)); @@ -244,7 +262,7 @@ public void getCluster(GetClusterRequest request, StreamObserver respon new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetCluster, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Cluster.class.getName(), Exception.class.getName()))); } @@ -253,7 +271,7 @@ public void getCluster(GetClusterRequest request, StreamObserver respon @Override public void listClusters( ListClustersRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListClustersResponse) { requests.add(request); responseObserver.onNext(((ListClustersResponse) response)); @@ -265,7 +283,7 @@ public void listClusters( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListClusters, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListClustersResponse.class.getName(), Exception.class.getName()))); } @@ -273,7 +291,7 @@ public void listClusters( @Override public void updateCluster(Cluster request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -285,7 +303,29 @@ public void updateCluster(Cluster request, StreamObserver responseObs new IllegalArgumentException( String.format( "Unrecognized response type %s for method UpdateCluster, expected %s or %s", - response.getClass().getName(), + 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()))); } @@ -293,7 +333,7 @@ public void updateCluster(Cluster request, StreamObserver responseObs @Override public void deleteCluster(DeleteClusterRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -305,7 +345,7 @@ public void deleteCluster(DeleteClusterRequest request, StreamObserver re new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteCluster, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -314,7 +354,7 @@ public void deleteCluster(DeleteClusterRequest request, StreamObserver re @Override public void createAppProfile( CreateAppProfileRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof AppProfile) { requests.add(request); responseObserver.onNext(((AppProfile) response)); @@ -326,7 +366,7 @@ public void createAppProfile( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateAppProfile, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), AppProfile.class.getName(), Exception.class.getName()))); } @@ -335,7 +375,7 @@ public void createAppProfile( @Override public void getAppProfile( GetAppProfileRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof AppProfile) { requests.add(request); responseObserver.onNext(((AppProfile) response)); @@ -347,7 +387,7 @@ public void getAppProfile( new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetAppProfile, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), AppProfile.class.getName(), Exception.class.getName()))); } @@ -356,7 +396,7 @@ public void getAppProfile( @Override public void listAppProfiles( ListAppProfilesRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListAppProfilesResponse) { requests.add(request); responseObserver.onNext(((ListAppProfilesResponse) response)); @@ -368,7 +408,7 @@ public void listAppProfiles( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListAppProfiles, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListAppProfilesResponse.class.getName(), Exception.class.getName()))); } @@ -377,7 +417,7 @@ public void listAppProfiles( @Override public void updateAppProfile( UpdateAppProfileRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -389,7 +429,7 @@ public void updateAppProfile( new IllegalArgumentException( String.format( "Unrecognized response type %s for method UpdateAppProfile, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -398,7 +438,7 @@ public void updateAppProfile( @Override public void deleteAppProfile( DeleteAppProfileRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -410,7 +450,7 @@ public void deleteAppProfile( new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteAppProfile, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -418,7 +458,7 @@ public void deleteAppProfile( @Override public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Policy) { requests.add(request); responseObserver.onNext(((Policy) response)); @@ -430,7 +470,7 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Policy.class.getName(), Exception.class.getName()))); } @@ -438,7 +478,7 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res @Override public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Policy) { requests.add(request); responseObserver.onNext(((Policy) response)); @@ -450,7 +490,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Policy.class.getName(), Exception.class.getName()))); } @@ -460,7 +500,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res public void testIamPermissions( TestIamPermissionsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof TestIamPermissionsResponse) { requests.add(request); responseObserver.onNext(((TestIamPermissionsResponse) response)); @@ -472,9 +512,245 @@ public void testIamPermissions( new IllegalArgumentException( String.format( "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", - response.getClass().getName(), + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java index 83f3bfff29..384f5a2d87 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdmin.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java index 26f51d89b0..a2fe476ea7 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,34 +17,51 @@ 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; @@ -94,7 +111,7 @@ public void reset() { @Override public void createTable(CreateTableRequest request, StreamObserver

  • responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Table) { requests.add(request); responseObserver.onNext(((Table) response)); @@ -106,7 +123,7 @@ public void createTable(CreateTableRequest request, StreamObserver
    respon new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateTable, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Table.class.getName(), Exception.class.getName()))); } @@ -115,7 +132,7 @@ public void createTable(CreateTableRequest request, StreamObserver
    respon @Override public void createTableFromSnapshot( CreateTableFromSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -126,8 +143,9 @@ public void createTableFromSnapshot( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method CreateTableFromSnapshot, expected %s or %s", - response.getClass().getName(), + "Unrecognized response type %s for method CreateTableFromSnapshot, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -136,7 +154,7 @@ public void createTableFromSnapshot( @Override public void listTables( ListTablesRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListTablesResponse) { requests.add(request); responseObserver.onNext(((ListTablesResponse) response)); @@ -148,7 +166,7 @@ public void listTables( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListTables, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListTablesResponse.class.getName(), Exception.class.getName()))); } @@ -156,7 +174,7 @@ public void listTables( @Override public void getTable(GetTableRequest request, StreamObserver
    responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Table) { requests.add(request); responseObserver.onNext(((Table) response)); @@ -168,15 +186,35 @@ public void getTable(GetTableRequest request, StreamObserver
    responseObse new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetTable, expected %s or %s", - response.getClass().getName(), + 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.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -188,7 +226,137 @@ public void deleteTable(DeleteTableRequest request, StreamObserver respon new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteTable, expected %s or %s", - response.getClass().getName(), + 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()))); } @@ -197,7 +365,7 @@ public void deleteTable(DeleteTableRequest request, StreamObserver respon @Override public void modifyColumnFamilies( ModifyColumnFamiliesRequest request, StreamObserver
    responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Table) { requests.add(request); responseObserver.onNext(((Table) response)); @@ -208,8 +376,9 @@ public void modifyColumnFamilies( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method ModifyColumnFamilies, expected %s or %s", - response.getClass().getName(), + "Unrecognized response type %s for method ModifyColumnFamilies, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), Table.class.getName(), Exception.class.getName()))); } @@ -217,7 +386,7 @@ public void modifyColumnFamilies( @Override public void dropRowRange(DropRowRangeRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -229,7 +398,7 @@ public void dropRowRange(DropRowRangeRequest request, StreamObserver resp new IllegalArgumentException( String.format( "Unrecognized response type %s for method DropRowRange, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -239,7 +408,7 @@ public void dropRowRange(DropRowRangeRequest request, StreamObserver resp public void generateConsistencyToken( GenerateConsistencyTokenRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof GenerateConsistencyTokenResponse) { requests.add(request); responseObserver.onNext(((GenerateConsistencyTokenResponse) response)); @@ -250,8 +419,9 @@ public void generateConsistencyToken( responseObserver.onError( new IllegalArgumentException( String.format( - "Unrecognized response type %s for method GenerateConsistencyToken, expected %s or %s", - response.getClass().getName(), + "Unrecognized response type %s for method GenerateConsistencyToken, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), GenerateConsistencyTokenResponse.class.getName(), Exception.class.getName()))); } @@ -260,7 +430,7 @@ public void generateConsistencyToken( @Override public void checkConsistency( CheckConsistencyRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof CheckConsistencyResponse) { requests.add(request); responseObserver.onNext(((CheckConsistencyResponse) response)); @@ -272,7 +442,7 @@ public void checkConsistency( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CheckConsistency, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), CheckConsistencyResponse.class.getName(), Exception.class.getName()))); } @@ -281,7 +451,7 @@ public void checkConsistency( @Override public void snapshotTable( SnapshotTableRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -293,7 +463,7 @@ public void snapshotTable( new IllegalArgumentException( String.format( "Unrecognized response type %s for method SnapshotTable, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -301,7 +471,7 @@ public void snapshotTable( @Override public void getSnapshot(GetSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Snapshot) { requests.add(request); responseObserver.onNext(((Snapshot) response)); @@ -313,7 +483,7 @@ public void getSnapshot(GetSnapshotRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetSnapshot, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Snapshot.class.getName(), Exception.class.getName()))); } @@ -322,7 +492,7 @@ public void getSnapshot(GetSnapshotRequest request, StreamObserver res @Override public void listSnapshots( ListSnapshotsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListSnapshotsResponse) { requests.add(request); responseObserver.onNext(((ListSnapshotsResponse) response)); @@ -334,7 +504,7 @@ public void listSnapshots( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListSnapshots, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListSnapshotsResponse.class.getName(), Exception.class.getName()))); } @@ -343,7 +513,7 @@ public void listSnapshots( @Override public void deleteSnapshot( DeleteSnapshotRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -355,7 +525,7 @@ public void deleteSnapshot( new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteSnapshot, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -364,7 +534,7 @@ public void deleteSnapshot( @Override public void createBackup( CreateBackupRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -376,7 +546,7 @@ public void createBackup( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateBackup, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -384,7 +554,7 @@ public void createBackup( @Override public void getBackup(GetBackupRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Backup) { requests.add(request); responseObserver.onNext(((Backup) response)); @@ -396,7 +566,7 @@ public void getBackup(GetBackupRequest request, StreamObserver responseO new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetBackup, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Backup.class.getName(), Exception.class.getName()))); } @@ -404,7 +574,7 @@ public void getBackup(GetBackupRequest request, StreamObserver responseO @Override public void updateBackup(UpdateBackupRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Backup) { requests.add(request); responseObserver.onNext(((Backup) response)); @@ -416,7 +586,7 @@ public void updateBackup(UpdateBackupRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method UpdateBackup, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Backup.class.getName(), Exception.class.getName()))); } @@ -424,7 +594,7 @@ public void updateBackup(UpdateBackupRequest request, StreamObserver res @Override public void deleteBackup(DeleteBackupRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -436,7 +606,7 @@ public void deleteBackup(DeleteBackupRequest request, StreamObserver resp new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteBackup, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -445,7 +615,7 @@ public void deleteBackup(DeleteBackupRequest request, StreamObserver resp @Override public void listBackups( ListBackupsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListBackupsResponse) { requests.add(request); responseObserver.onNext(((ListBackupsResponse) response)); @@ -457,7 +627,7 @@ public void listBackups( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListBackups, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListBackupsResponse.class.getName(), Exception.class.getName()))); } @@ -466,7 +636,7 @@ public void listBackups( @Override public void restoreTable( RestoreTableRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -478,7 +648,27 @@ public void restoreTable( new IllegalArgumentException( String.format( "Unrecognized response type %s for method RestoreTable, expected %s or %s", - response.getClass().getName(), + 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()))); } @@ -486,7 +676,7 @@ public void restoreTable( @Override public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Policy) { requests.add(request); responseObserver.onNext(((Policy) response)); @@ -498,7 +688,7 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Policy.class.getName(), Exception.class.getName()))); } @@ -506,7 +696,7 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res @Override public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Policy) { requests.add(request); responseObserver.onNext(((Policy) response)); @@ -518,7 +708,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Policy.class.getName(), Exception.class.getName()))); } @@ -528,7 +718,7 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res public void testIamPermissions( TestIamPermissionsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof TestIamPermissionsResponse) { requests.add(request); responseObserver.onNext(((TestIamPermissionsResponse) response)); @@ -540,9 +730,115 @@ public void testIamPermissions( new IllegalArgumentException( String.format( "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", - response.getClass().getName(), + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/TypeProtos.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/TypeProtos.java new file mode 100644 index 0000000000..f8fd3549f8 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java index a452a2bc55..c2d8321407 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/internal/NameUtilTest.java @@ -16,25 +16,25 @@ package com.google.cloud.bigtable.admin.v2.internal; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertThrows; -import org.junit.Rule; +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.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class NameUtilTest { - @Rule public ExpectedException exception = ExpectedException.none(); - @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"); - exception.expect(IllegalArgumentException.class); - NameUtil.extractBackupIdFromBackupName("bad-format"); + assertThrows( + IllegalArgumentException.class, () -> NameUtil.extractBackupIdFromBackupName("bad-format")); } @Test @@ -45,4 +45,178 @@ public void formatBackupNameTest() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java new file mode 100644 index 0000000000..2a351fc831 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java index 94246034ba..eabaa128bc 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableBackupIT.java @@ -18,41 +18,47 @@ 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 io.grpc.Status.Code.NOT_FOUND; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertThrows; import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.gax.rpc.ApiException; +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.Type; +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.RowMutation; -import com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv; +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.Lists; -import com.google.protobuf.Timestamp; -import io.grpc.StatusRuntimeException; +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.*; +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; @@ -60,73 +66,59 @@ @RunWith(JUnit4.class) public class BigtableBackupIT { - @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + @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 final int[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; - - private static final String TEST_TABLE_SUFFIX = "test-table-for-backup-it"; - private static final String TEST_BACKUP_SUFFIX = "test-backup-for-backup-it"; - private static BigtableTableAdminClient tableAdmin; + private static BigtableTableAdminClient tableAdminHot; private static BigtableInstanceAdminClient instanceAdmin; private static BigtableDataClient dataClient; - private static String targetInstance; private static String targetCluster; + private static String targetClusterHot; private static Table testTable; - private static String prefix; + private static Table testTableHot; + private static Instance testInstance; @BeforeClass - public static void createClient() - throws IOException, InterruptedException, ExecutionException, TimeoutException { + 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(); - - targetCluster = AbstractTestEnv.TEST_CLUSTER_PREFIX + Instant.now().getEpochSecond(); - targetInstance = - AbstractTestEnv.TEST_INSTANCE_PREFIX + "backup-" + Instant.now().getEpochSecond(); - - instanceAdmin.createInstance( - CreateInstanceRequest.of(targetInstance) - .addCluster(targetCluster, testEnvRule.env().getPrimaryZone(), 3, StorageType.SSD) - .setDisplayName("backups-test-instance") - .addLabel("state", "readytodelete") - .setType(Type.PRODUCTION)); - - // Setup a prefix to avoid collisions between concurrent test runs - prefix = String.format("020%d", System.currentTimeMillis()); - - tableAdmin = testEnvRule.env().getTableAdminClientForInstance(targetInstance); - - testTable = - tableAdmin.createTable( - CreateTableRequest.of(generateId(TEST_TABLE_SUFFIX)).addFamily("cf1")); - - // Populate test data. - dataClient = testEnvRule.env().getDataClientForInstance(targetInstance); - byte[] rowBytes = new byte[1024]; - Random random = new Random(); - random.nextBytes(rowBytes); - - List> futures = Lists.newArrayList(); - for (int i = 0; i < 10; i++) { - ApiFuture future = - dataClient.mutateRowAsync( - RowMutation.create(testTable.getId(), "test-row-" + i) - .setCell("cf1", "", rowBytes.toString())); - futures.add(future); - } - ApiFutures.allAsList(futures).get(3, TimeUnit.MINUTES); + 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 closeClient() { + public static void tearDownClass() { if (testTable != null) { try { tableAdmin.deleteTable(testTable.getId()); @@ -134,32 +126,34 @@ public static void closeClient() { // Ignore. } } - - if (targetInstance != null) { - instanceAdmin.deleteInstance(targetInstance); - } - - if (tableAdmin != null) { - tableAdmin.close(); + if (testInstance != null) { + try { + instanceAdmin.deleteInstance(testInstance.getId()); + } catch (Exception e) { + LOGGER.log(Level.WARNING, "Failed to clean up instance ", e); + } } + } - if (dataClient != null) { - dataClient.close(); + 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 } } - @Before - public void setup() { - if (tableAdmin == null) { - throw new AssumptionViolatedException( - "Required properties are not set, skipping integration tests."); - } + private void deleteBackupIgnoreErrors(String clusterId, String backupId) { + deleteBackupIgnoreErrors(tableAdmin, clusterId, backupId); } @Test - public void createAndGetBackupTest() throws InterruptedException { - Instant expireTime = Instant.now().plus(Duration.ofDays(15)); - String backupId = generateId(TEST_BACKUP_SUFFIX); + public void createAndGetBackupTest() { + String backupId = prefixGenerator.newPrefix(); + Instant expireTime = Instant.now().plus(Duration.ofHours(6)); + CreateBackupRequest request = CreateBackupRequest.of(targetCluster, backupId) .setSourceTableId(testTable.getId()) @@ -188,7 +182,7 @@ public void createAndGetBackupTest() throws InterruptedException { .isEqualTo(expireTime); assertWithMessage("Got empty start time in GetBackup API") .that(result.getStartTime()) - .isNotEqualTo(Timestamp.getDefaultInstance()); + .isNotNull(); assertWithMessage("Got wrong size bytes in GetBackup API") .that(result.getSizeBytes()) .isEqualTo(0L); @@ -197,14 +191,74 @@ public void createAndGetBackupTest() throws InterruptedException { .isAnyOf(Backup.State.CREATING, Backup.State.READY); } finally { - tableAdmin.deleteBackup(targetCluster, backupId); + 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() throws InterruptedException { - String backupId1 = generateId("list-1-" + TEST_BACKUP_SUFFIX); - String backupId2 = generateId("list-2-" + TEST_BACKUP_SUFFIX); + public void listBackupTest() { + String backupId1 = prefixGenerator.newPrefix(); + String backupId2 = prefixGenerator.newPrefix(); try { tableAdmin.createBackup(createBackupRequest(backupId1)); @@ -217,56 +271,51 @@ public void listBackupTest() throws InterruptedException { .that(response) .containsAtLeast(backupId1, backupId2); } finally { - tableAdmin.deleteBackup(targetCluster, backupId1); - tableAdmin.deleteBackup(targetCluster, backupId2); + deleteBackupIgnoreErrors(targetCluster, backupId1); + deleteBackupIgnoreErrors(targetCluster, backupId2); } } @Test - public void updateBackupTest() throws InterruptedException { - String backupId = generateId("update-" + TEST_BACKUP_SUFFIX); - tableAdmin.createBackup(createBackupRequest(backupId)); + 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(targetCluster, backupId).setExpireTime(expireTime); + UpdateBackupRequest.of(targetClusterHot, backupId) + .setExpireTime(expireTime) + .clearHotToStandardTime(); try { - Backup backup = tableAdmin.updateBackup(req); + 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 { - tableAdmin.deleteBackup(targetCluster, backupId); + deleteBackupIgnoreErrors(tableAdminHot, targetClusterHot, backupId); } } @Test - public void deleteBackupTest() throws InterruptedException { - String backupId = generateId("delete-" + TEST_BACKUP_SUFFIX); + public void deleteBackupTest() { + String backupId = prefixGenerator.newPrefix(); tableAdmin.createBackup(createBackupRequest(backupId)); tableAdmin.deleteBackup(targetCluster, backupId); - try { - for (int i = 0; i < BACKOFF_DURATION.length; i++) { - tableAdmin.getBackup(targetCluster, backupId); - - LOGGER.info("Wait for " + BACKOFF_DURATION[i] + " seconds for deleting backup " + backupId); - Thread.sleep(BACKOFF_DURATION[i] * 1000); - } - fail("backup was not deleted."); - } catch (ApiException ex) { - assertWithMessage("Incorrect exception type") - .that(ex.getCause()) - .isInstanceOf(StatusRuntimeException.class); - assertWithMessage("Incorrect error message") - .that(((StatusRuntimeException) ex.getCause()).getStatus().getCode()) - .isEqualTo(NOT_FOUND); - } + assertThrows(NotFoundException.class, () -> tableAdmin.getBackup(targetCluster, backupId)); } @Test public void restoreTableTest() throws InterruptedException, ExecutionException { - String backupId = generateId("restore-" + TEST_BACKUP_SUFFIX); - String tableId = generateId("restored-table"); + 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 @@ -274,30 +323,188 @@ public void restoreTableTest() throws InterruptedException, ExecutionException { Thread.sleep(120 * 1000); try { - RestoreTableRequest req = RestoreTableRequest.of(targetCluster, backupId).setTableId(tableId); + RestoreTableRequest req = + RestoreTableRequest.of(targetCluster, backupId).setTableId(restoredTableId); RestoredTableResult result = tableAdmin.restoreTable(req); assertWithMessage("Incorrect restored table id") .that(result.getTable().getId()) - .isEqualTo(tableId); + .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(tableId); + Table restoredTable = tableAdmin.getTable(restoredTableId); assertWithMessage("Incorrect restored table id") .that(restoredTable.getId()) - .isEqualTo(tableId); + .isEqualTo(restoredTableId); } } finally { - tableAdmin.deleteBackup(targetCluster, backupId); - tableAdmin.deleteTable(tableId); + deleteBackupIgnoreErrors(targetCluster, backupId); + tableAdmin.deleteTable(restoredTableId); } } @Test - public void backupIamTest() throws InterruptedException { - String backupId = generateId("iam-" + TEST_BACKUP_SUFFIX); + 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)); @@ -323,17 +530,37 @@ public void backupIamTest() throws InterruptedException { "bigtable.backups.restore"); assertThat(permissions).hasSize(4); } finally { - tableAdmin.deleteBackup(targetCluster, backupId); + deleteBackupIgnoreErrors(targetCluster, backupId); } } - private CreateBackupRequest createBackupRequest(String backupName) { - return CreateBackupRequest.of(targetCluster, backupName) + private CreateBackupRequest createBackupRequest(String backupId) { + return CreateBackupRequest.of(targetCluster, backupId) .setSourceTableId(testTable.getId()) .setExpireTime(Instant.now().plus(Duration.ofDays(15))); } - private static String generateId(String name) { - return prefix + "-" + name; + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableCmekIT.java new file mode 100644 index 0000000000..4d3d05f5b4 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java index 9b41444c7f..0adc7462a7 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableInstanceAdminClientIT.java @@ -15,39 +15,46 @@ */ package com.google.cloud.bigtable.admin.v2.it; -import static com.google.cloud.bigtable.test_helpers.env.AbstractTestEnv.TEST_APP_PREFIX; 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.Instance.Type; +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.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 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; -import org.threeten.bp.Instant; @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; @@ -69,7 +76,7 @@ public void setUp() { @Test public void appProfileTest() { - String testAppProfile = TEST_APP_PREFIX + Instant.now().getEpochSecond(); + String testAppProfile = prefixGenerator.newPrefix(); AppProfile newlyCreatedAppProfile = client.createAppProfile( @@ -96,6 +103,224 @@ public void appProfileTest() { 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); @@ -118,15 +343,15 @@ public void iamUpdateTest() { /** To optimize test run time, instance & cluster creation is tested at the same time */ @Test public void instanceAndClusterCreationDeletionTest() { - String newInstanceId = AbstractTestEnv.TEST_INSTANCE_PREFIX + Instant.now().getEpochSecond(); - String newClusterId = newInstanceId + "-c1"; + 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(Type.PRODUCTION)); + .setType(Instance.Type.PRODUCTION)); try { assertThat(client.exists(newInstanceId)).isTrue(); @@ -155,13 +380,13 @@ public void instanceAndClusterCreationDeletionTest() { // 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 = AbstractTestEnv.TEST_CLUSTER_PREFIX + Instant.now().getEpochSecond(); + String newClusterId = prefixGenerator.newPrefix(); boolean isClusterDeleted = false; client.createCluster( CreateClusterRequest.of(newInstanceId, newClusterId) .setZone(testEnvRule.env().getSecondaryZone()) .setStorageType(StorageType.SSD) - .setServeNodes(3)); + .setScalingMode(StaticClusterSize.of(3))); try { assertThat(client.getCluster(newInstanceId, newClusterId)).isNotNull(); @@ -189,6 +414,215 @@ public void basicInstanceOperationTest() { 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); @@ -210,5 +644,40 @@ private void basicClusterOperationTestHelper(String targetInstanceId, String tar 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableLogicalViewIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableLogicalViewIT.java new file mode 100644 index 0000000000..89da11da3a --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableMaterializedViewIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableMaterializedViewIT.java new file mode 100644 index 0000000000..1ae8c7bd94 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableSchemaBundleIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableSchemaBundleIT.java new file mode 100644 index 0000000000..18473f2c36 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java index 2dc64b6407..e88ccbb9b6 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableTableAdminClientIT.java @@ -21,12 +21,14 @@ 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; @@ -34,7 +36,9 @@ 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; @@ -43,9 +47,9 @@ 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.TestName; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.threeten.bp.Duration; @@ -53,7 +57,7 @@ @RunWith(JUnit4.class) public class BigtableTableAdminClientIT { @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); - @Rule public final TestName testNameRule = new TestName(); + @Rule public final PrefixGenerator prefixGenerator = new PrefixGenerator(); private BigtableTableAdminClient tableAdmin; private String tableId; @@ -61,7 +65,7 @@ public class BigtableTableAdminClientIT { @Before public void setUp() { tableAdmin = testEnvRule.env().getTableAdminClient(); - tableId = testEnvRule.env().generateTableId(testNameRule.getMethodName()); + tableId = prefixGenerator.newPrefix(); } @After @@ -85,7 +89,8 @@ public void createTable() { .addFamily("cf1") .addFamily("cf2", GCRULES.maxVersions(10)) .addSplit(ByteString.copyFromUtf8("b")) - .addSplit(ByteString.copyFromUtf8("q")); + .addSplit(ByteString.copyFromUtf8("q")) + .addChangeStreamRetention(Duration.ofDays(2)); Table tableResponse = tableAdmin.createTable(createTableReq); assertEquals(tableId, tableResponse.getId()); @@ -98,6 +103,39 @@ public void createTable() { 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 @@ -186,9 +224,26 @@ public void dropRowRange() { } @Test - public void awaitReplication() { + 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)); - tableAdmin.awaitReplication(tableId); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forDataBoost(tableId); + tableAdmin.awaitConsistency(consistencyRequest); } @Test diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java index 5cc7c6cf3f..c0ad53b674 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AppProfileTest.java @@ -19,7 +19,10 @@ 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; @@ -48,6 +51,73 @@ public void testFromProto() { 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; @@ -73,4 +143,204 @@ public void testNoPolicyError() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedViewTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedViewTest.java new file mode 100644 index 0000000000..d5a87c7cfa --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java index be32058e23..2fc9ad2390 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/BackupTest.java @@ -17,9 +17,12 @@ 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; @@ -45,33 +48,87 @@ public void testBackupStateEnumUpToDate() { 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 diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfigTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterAutoscalingConfigTest.java new file mode 100644 index 0000000000..f36bacb675 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java index 20a143e097..f2f217ab56 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ClusterTest.java @@ -17,6 +17,8 @@ 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; @@ -32,7 +34,7 @@ public void testFromProto() { 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(com.google.bigtable.admin.v2.Cluster.State.READY) + .setState(State.READY) .setServeNodes(30) .setDefaultStorageType(com.google.bigtable.admin.v2.StorageType.SSD) .build(); @@ -45,6 +47,30 @@ public void testFromProto() { 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 diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.java new file mode 100644 index 0000000000..c3b99a4e68 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.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.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); + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CopyBackupRequestTest.java new file mode 100644 index 0000000000..df8830da8e --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java index 9b7141d3ab..32f882b30f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAppProfileRequestTest.java @@ -17,11 +17,14 @@ 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; @@ -71,4 +74,44 @@ public void testDefaultDescription() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateAuthorizedViewRequestTest.java new file mode 100644 index 0000000000..c661509cee --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java index f4a1e12f65..821919264e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateBackupRequestTest.java @@ -19,6 +19,7 @@ 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; @@ -35,13 +36,16 @@ public class CreateBackupRequestTest { 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); + .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() @@ -50,6 +54,9 @@ public void testToProto() { 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(); @@ -61,19 +68,33 @@ public void testEquality() { CreateBackupRequest request = CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) .setSourceTableId(TABLE_ID) - .setExpireTime(EXPIRE_TIME); + .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)); + .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)); + .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 @@ -81,13 +102,17 @@ public void testHashCode() { CreateBackupRequest request = CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) .setSourceTableId(TABLE_ID) - .setExpireTime(EXPIRE_TIME); + .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()) @@ -95,6 +120,17 @@ public void testHashCode() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java index 17152d5461..fe28948347 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateClusterRequestTest.java @@ -16,7 +16,10 @@ 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; @@ -125,6 +128,7 @@ public void testOptionalFields() { .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); @@ -139,6 +143,7 @@ public void testOptionalFields() { .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", @@ -151,4 +156,28 @@ public void testOptionalFields() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateLogicalViewRequestTest.java new file mode 100644 index 0000000000..eededde65b --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateMaterializedViewRequestTest.java new file mode 100644 index 0000000000..1a116f40fd --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateSchemaBundleRequestTest.java new file mode 100644 index 0000000000..2d37eccff5 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java index b12b3f24b7..cbc85c9d32 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java @@ -18,6 +18,7 @@ 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; @@ -46,7 +47,10 @@ public void testToProto() { .addFamily("family-id") .addFamily("another-family", GCRULES.maxAge(100, TimeUnit.HOURS)) .addSplit(splitKey) - .addSplit(secondSplitKey); + .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() @@ -63,7 +67,24 @@ public void testToProto() { com.google.protobuf.Duration.newBuilder() .setSeconds(100 * 60 * 60)) .build()) - .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)) @@ -74,12 +95,60 @@ public void testToProto() { 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) @@ -87,6 +156,7 @@ public void testEquality() { 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) @@ -94,6 +164,7 @@ public void testEquality() { CreateTableRequest.of(TABLE_ID) .addFamily("family-id") .addFamily("another-family") + .setAutomatedBackup(Duration.ofHours(100), Duration.ofHours(10)) .addSplit(splitKey)); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/EncryptionInfoTest.java new file mode 100644 index 0000000000..d0d077be3d --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsetsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/FamilySubsetsTest.java new file mode 100644 index 0000000000..bfcc62fe9c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java index 61a1527a34..b949851ca1 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GCRulesTest.java @@ -90,7 +90,6 @@ public void durationTimeUnitNegative() { public void versions() { VersionRule actual = GCRULES.maxVersions(10); GcRule expected = buildVersionsRule(10); - assertNotNull(actual.getMaxVersions()); assertThat(actual.toProto()).isEqualTo(expected); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilderTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilderTest.java new file mode 100644 index 0000000000..aafcc7b1d4 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java index 78fdf15b03..35b776fbe4 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/InstanceTest.java @@ -36,6 +36,8 @@ public void testFromProto() { .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); @@ -48,6 +50,8 @@ public void testFromProto() { .containsExactly( "label1", "value1", "label2", "value2"); + assertThat(result.getTags()) + .containsExactly("tagKeys/123", "tagValues/456", "tagKeys/234", "tagValues/567"); } @Test @@ -59,6 +63,7 @@ public void testRequiresName() { .setState(com.google.bigtable.admin.v2.Instance.State.READY) .putLabels("label1", "value1") .putLabels("label2", "value2") + .putTags("tagKeys/123", "tagValues/456") .build(); Exception actualException = null; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/LogicalViewTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/LogicalViewTest.java new file mode 100644 index 0000000000..4e6111f370 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/MaterializedViewTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/MaterializedViewTest.java new file mode 100644 index 0000000000..a7a3c01718 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java index 3ed165042c..30a2274c7e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java @@ -30,6 +30,8 @@ public class RestoreTableRequestTest { 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() { @@ -45,6 +47,38 @@ public void testToProto() { 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 = @@ -56,6 +90,40 @@ public void testEquality() { .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 = @@ -66,4 +134,43 @@ public void testHashCode() { .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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundleTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SchemaBundleTest.java new file mode 100644 index 0000000000..f83bc7dcc4 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSizeTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/StaticClusterSizeTest.java new file mode 100644 index 0000000000..71b1d1bc95 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SubsetViewTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/SubsetViewTest.java new file mode 100644 index 0000000000..9f5ed078ee --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java index 21366854cd..ff5c40d4b4 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableAdminRequestsTest.java @@ -78,6 +78,14 @@ public void modifyFamilies() { .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); @@ -103,6 +111,62 @@ public void modifyFamilies() { .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") diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java index b94be17e7f..c5821fb9eb 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TableTest.java @@ -16,6 +16,7 @@ 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; @@ -67,6 +68,14 @@ public void testFromProto() { .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); @@ -78,6 +87,20 @@ public void testFromProto() { "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()) diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TypeTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/TypeTest.java new file mode 100644 index 0000000000..c08415a5c1 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java index ae3119b81a..1ca24201ae 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequestTest.java @@ -17,9 +17,13 @@ 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; @@ -76,4 +80,97 @@ public void testUpdateExisting() { .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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateAuthorizedViewRequestTest.java new file mode 100644 index 0000000000..06c9a8353e --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java index c8d34833f3..c2df69ca56 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateBackupRequestTest.java @@ -29,19 +29,20 @@ @RunWith(JUnit4.class) public class UpdateBackupRequestTest { - - 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 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); + 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() @@ -50,8 +51,14 @@ public void testToProto() { .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()) - .setUpdateMask(FieldMask.newBuilder().addPaths("expire_time").build()) .build(); assertThat(request.toProto(PROJECT_ID, INSTANCE_ID)).isEqualTo(requestProto); } @@ -59,22 +66,49 @@ public void testToProto() { @Test public void testEquality() { UpdateBackupRequest request = - UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID).setExpireTime(EXPIRE_TIME); + 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) - .isEqualTo(UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID).setExpireTime(EXPIRE_TIME)); + .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_2)); + .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); + 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).hashCode()); + 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_2).hashCode()); + UpdateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setExpireTime(EXPIRE_TIME) + .clearHotToStandardTime() + .hashCode()); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java index b5561769b6..5793ce6993 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateInstanceRequestTest.java @@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat; import com.google.bigtable.admin.v2.Instance; -import com.google.bigtable.admin.v2.Instance.Type; import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; import com.google.common.collect.ImmutableMap; import com.google.protobuf.FieldMask; @@ -98,7 +97,7 @@ public void testType() { .setInstance( Instance.newBuilder() .setName("projects/my-project/instances/my-instance") - .setType(Type.PRODUCTION)) + .setType(Instance.Type.PRODUCTION)) .build(); assertThat(actual).isEqualTo(expected); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateLogicalViewRequestTest.java new file mode 100644 index 0000000000..da54bb5ac1 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateMaterializedViewRequestTest.java new file mode 100644 index 0000000000..17cbecea9a --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateSchemaBundleRequestTest.java new file mode 100644 index 0000000000..994d56068a --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java new file mode 100644 index 0000000000..059999210d --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallableTest.java similarity index 54% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallableTest.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallableTest.java index f5aedb5c6f..52e8956a0d 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitReplicationCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallableTest.java @@ -31,21 +31,37 @@ 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.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; import org.threeten.bp.Duration; -@RunWith(MockitoJUnitRunner.class) -public class AwaitReplicationCallableTest { - private static final TableName TABLE_NAME = TableName.of("my-project", "my-instance", "my-table"); +@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 @@ -55,7 +71,9 @@ public class AwaitReplicationCallableTest { private UnaryCallable mockCheckConsistencyCallable; - private AwaitReplicationCallable callable; + private AwaitReplicationCallable awaitReplicationCallable; + + private AwaitConsistencyCallable awaitConsistencyCallable; @Before public void setUp() { @@ -75,12 +93,14 @@ public void setUp() { .setRpcTimeoutMultiplier(1.0) .build(); - callable = - AwaitReplicationCallable.create( + awaitConsistencyCallable = + AwaitConsistencyCallable.create( mockGenerateConsistencyTokenCallable, mockCheckConsistencyCallable, clientContext, - retrySettings); + retrySettings, + REQUEST_CONTEXT); + awaitReplicationCallable = AwaitReplicationCallable.create(awaitConsistencyCallable); } @Test @@ -92,7 +112,8 @@ public void testGenerateFailure() throws Exception { Mockito.when(mockGenerateConsistencyTokenCallable.futureCall(expectedRequest, CALL_CONTEXT)) .thenReturn(ApiFutures.immediateFailedFuture(fakeError)); - ApiFuture future = callable.futureCall(TABLE_NAME, CALL_CONTEXT); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture future = awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); Throwable actualError = null; @@ -119,6 +140,7 @@ public void testCheckFailure() throws Exception { CheckConsistencyRequest.newBuilder() .setName(TABLE_NAME.toString()) .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) .build(); FakeApiException expectedError = new FakeApiException("fake", null, Code.INTERNAL, false); @@ -126,7 +148,8 @@ public void testCheckFailure() throws Exception { Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) .thenReturn(ApiFutures.immediateFailedFuture(expectedError)); - ApiFuture future = callable.futureCall(TABLE_NAME, CALL_CONTEXT); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture future = awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); Throwable actualError = null; @@ -154,6 +177,7 @@ public void testImmediatelyConsistent() throws Exception { CheckConsistencyRequest.newBuilder() .setName(TABLE_NAME.toString()) .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) .build(); CheckConsistencyResponse expectedResponse2 = CheckConsistencyResponse.newBuilder().setConsistent(true).build(); @@ -161,7 +185,9 @@ public void testImmediatelyConsistent() throws Exception { Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) .thenReturn(ApiFutures.immediateFuture(expectedResponse2)); - ApiFuture consistentFuture = callable.futureCall(TABLE_NAME, CALL_CONTEXT); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture consistentFuture = + awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); consistentFuture.get(1, TimeUnit.MILLISECONDS); } @@ -181,6 +207,7 @@ public void testPolling() throws Exception { CheckConsistencyRequest.newBuilder() .setName(TABLE_NAME.toString()) .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) .build(); CheckConsistencyResponse expectedResponse2 = @@ -193,7 +220,9 @@ public void testPolling() throws Exception { .thenReturn(ApiFutures.immediateFuture(expectedResponse2)) .thenReturn(ApiFutures.immediateFuture(expectedResponse3)); - ApiFuture consistentFuture = callable.futureCall(TABLE_NAME, CALL_CONTEXT); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture consistentFuture = + awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); consistentFuture.get(1, TimeUnit.SECONDS); } @@ -213,6 +242,7 @@ public void testPollingTimeout() throws Exception { CheckConsistencyRequest.newBuilder() .setName(TABLE_NAME.toString()) .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) .build(); CheckConsistencyResponse expectedResponse2 = @@ -221,7 +251,9 @@ public void testPollingTimeout() throws Exception { Mockito.when(mockCheckConsistencyCallable.futureCall(expectedRequest2, CALL_CONTEXT)) .thenReturn(ApiFutures.immediateFuture(expectedResponse2)); - ApiFuture consistentFuture = callable.futureCall(TABLE_NAME, CALL_CONTEXT); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(TABLE_ID); + ApiFuture consistentFuture = + awaitConsistencyCallable.futureCall(consistencyRequest, CALL_CONTEXT); Throwable actualError = null; try { @@ -232,4 +264,100 @@ public void testPollingTimeout() throws Exception { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/StatusTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/StatusTest.java new file mode 100644 index 0000000000..3eb867d199 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/TypeTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/TypeTest.java new file mode 100644 index 0000000000..543a085008 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java index 25c341d650..30a4853a61 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientFactoryTest.java @@ -19,30 +19,44 @@ 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.bigtable.v2.RowFilter; -import com.google.bigtable.v2.RowSet; 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.protobuf.ByteString; +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.util.LinkedList; -import java.util.List; +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; @@ -64,42 +78,55 @@ public class BigtableDataClientFactoryTest { private static final String DEFAULT_INSTANCE_ID = "fake-instance"; private static final String DEFAULT_APP_PROFILE_ID = "fake-app-profile"; - private FakeServiceHelper serviceHelper; + private Server server; private FakeBigtableService service; private TransportChannelProvider transportChannelProvider; private CredentialsProvider credentialsProvider; private ExecutorProvider executorProvider; private WatchdogProvider watchdogProvider; - private ApiClock apiClock; private BigtableDataSettings defaultSettings; - private int port; - private final BlockingQueue setUpAttributes = new LinkedBlockingDeque<>(); 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(); - ServerTransportFilter transportFilter = - new ServerTransportFilter() { - @Override - public Attributes transportReady(Attributes transportAttrs) { - setUpAttributes.add(transportAttrs); - return super.transportReady(transportAttrs); - } - - @Override - public void transportTerminated(Attributes transportAttrs) { - terminateAttributes.add(transportAttrs); - } - }; - serviceHelper = new FakeServiceHelper(null, transportFilter, service); - port = serviceHelper.getPort(); - serviceHelper.start(); + 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(port) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(DEFAULT_PROJECT_ID) .setInstanceId(DEFAULT_INSTANCE_ID) .setAppProfileId(DEFAULT_APP_PROFILE_ID); @@ -121,7 +148,7 @@ public void transportTerminated(Attributes transportAttrs) { Mockito.mock( ExecutorProvider.class, new BuilderAnswer<>( - ExecutorProvider.class, builder.stubSettings().getExecutorProvider())); + ExecutorProvider.class, builder.stubSettings().getBackgroundExecutorProvider())); watchdogProvider = Mockito.mock( @@ -129,13 +156,13 @@ public void transportTerminated(Attributes transportAttrs) { new BuilderAnswer<>( WatchdogProvider.class, builder.stubSettings().getStreamWatchdogProvider())); - apiClock = builder.stubSettings().getClock(); + ApiClock apiClock = builder.stubSettings().getClock(); builder .stubSettings() .setTransportChannelProvider(transportChannelProvider) .setCredentialsProvider(credentialsProvider) - .setExecutorProvider(executorProvider) + .setBackgroundExecutorProvider(executorProvider) .setStreamWatchdogProvider(watchdogProvider) .setClock(apiClock); @@ -144,22 +171,27 @@ public void transportTerminated(Attributes transportAttrs) { @After public void tearDown() { - serviceHelper.shutdown(); + server.shutdown(); } @Test public void testNewClientsShareTransportChannel() throws Exception { - // Create 3 lightweight clients - - try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); + 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(); - Mockito.verify(credentialsProvider, Mockito.times(1)).getCredentials(); + // 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(); } @@ -170,7 +202,7 @@ public void testCreateDefaultKeepsSettings() throws Exception { try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); BigtableDataClient client = factory.createDefault()) { - client.mutateRow(RowMutation.create("some-table", "some-key").deleteRow()); + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); } assertThat(service.lastRequest.getTableName()) @@ -183,7 +215,7 @@ public void testCreateForAppProfileHasCorrectSettings() throws Exception { try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); BigtableDataClient client = factory.createForAppProfile("other-app-profile")) { - client.mutateRow(RowMutation.create("some-table", "some-key").deleteRow()); + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); } assertThat(service.lastRequest.getTableName()) @@ -197,7 +229,7 @@ public void testCreateForInstanceHasCorrectSettings() throws Exception { try (BigtableDataClientFactory factory = BigtableDataClientFactory.create(defaultSettings); BigtableDataClient client = factory.createForInstance("other-project", "other-instance")) { - client.mutateRow(RowMutation.create("some-table", "some-key").deleteRow()); + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); } assertThat(service.lastRequest.getTableName()) @@ -212,7 +244,7 @@ public void testCreateForInstanceWithAppProfileHasCorrectSettings() throws Excep BigtableDataClient client = factory.createForInstance("other-project", "other-instance", "other-app-profile")) { - client.mutateRow(RowMutation.create("some-table", "some-key").deleteRow()); + client.mutateRow(RowMutation.create(TableId.of("some-table"), "some-key").deleteRow()); } assertThat(service.lastRequest.getTableName()) @@ -223,24 +255,24 @@ public void testCreateForInstanceWithAppProfileHasCorrectSettings() throws Excep @Test public void testCreateWithRefreshingChannel() throws Exception { - String[] tableIds = {"fake-table1", "fake-table2"}; int poolSize = 3; + // TODO: remove the suppression when setRefreshingChannel can be removed + @SuppressWarnings("deprecation") BigtableDataSettings.Builder builder = - BigtableDataSettings.newBuilderForEmulator(port) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(DEFAULT_PROJECT_ID) .setInstanceId(DEFAULT_INSTANCE_ID) .setAppProfileId(DEFAULT_APP_PROFILE_ID) - .setPrimingTableIds(tableIds) .setRefreshingChannel(true); builder .stubSettings() .setCredentialsProvider(credentialsProvider) .setStreamWatchdogProvider(watchdogProvider) - .setExecutorProvider(executorProvider); + .setBackgroundExecutorProvider(executorProvider); InstantiatingGrpcChannelProvider channelProvider = (InstantiatingGrpcChannelProvider) builder.stubSettings().getTransportChannelProvider(); InstantiatingGrpcChannelProvider.Builder channelProviderBuilder = channelProvider.toBuilder(); - channelProviderBuilder.setPoolSize(poolSize); + channelProviderBuilder.setChannelPoolSettings(ChannelPoolSettings.staticallySized(poolSize)); builder.stubSettings().setTransportChannelProvider(channelProviderBuilder.build()); BigtableDataClientFactory factory = BigtableDataClientFactory.create(builder.build()); @@ -248,61 +280,178 @@ public void testCreateWithRefreshingChannel() throws Exception { factory.createForAppProfile("other-appprofile"); factory.createForInstance("other-project", "other-instance"); - // Make sure that only 1 instance is created for all clients - Mockito.verify(credentialsProvider, Mockito.times(1)).getCredentials(); + // 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); - // Make sure that the clients are sharing the same ChannelPool - assertThat(setUpAttributes).hasSize(poolSize); - - // Make sure that prime requests were sent only once per table per connection - assertThat(service.readRowsRequests).hasSize(poolSize * tableIds.length); - List expectedRequests = new LinkedList<>(); - for (String tableId : tableIds) { - for (int i = 0; i < poolSize; i++) { - expectedRequests.add( - ReadRowsRequest.newBuilder() - .setTableName( - String.format( - "projects/%s/instances/%s/tables/%s", - DEFAULT_PROJECT_ID, DEFAULT_INSTANCE_ID, tableId)) - .setAppProfileId(DEFAULT_APP_PROFILE_ID) - .setRows( - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("nonexistent-priming-row"))) - .setFilter(RowFilter.newBuilder().setBlockAllFilter(true).build()) - .setRowsLimit(1) - .build()); - } - } - assertThat(service.readRowsRequests).containsExactly(expectedRequests.toArray()); + // 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; - BlockingQueue readRowsRequests = new LinkedBlockingDeque<>(); - private ApiFunction readRowsCallback = - new ApiFunction() { - @Override - public ReadRowsResponse apply(ReadRowsRequest readRowsRequest) { - return ReadRowsResponse.getDefaultInstance(); - } - }; + + private final ApiFunction readRowsCallback = + readRowsRequest -> ReadRowsResponse.getDefaultInstance(); + + private final ApiFunction pingAndWarmCallback = + pingAndWarmRequest -> PingAndWarmResponse.getDefaultInstance(); @Override public void readRows( ReadRowsRequest request, StreamObserver responseObserver) { try { - readRowsRequests.add(request); responseObserver.onNext(readRowsCallback.apply(request)); responseObserver.onCompleted(); } catch (RuntimeException e) { @@ -317,9 +466,16 @@ public void mutateRow( 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 static class BuilderAnswer implements Answer { private final Class targetClass; private T targetInstance; @@ -329,8 +485,9 @@ private BuilderAnswer(Class targetClass, T targetInstance) { this.targetInstance = targetInstance; } + @SuppressWarnings("unchecked") @Override - public Object answer(InvocationOnMock invocation) throws Throwable { + public T answer(InvocationOnMock invocation) throws Throwable { Method method = invocation.getMethod(); Object r = invocation.getMethod().invoke(targetInstance, invocation.getArguments()); @@ -339,7 +496,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable { this.targetInstance = castToTarget(r); r = invocation.getMock(); } - return r; + return (T) r; } @SuppressWarnings("unchecked") diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java deleted file mode 100644 index c3bf52b63f..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java +++ /dev/null @@ -1,469 +0,0 @@ -/* - * 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 static org.mockito.Matchers.any; - -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.models.BulkMutation; -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.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.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.List; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Answers; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.runners.MockitoJUnitRunner; -import org.mockito.stubbing.Answer; - -@RunWith(MockitoJUnitRunner.class) -public class BigtableDataClientTest { - @Mock private EnhancedBigtableStub mockStub; - - @Mock(answer = Answers.RETURNS_DEEP_STUBS) - private ServerStreamingCallable mockReadRowsCallable; - - @Mock private UnaryCallable mockReadRowCallable; - @Mock private UnaryCallable> mockSampleRowKeysCallable; - @Mock private UnaryCallable mockMutateRowCallable; - @Mock private UnaryCallable mockCheckAndMutateRowCallable; - @Mock private UnaryCallable mockReadModifyWriteRowCallable; - @Mock private UnaryCallable mockBulkMutateRowsCallable; - @Mock private Batcher mockBulkMutationBatcher; - @Mock private Batcher mockBulkReadRowsBatcher; - - private BigtableDataClient bigtableDataClient; - - @Before - public void setUp() { - bigtableDataClient = new BigtableDataClient(mockStub); - Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - Mockito.when(mockStub.sampleRowKeysCallable()).thenReturn(mockSampleRowKeysCallable); - Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); - Mockito.when(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); - Mockito.when(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); - Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); - Mockito.when(mockStub.newMutateRowsBatcher(Mockito.any(String.class))) - .thenReturn(mockBulkMutationBatcher); - Mockito.when(mockStub.newBulkReadRowsBatcher(Mockito.any(Query.class))) - .thenReturn(mockBulkReadRowsBatcher); - } - - @Test - public void proxyCloseTest() throws Exception { - bigtableDataClient.close(); - Mockito.verify(mockStub).close(); - } - - @Test - public void existsTest() { - Query expectedQuery = - Query.create("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("fake-table", "fake-row-key"); - boolean anotherResult = - bigtableDataClient.exists("fake-table", 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 { - Query expectedQuery = - Query.create("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("fake-table", ByteString.copyFromUtf8("fake-row-key")); - assertThat(result.get()).isTrue(); - - ApiFuture anotherResult = bigtableDataClient.existsAsync("fake-table", "fake-row-key"); - assertThat(anotherResult.get()).isFalse(); - - Mockito.verify(mockReadRowCallable, Mockito.times(2)).futureCall(expectedQuery); - } - - @Test - public void proxyReadRowsCallableTest() { - assertThat(bigtableDataClient.readRowsCallable()).isSameInstanceAs(mockReadRowsCallable); - } - - @Test - public void proxyReadRowAsyncTest() { - bigtableDataClient.readRowAsync("fake-table", ByteString.copyFromUtf8("fake-row-key")); - Mockito.verify(mockReadRowCallable) - .futureCall(Query.create("fake-table").rowKey("fake-row-key")); - } - - @Test - public void proxyReadRowStrAsyncTest() { - bigtableDataClient.readRowAsync("fake-table", "fake-row-key"); - Mockito.verify(mockReadRowCallable) - .futureCall(Query.create("fake-table").rowKey("fake-row-key")); - } - - @Test - public void readRowFilterAsyncTest() { - // Build the filter expression - Filter filter = - FILTERS - .chain() - .filter(FILTERS.qualifier().regex("prefix.*")) - .filter(FILTERS.limit().cellsPerRow(10)); - bigtableDataClient.readRowAsync("fake-table", ByteString.copyFromUtf8("fake-row-key"), filter); - - Mockito.verify(mockReadRowCallable) - .futureCall(Query.create("fake-table").rowKey("fake-row-key").filter(filter)); - } - - @Test - public void readRowFilterStrAsyncTest() { - // Build the filter expression - Filter filter = - FILTERS - .chain() - .filter(FILTERS.qualifier().regex("prefix.*")) - .filter(FILTERS.limit().cellsPerRow(10)); - bigtableDataClient.readRowAsync("fake-table", "fake-row-key", filter); - - Mockito.verify(mockReadRowCallable) - .futureCall(Query.create("fake-table").rowKey("fake-row-key").filter(filter)); - } - - @Test - public void readRowTest() { - Row expectedRow = - Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); - Mockito.when(mockReadRowCallable.futureCall(Query.create("fake-table").rowKey("fake-row-key"))) - .thenReturn(ApiFutures.immediateFuture(expectedRow)); - - Row actualRow = - bigtableDataClient.readRow("fake-table", ByteString.copyFromUtf8("fake-row-key")); - - assertThat(actualRow).isEqualTo(expectedRow); - } - - @Test - public void readRowStrTest() { - Row expectedRow = - Row.create(ByteString.copyFromUtf8("fake-row-key"), ImmutableList.of()); - Mockito.when(mockReadRowCallable.futureCall(Query.create("fake-table").rowKey("fake-row-key"))) - .thenReturn(ApiFutures.immediateFuture(expectedRow)); - - Row actualRow = bigtableDataClient.readRow("fake-table", "fake-row-key"); - - assertThat(actualRow).isEqualTo(expectedRow); - } - - @Test - public void readRowFilterTest() { - // 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("fake-table").rowKey("fake-row-key").filter(filter))) - .thenReturn(ApiFutures.immediateFuture(expectedRow)); - - Row actualRow = - bigtableDataClient.readRow("fake-table", ByteString.copyFromUtf8("fake-row-key"), filter); - - assertThat(actualRow).isEqualTo(expectedRow); - } - - @Test - public void readRowStrFilterTest() { - // 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("fake-table").rowKey("fake-row-key").filter(filter))) - .thenReturn(ApiFutures.immediateFuture(expectedRow)); - - Row actualRow = bigtableDataClient.readRow("fake-table", "fake-row-key", filter); - - assertThat(actualRow).isEqualTo(expectedRow); - } - - @Test - public void proxyReadRowsSyncTest() { - Query query = Query.create("fake-table"); - bigtableDataClient.readRows(query); - - Mockito.verify(mockReadRowsCallable).call(query); - } - - @Test - public void proxyReadRowsAsyncTest() { - Query query = Query.create("fake-table"); - @SuppressWarnings("unchecked") - ResponseObserver mockObserver = Mockito.mock(ResponseObserver.class); - bigtableDataClient.readRowsAsync(query, mockObserver); - - Mockito.verify(mockReadRowsCallable).call(query, mockObserver); - } - - @Test - public void proxySampleRowKeysCallableTest() { - assertThat(bigtableDataClient.sampleRowKeysCallable()) - .isSameInstanceAs(mockSampleRowKeysCallable); - } - - @Test - public void proxySampleRowKeysTest() { - bigtableDataClient.sampleRowKeysAsync("fake-table"); - Mockito.verify(mockSampleRowKeysCallable).futureCall("fake-table"); - } - - @Test - public void sampleRowKeysTest() { - Mockito.when(mockSampleRowKeysCallable.futureCall(any(String.class))) - .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); - bigtableDataClient.sampleRowKeys("fake-table"); - Mockito.verify(mockSampleRowKeysCallable).futureCall("fake-table"); - } - - @Test - public void proxyMutateRowCallableTest() { - assertThat(bigtableDataClient.mutateRowCallable()).isSameInstanceAs(mockMutateRowCallable); - } - - @Test - public void proxyMutateRowTest() { - RowMutation request = - RowMutation.create("fake-table", "some-key") - .setCell("some-family", "fake-qualifier", "fake-value"); - - bigtableDataClient.mutateRowAsync(request); - Mockito.verify(mockMutateRowCallable).futureCall(request); - } - - @Test - public void mutateRowTest() { - Mockito.when(mockMutateRowCallable.futureCall(any(RowMutation.class))) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocationOnMock) throws Throwable { - return ApiFutures.immediateFuture(Empty.getDefaultInstance()); - } - }); - - RowMutation request = - RowMutation.create("fake-table", "some-key") - .setCell("some-family", "fake-qualifier", "fake-value"); - - bigtableDataClient.mutateRow(request); - Mockito.verify(mockMutateRowCallable).futureCall(request); - } - - @Test - public void proxyBulkMutatesRowTest() { - BulkMutation request = - BulkMutation.create("fake-table") - .add( - "fake-key", - Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); - - bigtableDataClient.bulkMutateRowsAsync(request); - Mockito.verify(mockBulkMutateRowsCallable).futureCall(request); - } - - @Test - public void bulkMutatesRowTest() { - Mockito.when(mockBulkMutateRowsCallable.futureCall(any(BulkMutation.class))) - .thenAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocationOnMock) throws Throwable { - return ApiFutures.immediateFuture(Empty.getDefaultInstance()); - } - }); - - BulkMutation request = - BulkMutation.create("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 proxyNewBulkMutationBatcherTest() { - ApiFuture expectedResponse = ApiFutures.immediateFuture(null); - Batcher batcher = - bigtableDataClient.newBulkMutationBatcher("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(String.class)); - } - - @Test - public void proxyNewBulkReadRowsTest() { - ApiFuture expectedResponse = - ApiFutures.immediateFuture( - Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList())); - ByteString request = ByteString.copyFromUtf8("fake-row-key"); - - Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher("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)); - } - - @Test - public void proxyNewBulkReadRowsWithFilterTest() { - ApiFuture expectedResponse = - ApiFutures.immediateFuture( - Row.create(ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList())); - ByteString request = ByteString.copyFromUtf8("fake-row-key"); - - Batcher batcher = - bigtableDataClient.newBulkReadRowsBatcher("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)); - } - - @Test - public void proxyCheckAndMutateRowCallableTest() { - assertThat(bigtableDataClient.checkAndMutateRowCallable()) - .isSameInstanceAs(mockStub.checkAndMutateRowCallable()); - } - - @Test - public void proxyCheckAndMutateRowTest() { - ConditionalRowMutation mutation = - ConditionalRowMutation.create("fake-table", "fake-key") - .then(Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value")); - bigtableDataClient.checkAndMutateRowAsync(mutation); - - Mockito.verify(mockCheckAndMutateRowCallable).futureCall(mutation); - } - - @Test - public void checkAndMutateRowTest() { - Mockito.when(mockCheckAndMutateRowCallable.futureCall(any(ConditionalRowMutation.class))) - .thenReturn(ApiFutures.immediateFuture(Boolean.TRUE)); - ConditionalRowMutation mutation = - ConditionalRowMutation.create("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 proxyReadModifyWriteRowTest() { - ReadModifyWriteRow request = - ReadModifyWriteRow.create("fake-table", "some-key") - .append("fake-family", "fake-qualifier", "suffix"); - bigtableDataClient.readModifyWriteRowAsync(request); - Mockito.verify(mockReadModifyWriteRowCallable).futureCall(request); - } - - @Test - public void readModifyWriteRowTest() { - Mockito.when(mockReadModifyWriteRowCallable.futureCall(any(ReadModifyWriteRow.class))) - .thenReturn( - ApiFutures.immediateFuture( - Row.create( - ByteString.copyFromUtf8("fake-row-key"), Collections.emptyList()))); - ReadModifyWriteRow request = - ReadModifyWriteRow.create("fake-table", "some-key") - .append("fake-family", "fake-qualifier", "suffix"); - bigtableDataClient.readModifyWriteRow(request); - Mockito.verify(mockReadModifyWriteRowCallable).futureCall(request); - } - - @Test - public void proxyReadModifyWriterRowCallableTest() { - assertThat(bigtableDataClient.readModifyWriteRowCallable()) - .isSameInstanceAs(mockReadModifyWriteRowCallable); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTests.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTests.java new file mode 100644 index 0000000000..ec82f1c12c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java index 2053a434f4..cb5ca95c5c 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataSettingsTest.java @@ -19,16 +19,26 @@ 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()) diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceBuilder.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceBuilder.java new file mode 100644 index 0000000000..c2b4edf763 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceHelper.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceHelper.java deleted file mode 100644 index 9ec5e59cb7..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceHelper.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 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.ServerSocket; - -/** Utility class to setup a fake grpc server on a random port. */ -public class FakeServiceHelper { - private final int port; - private final Server server; - - public FakeServiceHelper(BindableService... services) throws IOException { - this(null, services); - } - - public FakeServiceHelper(ServerInterceptor interceptor, BindableService... services) - throws IOException { - this(interceptor, null, services); - } - - public FakeServiceHelper( - ServerInterceptor interceptor, - ServerTransportFilter transportFilter, - BindableService... services) - throws IOException { - try (ServerSocket ss = new ServerSocket(0)) { - port = ss.getLocalPort(); - } - ServerBuilder builder = ServerBuilder.forPort(port); - if (interceptor != null) { - builder = builder.intercept(interceptor); - } - if (transportFilter != null) { - builder = builder.addTransportFilter(transportFilter); - } - for (BindableService service : services) { - builder = builder.addService(service); - } - server = builder.build(); - } - - public int getPort() { - return port; - } - - public void start() throws IOException { - server.start(); - } - - public void shutdown() { - server.shutdown(); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/HiddenGapicApiTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/HiddenGapicApiTest.java deleted file mode 100644 index 7c302b7cbd..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/HiddenGapicApiTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.assertWithMessage; - -import com.google.api.core.InternalApi; -import com.google.cloud.bigtable.data.v2.stub.BigtableStub; -import com.google.cloud.bigtable.data.v2.stub.BigtableStubSettings; -import com.google.cloud.bigtable.data.v2.stub.GrpcBigtableCallableFactory; -import com.google.cloud.bigtable.data.v2.stub.GrpcBigtableStub; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameters; - -/** - * Tests that the underlying GAPIC api is marked as {@code @InternalApi}. This transformation - * happens in synth.py. - */ -@RunWith(Parameterized.class) -public class HiddenGapicApiTest { - private Class testClass; - - @Parameters - public static Object[] data() { - return new Object[] { - BigtableStub.class, - BigtableStubSettings.class, - GrpcBigtableStub.class, - GrpcBigtableCallableFactory.class - }; - } - - public HiddenGapicApiTest(Class testClass) { - this.testClass = testClass; - } - - @Test - public void test() { - assertWithMessage("%s should be annotated with @InternaOnly", testClass.getName()) - .that(testClass.getAnnotation(InternalApi.class)) - .isNotNull(); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/JwtCredentialsWithAudienceTests.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/JwtCredentialsWithAudienceTests.java new file mode 100644 index 0000000000..780f40db77 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MetadataSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/MetadataSubject.java new file mode 100644 index 0000000000..5e76ce38cd --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/functional/ReadRowsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/functional/ReadRowsTest.java new file mode 100644 index 0000000000..15f3792b81 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReaderTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReaderTest.java new file mode 100644 index 0000000000..127a704784 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PrepareQueryRequestTest.java new file mode 100644 index 0000000000..983bc8521c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImplTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/PreparedStatementImplTest.java new file mode 100644 index 0000000000..44d80cec6b --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadataTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadataTest.java new file mode 100644 index 0000000000..067b3bb4ac --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoStructTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoStructTest.java new file mode 100644 index 0000000000..cd8dfc7340 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/QueryParamUtilTest.java new file mode 100644 index 0000000000..b0f1d64a9d --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java new file mode 100644 index 0000000000..9787723164 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtilTest.java new file mode 100644 index 0000000000..c1bb915e81 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java index 555676ffb1..26609216e6 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowSetUtilTest.java @@ -20,12 +20,13 @@ 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.collect.ImmutableSortedSet; -import com.google.common.collect.Lists; +import com.google.common.base.Preconditions; +import com.google.common.base.Splitter; import com.google.protobuf.ByteString; import java.util.Arrays; -import java.util.List; 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; @@ -33,423 +34,184 @@ @RunWith(JUnit4.class) public class RowSetUtilTest { @Test - public void noSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("a")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("p")) - .setEndKeyOpen(ByteString.copyFromUtf8("q"))) - .build(); + public void testSplitFullScan() { + RowSet input = RowSet.getDefaultInstance(); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE).build(); + RowSet right = RowSetUtil.erase(input, ByteString.copyFromUtf8("g"), true); + assertThat(right).isEqualTo(parse("(g-")); - verifySplit(rowSet, splitPoints, rowSet); + RowSet left = RowSetUtil.erase(input, ByteString.copyFromUtf8("g"), false); + assertThat(left).isEqualTo(parse("-g)")); } @Test - public void splitEmptyTest() { - RowSet rowSet = RowSet.newBuilder().build(); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("a")) - .build(); + 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); - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowRanges(RowRange.newBuilder().setEndKeyClosed(ByteString.copyFromUtf8("a"))) - .build(), - RowSet.newBuilder() - .addRowRanges(RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("a"))) - .build()); + assertThat(left).isEqualTo(input); + assertThat(right).isNull(); } @Test - public void splitMultipleKeysTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("1-beforeSplit")) - .addRowKeys(ByteString.copyFromUtf8("2-onSplit")) - .addRowKeys(ByteString.copyFromUtf8("3-afterSplit")) - .build(); + public void testSplitAllRight() { + RowSet input = parse("a1,c,(a-c],[a2-c],(a3-c),[a4-c)"); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("2-onSplit")) - .build(); - - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("1-beforeSplit")) - .addRowKeys(ByteString.copyFromUtf8("2-onSplit")) - .build(), - RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("3-afterSplit")).build()); + assertThat(RowSetUtil.erase(input, ByteString.copyFromUtf8("a"), true)).isEqualTo(input); + assertThat(RowSetUtil.erase(input, ByteString.copyFromUtf8("a"), false)).isNull(); } @Test - public void splitKeysEmptyLeft() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("5-test")) - .addRowKeys(ByteString.copyFromUtf8("8-test")) - .build(); + public void testSplit() { + RowSet input = parse("a1,c,(a1-c],[a2-c],(a3-c),[a4-c),[b-z],(b-y]"); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("0-split")) - .add(ByteString.copyFromUtf8("6-split")) - .build(); + RowSet before = RowSetUtil.erase(input, ByteString.copyFromUtf8("b"), false); + RowSet after = RowSetUtil.erase(input, ByteString.copyFromUtf8("b"), true); - verifySplit( - rowSet, - splitPoints, - null, - RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("5-test")).build(), - RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("8-test")).build()); + 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 splitKeysEmptyRight() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0-test")) - .addRowKeys(ByteString.copyFromUtf8("2-test")) - .build(); - - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("1-split")) - .add(ByteString.copyFromUtf8("5-split")) - .build(); - - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("0-test")).build(), - RowSet.newBuilder().addRowKeys(ByteString.copyFromUtf8("2-test")).build(), - null); + 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"); } - @Test - public void rangeLeftOfSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0-key")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("1-range-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("2-range-end"))) - .build(); - - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("3-split")) - .build(); + private static void assertShardNoSplit(String rowStr, String... splits) { + RowSet input = parse(rowStr); - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0-key")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("1-range-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("2-range-end"))) - .build(), - null); + assertThat(RowSetUtil.shard(input, splitPoints(splits))).containsExactly(input); } @Test - public void unboundedRangeLeftOfSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowRanges( - RowRange.newBuilder().setEndKeyOpen(ByteString.copyFromUtf8("1-range-end"))) - .build(); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("5-split")) - .build(); + public void testShardFullTableScan() { + RowSet input = RowSet.getDefaultInstance(); + SortedSet splitPoints = splitPoints("a"); - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowRanges( - RowRange.newBuilder().setEndKeyOpen(ByteString.copyFromUtf8("1-range-end"))) - .build(), - null); + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("-a)"), parse("[a-")) + .inOrder(); } @Test - public void rangeImmediatelyLeftOfSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0-key")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("1-range-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("2-range-end"))) - .build(); + public void testShardMultipleKeys() { + RowSet input = parse("1_beforeSplit,2_onSplit,3_afterSplit"); + SortedSet splitPoints = splitPoints("2_onSplit"); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("2-range-end")) - .build(); - - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0-key")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("1-range-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("2-range-end"))) - .build(), - null); + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("1_beforeSplit"), parse("2_onSplit,3_afterSplit")) + .inOrder(); } @Test - public void rangeRightOfSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("9-row-key")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("5-range-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("7-range-end"))) - .build(); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("3-split")) - .build(); + public void testShardKeysEmptyLeft() { + RowSet input = parse("5_test,8_test"); + SortedSet splitPoints = splitPoints("0_split", "6-split"); - verifySplit( - rowSet, - splitPoints, - null, - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("9-row-key")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("5-range-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("7-range-end"))) - .build()); + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("5_test"), parse("8_test")) + .inOrder(); } @Test - public void unboundedRightOfSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowRanges( - RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("5-range-start"))) - .build(); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("3-split")) - .build(); + public void testShardKeysEmptyRight() { + RowSet input = parse("0_test,2_test"); + SortedSet splitPoints = splitPoints("1_split", "5_split"); - verifySplit( - rowSet, - splitPoints, - null, - RowSet.newBuilder() - .addRowRanges( - RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("5-range-start"))) - .build()); + assertThat(RowSetUtil.shard(input, splitPoints)) + .containsExactly(parse("0_test"), parse("2_test")) + .inOrder(); } @Test - public void rangeExactlyFitsSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("5-split")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("3-split")) - .setEndKeyClosed(ByteString.copyFromUtf8("5-split"))) - .build(); - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("3-split")) - .add(ByteString.copyFromUtf8("5-split")) - .build(); - - verifySplit( - rowSet, - splitPoints, - null, - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("5-split")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("3-split")) - .setEndKeyClosed(ByteString.copyFromUtf8("5-split"))) - .build(), - null); + 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 startOnSplitPointTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowRanges( - RowRange.newBuilder().setStartKeyClosed(ByteString.copyFromUtf8("3-split"))) - .build(); + 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(); + } - // Inclusive start on a split point should generate 2 segments - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("3-split")) - .build(); + private static SortedSet splitPoints(String... s) { - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("3-split")) - .setEndKeyClosed(ByteString.copyFromUtf8("3-split"))) - .build(), - RowSet.newBuilder() - .addRowRanges(RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("3-split"))) - .build()); + return Arrays.stream(s) + .map(ByteString::copyFromUtf8) + .collect(Collectors.toCollection(() -> new TreeSet<>(ByteStringComparator.INSTANCE))); } - @Test - public void mixedSplitTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0")) - .addRowKeys(ByteString.copyFromUtf8("a")) - .addRowKeys(ByteString.copyFromUtf8("c")) - // Range 1: fully in "a" segment - .addRowRanges(RowRange.newBuilder().setEndKeyClosed(ByteString.copyFromUtf8("a"))) - // Range 2: split between segment "a" & "d" - .addRowRanges(RowRange.newBuilder().setEndKeyClosed(ByteString.copyFromUtf8("b"))) - // Range 3: split between segment "d" & "j" - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("c")) - .setEndKeyClosed(ByteString.copyFromUtf8("e"))) - // Range 4: fully in "j" - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("d")) - .setEndKeyClosed(ByteString.copyFromUtf8("f"))) - // Range 5: fully in "j" - .addRowRanges(RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("m"))) - .build(); - - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - // Split the unbounded - .add(ByteString.copyFromUtf8("a")) - .add(ByteString.copyFromUtf8("d")) - .add(ByteString.copyFromUtf8("j")) - .add(ByteString.copyFromUtf8("o")) - .build(); + private static RowSet parse(String encodedRowSet) { + RowSet.Builder builder = RowSet.newBuilder(); - verifySplit( - rowSet, - splitPoints, - // Split "a" - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("0")) - .addRowKeys(ByteString.copyFromUtf8("a")) - // Range 1 - .addRowRanges(RowRange.newBuilder().setEndKeyClosed(ByteString.copyFromUtf8("a"))) - // Range 2: part1 - .addRowRanges(RowRange.newBuilder().setEndKeyClosed(ByteString.copyFromUtf8("a"))) - .build(), - // Split "d" - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("c")) - // Range 2: part 2 - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("a")) - .setEndKeyClosed(ByteString.copyFromUtf8("b"))) - // Range 3: part 1 - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("c")) - .setEndKeyClosed(ByteString.copyFromUtf8("d"))) - .build(), - // Split "j" - RowSet.newBuilder() - // Range 3: part 2 - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("d")) - .setEndKeyClosed(ByteString.copyFromUtf8("e"))) - // Range 4 - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("d")) - .setEndKeyClosed(ByteString.copyFromUtf8("f"))) - .build(), - // Split "o" - RowSet.newBuilder() - // Range 5: part1 - .addRowRanges( - RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("m")) - .setEndKeyClosed(ByteString.copyFromUtf8("o"))) - .build(), - // Remainder - RowSet.newBuilder() - // Range 5: part2 - .addRowRanges(RowRange.newBuilder().setStartKeyOpen(ByteString.copyFromUtf8("o"))) - .build()); + for (String s : Splitter.on(",").split(encodedRowSet)) { + if (s.contains("-")) { + builder.addRowRanges(parseRange(s)); + } else { + builder.addRowKeys(ByteString.copyFromUtf8(s)); + } + } + return builder.build(); } - @Test - public void unsortedRequestTest() { - RowSet rowSet = - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("7-row-key-1")) - .addRowKeys(ByteString.copyFromUtf8("2-row-key-2")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("8-range-1-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("9-range-1-end"))) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("3-range-2-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("4-range-2-end"))) - .build(); - - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("5-split")) - .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"); + } - verifySplit( - rowSet, - splitPoints, - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("2-row-key-2")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("3-range-2-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("4-range-2-end"))) - .build(), - RowSet.newBuilder() - .addRowKeys(ByteString.copyFromUtf8("7-row-key-1")) - .addRowRanges( - RowRange.newBuilder() - .setStartKeyClosed(ByteString.copyFromUtf8("8-range-1-start")) - .setEndKeyOpen(ByteString.copyFromUtf8("9-range-1-end"))) - .build()); + 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 @@ -569,18 +331,17 @@ public void multipleRangeBoundTest() { assertThat(actual).isEqualTo(ByteStringRange.create("a", "z")); } - // Helpers - private static void verifySplit(RowSet input, SortedSet splits, RowSet... expected) { - List actualWithNull = RowSetUtil.split(input, splits, true); - assertThat(actualWithNull).containsExactlyElementsIn(Arrays.asList(expected)).inOrder(); + @Test + public void eraseLargeRowEmptyRangeTest() { + ByteString key = ByteString.copyFromUtf8("a"); + ByteString keyTrailer = key.concat(ByteString.copyFrom(new byte[] {0})); - List actualNonnull = RowSetUtil.split(input, splits, false); - List expectedNonnull = Lists.newArrayList(); - for (RowSet rowSet : expected) { - if (rowSet != null) { - expectedNonnull.add(rowSet); - } - } - assertThat(actualNonnull).containsExactlyElementsIn(expectedNonnull).inOrder(); + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtilTest.java new file mode 100644 index 0000000000..3de9821147 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowSubject.java new file mode 100644 index 0000000000..de88a9c8f4 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/TimestampUtilTest.java new file mode 100644 index 0000000000..5c6dac7632 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java new file mode 100644 index 0000000000..09778bd46e --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/InstanceNameTest.java @@ -0,0 +1,51 @@ +/* + * 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.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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java new file mode 100644 index 0000000000..fd8e8310a7 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/api/TableNameTest.java @@ -0,0 +1,62 @@ +/* + * 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.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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java new file mode 100644 index 0000000000..9e91a6c1d8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/MetricRegistryExportTest.java @@ -0,0 +1,693 @@ +/* + * 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.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.PeerInfo; +import com.google.bigtable.v2.PeerInfo.TransportType; +import com.google.bigtable.v2.ResponseParams; +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.exporter.BigtableCloudMonitoringExporter; +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 MethodInfo methodInfo; + private ResponseParams 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(); + + 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.newRecorderRegistry(meterProvider); + + methodInfo = MethodInfo.builder().setName("Bigtable.ReadRow").setStreaming(false).build(); + + clusterInfo = + ResponseParams.newBuilder().setZoneId(clusterZone).setClusterId(clusterId).build(); + peerInfo = + PeerInfo.newBuilder() + .setTransportType(TransportType.TRANSPORT_TYPE_SESSION_CLOUD_PATH) + .setGoogleFrontendId(123) + .setApplicationFrontendZone("us-east1-c") + .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", "", + "transport_zone", peerInfo.getApplicationFrontendZone(), + "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 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java new file mode 100644 index 0000000000..e97cb1dd52 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/ClientInfoTest.java @@ -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. + */ + +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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java new file mode 100644 index 0000000000..8ab52111aa --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/EnvInfoTest.java @@ -0,0 +1,128 @@ +/* + * 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.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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/UtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java similarity index 51% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/UtilTest.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java index efef3b67d2..782b04928e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/UtilTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/attributes/UtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google LLC + * 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. @@ -13,30 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; + +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.common.util.concurrent.Futures; +import com.google.bigtable.v2.PeerInfo.TransportType; import io.grpc.Status; import io.opencensus.tags.TagValue; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; +import org.junit.jupiter.api.Test; -@RunWith(JUnit4.class) -public class UtilTest { +class UtilTest { @Test - public void testOk() { - TagValue tagValue = Util.extractStatus((Throwable) null); - assertThat(tagValue.asString()).isEqualTo("OK"); + void ensureAllTransportTypeHaveExpectedPrefix() { + for (TransportType type : TransportType.values()) { + assertWithMessage("%s should have a mapping", type) + .that(Util.transportTypeToStringWithoutFallback(type)) + .isNotNull(); + } } @Test - public void testOkFuture() { - TagValue tagValue = Util.extractStatus(Futures.immediateFuture(null)); + public void testOk() { + TagValue tagValue = + TagValue.create( + com.google.cloud.bigtable.data.v2.internal.csm.attributes.Util.extractStatus(null) + .name()); assertThat(tagValue.asString()).isEqualTo("OK"); } @@ -45,22 +50,7 @@ public void testError() { DeadlineExceededException error = new DeadlineExceededException( "Deadline exceeded", null, GrpcStatusCode.of(Status.Code.DEADLINE_EXCEEDED), true); - TagValue tagValue = Util.extractStatus(error); - assertThat(tagValue.asString()).isEqualTo("DEADLINE_EXCEEDED"); - } - - @Test - public void testErrorFuture() { - DeadlineExceededException error = - new DeadlineExceededException( - "Deadline exceeded", null, GrpcStatusCode.of(Status.Code.DEADLINE_EXCEEDED), true); - TagValue tagValue = Util.extractStatus(Futures.immediateFailedFuture(error)); + TagValue tagValue = TagValue.create(Util.extractStatus(error).name()); assertThat(tagValue.asString()).isEqualTo("DEADLINE_EXCEEDED"); } - - @Test - public void testCancelledFuture() { - TagValue tagValue = Util.extractStatus(Futures.immediateCancelledFuture()); - assertThat(tagValue.asString()).isEqualTo("CANCELLED"); - } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java new file mode 100644 index 0000000000..8be676d6a8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporter2Test.java @@ -0,0 +1,554 @@ +/* + * 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.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.bigtable.v2.TableName; +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.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(InstanceName.of(tableName.getProject(), tableName.getInstance())) + .setAppProfileId(appProfileId) + .build(); + + MetricRegistry metricRegistry = new MetricRegistry(); + exporter = + new BigtableCloudMonitoringExporter( + metricRegistry, () -> envInfo, clientInfo, fakeMetricServiceClient); + + attributes = + Attributes.builder() + .put(TableSchema.BIGTABLE_PROJECT_ID_KEY, tableName.getProject()) + .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstance()) + .put(TableSchema.TABLE_ID_KEY, tableName.getTable()) + .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.getProject(), + TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstance(), + TableSchema.TABLE_ID_KEY.getKey(), tableName.getTable(), + 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.getProject(), + TableSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstance(), + TableSchema.TABLE_ID_KEY.getKey(), tableName.getTable(), + 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.getProject()) + .put(TableSchema.INSTANCE_ID_KEY, tableName.getInstance()) + .put(TableSchema.TABLE_ID_KEY, tableName.getTable() + 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.getProject(), + TableSchema.INSTANCE_ID_KEY.getKey(), + tableName.getInstance(), + TableSchema.TABLE_ID_KEY.getKey(), + tableName.getTable() + 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(InstanceName.of(tableName.getProject(), tableName.getInstance())) + .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.getProject(), + ClientSchema.INSTANCE_ID_KEY, + tableName.getInstance(), + 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.getProject()); + assertThat(request.getTimeSeriesList()).hasSize(1); + + TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .isEqualTo( + ImmutableMap.builder() + .put("project_id", tableName.getProject()) + .put("instance", tableName.getInstance()) + .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.getProject()) + .put(ClientSchema.INSTANCE_ID_KEY.getKey(), tableName.getInstance()) + .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.getProject(), + TableSchema.INSTANCE_ID_KEY.getKey(), + tableName.getInstance(), + TableSchema.TABLE_ID_KEY.getKey(), + tableName.getTable(), + 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.getInstance(), + TableSchema.TABLE_ID_KEY.getKey(), + tableName.getTable(), + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporterTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/exporter/BigtableCloudMonitoringExporterTest.java new file mode 100644 index 0000000000..2e04d7c566 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/BigtableTracerCallableTest.java similarity index 65% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerCallableTest.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/BigtableTracerCallableTest.java index 9538b6a135..0a19733b6c 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/BigtableTracerCallableTest.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +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.ClientContext; +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; @@ -31,10 +31,9 @@ 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.BigtableDataSettings; -import com.google.cloud.bigtable.data.v2.FakeServiceHelper; +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; @@ -42,20 +41,22 @@ 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.EnhancedBigtableStubSettings; +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.impl.stats.StatsComponentImpl; import io.opencensus.stats.StatsComponent; -import io.opencensus.stats.ViewData; import io.opencensus.tags.TagKey; import io.opencensus.tags.TagValue; import io.opencensus.tags.Tags; @@ -68,13 +69,13 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) -public class HeaderTracerCallableTest { - private FakeServiceHelper serviceHelper; - private FakeServiceHelper serviceHelperNoHeader; +public class BigtableTracerCallableTest { + private Server server; + private Server serverNoHeader; - private FakeService fakeService = new FakeService(); + private final FakeService fakeService = new FakeService(); - private final StatsComponent localStats = new StatsComponentImpl(); + private final StatsComponent localStats = new SimpleStatsComponent(); private EnhancedBigtableStub stub; private EnhancedBigtableStub noHeaderStub; private int attempts; @@ -82,7 +83,7 @@ public class HeaderTracerCallableTest { 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 String TABLE_ID = "fake-table"; + private static final TableId TABLE_ID = TableId.of("fake-table"); private static final long WAIT_FOR_METRICS_TIME_MS = 1_000; @@ -90,85 +91,100 @@ public class HeaderTracerCallableTest { @Before public void setUp() throws Exception { - RpcViews.registerBigtableClientGfeViews(localStats.getViewManager()); + 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); - serviceHelper = - new FakeServiceHelper( - 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); - } - }, - fakeService); - serviceHelper.start(); + 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(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setAppProfileId(APP_PROFILE_ID) + // only testing opencensus + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() .build(); - EnhancedBigtableStubSettings stubSettings = - EnhancedBigtableStub.finalizeSettings( - settings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder()); - attempts = stubSettings.readRowsSettings().getRetrySettings().getMaxAttempts(); - stub = new EnhancedBigtableStub(stubSettings, ClientContext.create(stubSettings)); + + 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. - serviceHelperNoHeader = new FakeServiceHelper(fakeService); - serviceHelperNoHeader.start(); + serverNoHeader = FakeServiceBuilder.create(fakeService).start(); BigtableDataSettings noHeaderSettings = - BigtableDataSettings.newBuilderForEmulator(serviceHelperNoHeader.getPort()) + BigtableDataSettings.newBuilderForEmulator(serverNoHeader.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setAppProfileId(APP_PROFILE_ID) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() .build(); - EnhancedBigtableStubSettings noHeaderStubSettings = - EnhancedBigtableStub.finalizeSettings( - noHeaderSettings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder()); + noHeaderStub = - new EnhancedBigtableStub(noHeaderStubSettings, ClientContext.create(noHeaderStubSettings)); + 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(); - serviceHelper.shutdown(); - serviceHelperNoHeader.shutdown(); + server.shutdown(); + serverNoHeader.shutdown(); } @Test - public void testGFELatencyMetricReadRows() throws InterruptedException { - stub.readRowsCallable().call(Query.create(TABLE_ID)); - - Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + 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_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -186,7 +202,9 @@ public void testGFELatencyMetricMutateRow() throws InterruptedException { StatsTestUtils.getAggregationValueAsLong( localStats, RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, - ImmutableMap.of(RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRow")), + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -208,7 +226,8 @@ public void testGFELatencyMetricMutateRows() throws InterruptedException { localStats, RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, ImmutableMap.of( - RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRows")), + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -218,7 +237,7 @@ public void testGFELatencyMetricMutateRows() throws InterruptedException { @Test public void testGFELatencySampleRowKeys() throws InterruptedException { - stub.sampleRowKeysCallable().call(TABLE_ID); + stub.sampleRowKeysCallableWithRequest().call(SampleRowKeysRequest.create(TABLE_ID)); Thread.sleep(WAIT_FOR_METRICS_TIME_MS); long latency = @@ -226,7 +245,26 @@ public void testGFELatencySampleRowKeys() throws InterruptedException { localStats, RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, ImmutableMap.of( - RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.SampleRowKeys")), + 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); @@ -246,7 +284,8 @@ public void testGFELatencyCheckAndMutateRow() throws InterruptedException { localStats, RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, ImmutableMap.of( - RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.CheckAndMutateRow")), + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.CheckAndMutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -266,7 +305,8 @@ public void testGFELatencyReadModifyWriteRow() throws InterruptedException { localStats, RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, ImmutableMap.of( - RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadModifyWriteRow")), + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadModifyWriteRow"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -285,7 +325,11 @@ public void testGFEMissingHeaderMetric() throws InterruptedException { StatsTestUtils.getAggregationValueAsLong( localStats, RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, - ImmutableMap.of(RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRow")), + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.MutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -294,7 +338,8 @@ public void testGFEMissingHeaderMetric() throws InterruptedException { localStats, RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, ImmutableMap.of( - RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows")), + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -321,7 +366,11 @@ public void testGFEMissingHeaderMetric() throws InterruptedException { StatsTestUtils.getAggregationValueAsLong( localStats, RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, - ImmutableMap.of(RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.MutateRow")), + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.MutateRow"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -330,7 +379,10 @@ public void testGFEMissingHeaderMetric() throws InterruptedException { localStats, RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, ImmutableMap.of( - RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows")), + RpcMeasureConstants.BIGTABLE_OP, + TagValue.create("Bigtable.ReadRows"), + RpcMeasureConstants.BIGTABLE_STATUS, + TagValue.create("OK")), PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -342,7 +394,7 @@ public void testGFEMissingHeaderMetric() throws InterruptedException { @Test public void testMetricsWithErrorResponse() throws InterruptedException { try { - stub.readRowsCallable().call(Query.create("random-table-id")).iterator().next(); + 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); @@ -353,34 +405,20 @@ public void testMetricsWithErrorResponse() throws InterruptedException { StatsTestUtils.getAggregationValueAsLong( localStats, RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW, - ImmutableMap.of(RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.ReadRows")), + 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); } - @Test - public void testCallableBypassed() throws InterruptedException { - RpcViews.setGfeMetricsRegistered(false); - stub.readRowsCallable().call(Query.create(TABLE_ID)); - Thread.sleep(WAIT_FOR_METRICS_TIME_MS); - ViewData headerMissingView = - localStats - .getViewManager() - .getView(RpcViewConstants.BIGTABLE_GFE_HEADER_MISSING_COUNT_VIEW.getName()); - ViewData latencyView = - localStats.getViewManager().getView(RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW.getName()); - // Verify that the view is registered by it's not collecting metrics - assertThat(headerMissingView).isNotNull(); - assertThat(latencyView).isNotNull(); - assertThat(headerMissingView.getAggregationMap()).isEmpty(); - assertThat(latencyView.getAggregationMap()).isEmpty(); - } - - private class FakeService extends BigtableImplBase { + private static class FakeService extends BigtableImplBase { private final String defaultTableName = - NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId()); @Override public void readRows(ReadRowsRequest request, StreamObserver observer) { @@ -400,13 +438,18 @@ public void mutateRow(MutateRowRequest request, StreamObserver observer) { - observer.onNext(MutateRowsResponse.getDefaultInstance()); + 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( - SampleRowKeysRequest request, StreamObserver observer) { + com.google.bigtable.v2.SampleRowKeysRequest request, + StreamObserver observer) { observer.onNext(SampleRowKeysResponse.getDefaultInstance()); observer.onCompleted(); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/MetricsTracerTest.java new file mode 100644 index 0000000000..4472c433f7 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/SimpleStatsComponent.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/SimpleStatsComponent.java new file mode 100644 index 0000000000..bf867989d1 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsTestUtils.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/StatsTestUtils.java similarity index 97% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsTestUtils.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/StatsTestUtils.java index 6aede96161..db86a027fc 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsTestUtils.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/opencensus/StatsTestUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.data.v2.stub.metrics; +package com.google.cloud.bigtable.data.v2.internal.csm.opencensus; import static com.google.common.base.Preconditions.checkNotNull; @@ -299,6 +299,11 @@ public static long getAggregationValueAsLong( 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 diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/BuiltinMetricsTracerTest.java new file mode 100644 index 0000000000..5385bb876b --- /dev/null +++ b/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.newRecorderRegistry(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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java new file mode 100644 index 0000000000..d265e76267 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/ChannelPoolMetricsTracerTest.java @@ -0,0 +1,362 @@ +/* + * 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.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.newRecorderRegistry(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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/csm/tracers/CompositeTracerTest.java new file mode 100644 index 0000000000..c77f3e1e50 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessCheckerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/dp/ClassicDirectAccessCheckerTest.java new file mode 100644 index 0000000000..5ce624cf44 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java new file mode 100644 index 0000000000..cb944a2aec --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkMutateIT.java new file mode 100644 index 0000000000..bd2e8e5352 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java index 99c14ccc4f..a14029294f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BulkReadIT.java @@ -15,16 +15,21 @@ */ 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; @@ -41,6 +46,8 @@ 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 { @@ -102,4 +109,88 @@ public void testBulkRead() throws InterruptedException, ExecutionException { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java index 5f53284690..a3570f5e5b 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/CheckAndMutateIT.java @@ -16,13 +16,24 @@ 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; @@ -38,7 +49,7 @@ public class CheckAndMutateIT { @Test public void test() throws Exception { - String tableId = testEnvRule.env().getTableId(); + TableId tableId = testEnvRule.env().getTableId(); String familyId = testEnvRule.env().getFamilyId(); String rowKey = UUID.randomUUID().toString(); @@ -71,4 +82,82 @@ public void test() throws Exception { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java index 6e48c1214d..9f1e2f7104 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/DirectPathFallbackIT.java @@ -18,16 +18,15 @@ import static com.google.common.truth.Truth.assertWithMessage; import static com.google.common.truth.TruthJUnit.assume; -import com.google.api.core.ApiFunction; -import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.auth.oauth2.ComputeEngineCredentials; 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.alts.ComputeEngineChannelBuilder; 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; @@ -37,11 +36,12 @@ 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.lang.reflect.Field; 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; @@ -73,12 +73,12 @@ public class DirectPathFallbackIT { @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); - private AtomicBoolean blackholeDpAddr = new AtomicBoolean(); - private AtomicInteger numBlocked = new AtomicInteger(); - private AtomicInteger numDpAddrRead = new AtomicInteger(); + private final AtomicBoolean blackholeDpAddr = new AtomicBoolean(); + private final AtomicInteger numBlocked = new AtomicInteger(); + private final AtomicInteger numDpAddrRead = new AtomicInteger(); - private ChannelFactory channelFactory; - private EventLoopGroup eventLoopGroup; + private final ChannelFactory channelFactory; + private final EventLoopGroup eventLoopGroup; private BigtableDataClient instrumentedClient; public DirectPathFallbackIT() { @@ -89,9 +89,12 @@ public DirectPathFallbackIT() { @Before public void setup() throws IOException { + Set validModes = + ImmutableSet.of( + ConnectionMode.REQUIRE_DIRECT_PATH, ConnectionMode.REQUIRE_DIRECT_PATH_IPV4); assume() - .withMessage("DirectPath integration tests can only run against DirectPathEnv") - .that(testEnvRule.env().isDirectPathEnabled()) + .withMessage("DirectPathFallbackIT can only return when explicitly requested") + .that(validModes.contains(testEnvRule.env().getConnectionMode())) .isTrue(); BigtableDataSettings defaultSettings = testEnvRule.env().getDataClientSettings(); @@ -99,21 +102,17 @@ public void setup() throws IOException { (InstantiatingGrpcChannelProvider) defaultSettings.getStubSettings().getTransportChannelProvider(); InstantiatingGrpcChannelProvider instrumentedTransportChannelProvider = - defaultTransportProvider - .toBuilder() + defaultTransportProvider.toBuilder() .setAttemptDirectPath(true) - .setPoolSize(1) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) .setChannelConfigurator( - new ApiFunction() { - @Override - public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { - injectNettyChannelHandler(builder); - - // Fail fast when blackhole is active - builder.keepAliveTime(1, TimeUnit.SECONDS); - builder.keepAliveTimeout(1, TimeUnit.SECONDS); - return builder; - } + builder -> { + injectNettyChannelHandler(builder); + + // Fail fast when blackhole is active + builder.keepAliveTime(1, TimeUnit.SECONDS); + builder.keepAliveTimeout(1, TimeUnit.SECONDS); + return builder; }) .build(); @@ -123,9 +122,7 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { settingsBuilder .stubSettings() - .setTransportChannelProvider(instrumentedTransportChannelProvider) - // Forcefully ignore GOOGLE_APPLICATION_CREDENTIALS - .setCredentialsProvider(FixedCredentialsProvider.create(ComputeEngineCredentials.create())); + .setTransportChannelProvider(instrumentedTransportChannelProvider); instrumentedClient = BigtableDataClient.create(settingsBuilder.build()); } @@ -136,7 +133,7 @@ public void teardown() { instrumentedClient.close(); } if (eventLoopGroup != null) { - eventLoopGroup.shutdownGracefully(); + Future ignored = eventLoopGroup.shutdownGracefully(); } } @@ -183,28 +180,17 @@ private boolean exerciseDirectPath() throws InterruptedException, TimeoutExcepti /** * This is a giant hack to enable testing DirectPath CFE fallback. * - *

    It unwraps the {@link ComputeEngineChannelBuilder} to inject a NettyChannelHandler to signal - * IPv6 packet loss. + *

    Injects a NettyChannelHandler to signal IPv6 packet loss. */ private void injectNettyChannelHandler(ManagedChannelBuilder channelBuilder) { - try { - // Extract the delegate NettyChannelBuilder using reflection - Field delegateField = ComputeEngineChannelBuilder.class.getDeclaredField("delegate"); - delegateField.setAccessible(true); - - ComputeEngineChannelBuilder gceChannelBuilder = - ((ComputeEngineChannelBuilder) channelBuilder); - Object delegateChannelBuilder = delegateField.get(gceChannelBuilder); - - NettyChannelBuilder nettyChannelBuilder = (NettyChannelBuilder) delegateChannelBuilder; - nettyChannelBuilder.channelFactory(channelFactory); - nettyChannelBuilder.eventLoopGroup(eventLoopGroup); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException("Failed to inject the netty ChannelHandler", e); - } + NettyChannelBuilder nettyChannelBuilder = (NettyChannelBuilder) channelBuilder; + nettyChannelBuilder.channelFactory(channelFactory); + nettyChannelBuilder.eventLoopGroup(eventLoopGroup); } - /** @see com.google.cloud.bigtable.data.v2.it.DirectPathFallbackIT.MyChannelHandler */ + /** + * @see com.google.cloud.bigtable.data.v2.it.DirectPathFallbackIT.MyChannelHandler + */ private class MyChannelFactory implements ChannelFactory { @Override public NioSocketChannel newChannel() { @@ -240,7 +226,8 @@ public void connect( super.connect(ctx, remoteAddress, localAddress, promise); } else { // Fail the connection fast - promise.setFailure(new IOException("fake error")); + @SuppressWarnings("UnusedVariable") + ChannelPromise ignored = promise.setFailure(new IOException("fake error")); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ExecuteQueryIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ExecuteQueryIT.java new file mode 100644 index 0000000000..f72ebf1437 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java index 4ccf9167f4..3f73ad4514 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/LargeRowIT.java @@ -16,16 +16,37 @@ 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; @@ -33,10 +54,29 @@ @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(); @@ -73,4 +113,266 @@ public void testWriteRead() throws Exception { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MetricsITUtils.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MetricsITUtils.java new file mode 100644 index 0000000000..5e56d36e72 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java index 2774cbc648..a54c726827 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MutateRowIT.java @@ -15,11 +15,20 @@ */ 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; @@ -70,4 +79,78 @@ public void test() throws Exception { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java index d8626059fa..51adc4abb6 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadIT.java @@ -15,15 +15,25 @@ */ 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; @@ -31,13 +41,24 @@ 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; @@ -46,12 +67,14 @@ 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(); @@ -64,7 +87,7 @@ public void setUp() { @Test public void isRowExists() throws Exception { String rowKey = prefix + "-test-row-key"; - String tableId = testEnvRule.env().getTableId(); + TableId tableId = testEnvRule.env().getTableId(); testEnvRule .env() .getDataClient() @@ -81,6 +104,55 @@ public void isRowExists() throws Exception { 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"; @@ -98,6 +170,55 @@ public void readEmpty() throws Throwable { 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; @@ -127,7 +248,7 @@ public void read() throws Throwable { ByteString.copyFromUtf8("my-value"))))); } - String tableId = testEnvRule.env().getTableId(); + TableId tableId = testEnvRule.env().getTableId(); // Sync Query query = Query.create(tableId).range(uniqueKey + "-0", uniqueKey + "-" + numRows); @@ -153,10 +274,126 @@ public void read() throws Throwable { 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(); - String tableId = testEnvRule.env().getTableId(); + TableId tableId = testEnvRule.env().getTableId(); String familyId = testEnvRule.env().getFamilyId(); String uniqueKey = prefix + "-range-queries"; String keyA = uniqueKey + "-" + "a"; @@ -224,6 +461,275 @@ public void rangeQueries() { .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 = @@ -262,6 +768,7 @@ public void onSuccess(Row result) { } static class AccumulatingObserver implements ResponseObserver { + final List responses = Lists.newArrayList(); final SettableApiFuture completionFuture = SettableApiFuture.create(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java index e00556211f..cb8f2f8b58 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ReadModifyWriteIT.java @@ -15,10 +15,20 @@ */ 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; @@ -36,7 +46,7 @@ public class ReadModifyWriteIT { @Test public void test() throws InterruptedException, ExecutionException, TimeoutException { - String tableId = testEnvRule.env().getTableId(); + TableId tableId = testEnvRule.env().getTableId(); String family = testEnvRule.env().getFamilyId(); String rowKey = UUID.randomUUID().toString(); @@ -58,4 +68,76 @@ public void test() throws InterruptedException, ExecutionException, TimeoutExcep 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java index 4191a01ea6..c6ace17ade 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/RowMutationEntryBatcherIT.java @@ -15,15 +15,25 @@ */ 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; @@ -43,15 +53,17 @@ public class RowMutationEntryBatcherIT { @Test public void testNewBatcher() throws Exception { BigtableDataClient client = testEnvRule.env().getDataClient(); - String tableId = testEnvRule.env().getTableId(); + 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++) { - batcher.add( - RowMutationEntry.create(rowPrefix + "-" + i) - .setCell(family, "qualifier", 10_000L, "value-" + i)); + @SuppressWarnings("UnusedVariable") + ApiFuture ignored = + batcher.add( + RowMutationEntry.create(rowPrefix + "-" + i) + .setCell(family, "qualifier", 10_000L, "value-" + i)); } } @@ -72,4 +84,69 @@ public void testNewBatcher() throws Exception { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java index cb06243509..063d0d1f50 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/SampleRowsIT.java @@ -16,14 +16,24 @@ 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; @@ -61,4 +71,60 @@ public void test() throws InterruptedException, ExecutionException, TimeoutExcep 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/StreamingMetricsMetadataIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/StreamingMetricsMetadataIT.java new file mode 100644 index 0000000000..09ab6e0851 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java new file mode 100644 index 0000000000..5f151d749a --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewIdTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewIdTest.java new file mode 100644 index 0000000000..431125fb8c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java index dc06a58f5c..412959eb11 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/BulkMutationTest.java @@ -28,6 +28,7 @@ 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; @@ -36,13 +37,15 @@ public class BulkMutationTest { 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 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( @@ -58,7 +61,7 @@ public void test() throws ParseException { MutateRowsRequest.Builder expected = MutateRowsRequest.newBuilder() - .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID.getTableId())) .setAppProfileId(APP_PROFILE); TextFormat.merge( "entries {" @@ -94,10 +97,34 @@ public void test() throws ParseException { 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( @@ -113,29 +140,82 @@ public void serializationTest() throws IOException, ClassNotFoundException { 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() { - BulkMutation originalBulkMutation = + // 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 originalRequest = originalBulkMutation.toProto(REQUEST_CONTEXT); - BulkMutation clonedMutation = originalBulkMutation.clone(); - MutateRowsRequest clonedRequest = clonedMutation.toProto(REQUEST_CONTEXT); + 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(clonedRequest).isEqualTo(originalRequest); - assertThat(clonedRequest.getTableName()).isEqualTo(originalRequest.getTableName()); - assertThat(clonedRequest.getEntriesList()).isEqualTo(originalRequest.getEntriesList()); + 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 - clonedMutation.add( + clonedAuthorizedViewMutation.add( "another-rowKey", Mutation.create().deleteCells("delete-family", "delete-qualifier")); - assertThat(clonedMutation.toProto(REQUEST_CONTEXT)).isNotEqualTo(originalRequest); + 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 @@ -143,13 +223,21 @@ 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( @@ -169,7 +257,58 @@ public void fromProtoTest() { assertThat(overriddenRequest).isNotEqualTo(protoRequest); assertThat(overriddenRequest.getTableName()) - .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID)); + .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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationTokenTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamContinuationTokenTest.java new file mode 100644 index 0000000000..7e15ad5bbb --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java new file mode 100644 index 0000000000..761bec3765 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java new file mode 100644 index 0000000000..e46c7b30b2 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java index 8a626bb846..3a376668cf 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ConditionalRowMutationTest.java @@ -28,6 +28,8 @@ 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; @@ -36,7 +38,8 @@ public class ConditionalRowMutationTest { 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 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 = @@ -47,6 +50,8 @@ public class ConditionalRowMutationTest { @Test public void toProtoTest() { Mutation ignoredThenMutation = Mutation.create().deleteRow(); + + // Test ConditionalRowMutation on a table. ConditionalRowMutation mutation = ConditionalRowMutation.create(TABLE_ID, TEST_KEY).then(ignoredThenMutation); @@ -56,7 +61,25 @@ public void toProtoTest() { assertThat(actualProto) .isEqualTo( CheckAndMutateRowRequest.newBuilder() - .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .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()); @@ -64,6 +87,7 @@ public void toProtoTest() { @Test public void conditionTest() { + // Test ConditionalRowMutation on a table. ConditionalRowMutation mutation = ConditionalRowMutation.create(TABLE_ID, TEST_KEY) .condition(Filters.FILTERS.key().regex("a.*")) @@ -71,6 +95,18 @@ public void conditionTest() { 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()); @@ -78,6 +114,7 @@ public void conditionTest() { @Test public void thenTest() { + // Test ConditionalRowMutation on a table. ConditionalRowMutation mutation = ConditionalRowMutation.create(TABLE_ID, TEST_KEY) .then(Mutation.create().deleteCells("family1", "qualifier1")) @@ -85,25 +122,37 @@ public void thenTest() { CheckAndMutateRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); - assertThat(actualProto.getTrueMutationsList()) - .containsExactly( - com.google.bigtable.v2.Mutation.newBuilder() - .setDeleteFromColumn( - DeleteFromColumn.newBuilder() - .setFamilyName("family1") - .setColumnQualifier(ByteString.copyFromUtf8("qualifier1"))) - .build(), - com.google.bigtable.v2.Mutation.newBuilder() - .setDeleteFromColumn( - DeleteFromColumn.newBuilder() - .setFamilyName("family2") - .setColumnQualifier(ByteString.copyFromUtf8("qualifier2"))) - .build()) - .inOrder(); + 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")) @@ -111,25 +160,37 @@ public void otherwiseTest() { CheckAndMutateRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT); - assertThat(actualProto.getFalseMutationsList()) - .containsExactly( - com.google.bigtable.v2.Mutation.newBuilder() - .setDeleteFromColumn( - DeleteFromColumn.newBuilder() - .setFamilyName("family1") - .setColumnQualifier(ByteString.copyFromUtf8("qualifier1"))) - .build(), - com.google.bigtable.v2.Mutation.newBuilder() - .setDeleteFromColumn( - DeleteFromColumn.newBuilder() - .setFamilyName("family2") - .setColumnQualifier(ByteString.copyFromUtf8("qualifier2"))) - .build()) - .inOrder(); + 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()); @@ -142,10 +203,24 @@ public void noEffectClausesTest() { } 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()) @@ -161,10 +236,28 @@ public void serializationTest() throws IOException, ClassNotFoundException { 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")) @@ -184,7 +277,31 @@ public void fromProtoTest() { assertThat(overriddenRequest).isNotEqualTo(protoRequest); assertThat(overriddenRequest.getTableName()) - .matches(NameUtil.formatTableName(projectId, instanceId, TABLE_ID)); + .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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java new file mode 100644 index 0000000000..1f74d72b7c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/EntryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/EntryTest.java new file mode 100644 index 0000000000..645859f5aa --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java index e5fcd133f5..b8311f592e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/FiltersTest.java @@ -714,7 +714,7 @@ private static void checkSpawnedFilters( private static void checkClassDeclaresSerialVersionUid(Class cls) { String uid = "serialVersionUID"; for (Field field : cls.getDeclaredFields()) { - if (field.getName() == uid) { + 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(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewIdTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MaterializedViewIdTest.java new file mode 100644 index 0000000000..2f944c3ee0 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java index 450925ab0a..3ba1de6701 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/MutationTest.java @@ -17,9 +17,11 @@ 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; @@ -175,10 +177,40 @@ public void deleteRowTest() { assertThat(actual) .containsExactly( com.google.bigtable.v2.Mutation.newBuilder() - .setDeleteFromRow(DeleteFromRow.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"); @@ -264,7 +296,9 @@ public void fromProtoTest() { 1_000, ByteString.copyFromUtf8("fake-value")) .deleteCells("fake-family", ByteString.copyFromUtf8("fake-qualifier")) - .deleteFamily("fake-family2"); + .deleteFamily("fake-family2") + .addToCell("agg-family", "qual1", 1000, 1234) + .mergeToCell("agg-family", "qual2", 1000, ByteString.copyFrom(Longs.toByteArray(1234L))); List protoMutation = mutation.getMutations(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java index bf6abcd168..b7c394eb15 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/QueryTest.java @@ -17,9 +17,9 @@ 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.ReadRowsRequest.Builder; import com.google.bigtable.v2.RowFilter; import com.google.bigtable.v2.RowRange; import com.google.bigtable.v2.RowSet; @@ -38,9 +38,7 @@ import java.util.List; import java.util.SortedSet; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -48,12 +46,12 @@ public class QueryTest { 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 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; - @Rule public ExpectedException expect = ExpectedException.none(); - @Before public void setUp() { requestContext = RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); @@ -61,20 +59,26 @@ public void setUp() { @Test public void requestContextTest() { + // Table query test. Query query = Query.create(TABLE_ID); - ReadRowsRequest proto = query.toProto(requestContext); - assertThat(proto).isEqualTo(expectedProtoBuilder().build()); + 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 = expectedProtoBuilder(); + ReadRowsRequest.Builder expectedProto = expectedReadFromTableProtoBuilder(); expectedProto .getRowsBuilder() .addRowKeys(ByteString.copyFromUtf8("simple-string")) @@ -82,17 +86,33 @@ public void rowKeysTest() { 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")); - Builder expectedProto = expectedProtoBuilder(); + ReadRowsRequest.Builder expectedProto = expectedReadFromTableProtoBuilder(); expectedProto .getRowsBuilder() .addRowRanges( @@ -110,10 +130,37 @@ public void rowRangeTest() { 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); @@ -123,7 +170,7 @@ public void filterTestWithExceptions() { assertThat(actualException).isInstanceOf(NullPointerException.class); actualException = null; - int maxFilterSize = 20 * 1024 * 1024; + int maxFilterSize = 20 * 1024; ByteString largeValue = ByteString.copyFrom(new byte[maxFilterSize + 1]); try { @@ -131,33 +178,71 @@ public void filterTestWithExceptions() { } catch (Exception ex) { actualException = ex; } - assertThat(actualException).hasMessageThat().contains("filter size can't be more than 20MB"); + 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(".*")); - Builder expectedProto = - expectedProtoBuilder() + 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); - Builder expectedProto = expectedProtoBuilder().setRowsLimit(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(); @@ -169,10 +254,23 @@ public void serializationTest() throws IOException, ClassNotFoundException { 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 = @@ -193,7 +291,7 @@ public void shardTestSplitPoints() { .addRowRanges( RowRange.newBuilder() .setStartKeyClosed(ByteString.copyFromUtf8("a")) - .setEndKeyClosed(ByteString.copyFromUtf8("j")))) + .setEndKeyOpen(ByteString.copyFromUtf8("j")))) .build()); assertThat(subQueries.get(1).toProto(requestContext)) .isEqualTo( @@ -204,13 +302,47 @@ public void shardTestSplitPoints() { RowSet.newBuilder() .addRowRanges( RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("j")) + .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 = @@ -231,7 +363,7 @@ public void shardTestKeyOffsets() { .addRowRanges( RowRange.newBuilder() .setStartKeyClosed(ByteString.copyFromUtf8("a")) - .setEndKeyClosed(ByteString.copyFromUtf8("j")))) + .setEndKeyOpen(ByteString.copyFromUtf8("j")))) .build()); assertThat(subQueries.get(1).toProto(requestContext)) .isEqualTo( @@ -242,19 +374,60 @@ public void shardTestKeyOffsets() { RowSet.newBuilder() .addRowRanges( RowRange.newBuilder() - .setStartKeyOpen(ByteString.copyFromUtf8("j")) + .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 expectedProtoBuilder() { + 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)) @@ -271,18 +444,91 @@ public void testFromProto() { 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(expected = IllegalArgumentException.class) - public void testFromProtoWithEmptyTableId() { - Query.fromProto(ReadRowsRequest.getDefaultInstance()); + @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:"); + } - expect.expect(IllegalArgumentException.class); - expect.expectMessage("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") @@ -307,10 +553,41 @@ public void testEquality() { 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() @@ -326,5 +603,367 @@ public void testClone() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java index eebdba5811..6baea36099 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RangeTest.java @@ -21,6 +21,7 @@ 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; @@ -306,4 +307,14 @@ public void byteStringSerializationTest() throws IOException, ClassNotFoundExcep 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQueryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQueryTest.java new file mode 100644 index 0000000000..a8b9ab5022 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java index b0a8be33c9..f48178d66f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadModifyWriteRowTest.java @@ -35,13 +35,16 @@ public class ReadModifyWriteRowTest { 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 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( @@ -69,10 +72,41 @@ public void testAppend() { .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) @@ -97,10 +131,38 @@ public void testIncrement() { .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) @@ -115,10 +177,27 @@ public void serializationTest() throws IOException, ClassNotFoundException { 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) @@ -138,6 +217,27 @@ public void fromProtoTest() { 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java index f98e01e785..6ee8f1cf3e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowCellTest.java @@ -20,7 +20,6 @@ import com.google.common.collect.ImmutableList; import com.google.protobuf.ByteString; import com.google.protobuf.LazyStringArrayList; -import com.google.protobuf.UnmodifiableLazyStringList; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -109,14 +108,16 @@ public void compareTest() { @Test public void testSerialization() throws IOException, ClassNotFoundException { - LazyStringArrayList lazyList = new LazyStringArrayList(); - lazyList.add("lazy"); - lazyList.add("very lazy"); + 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"), - new UnmodifiableLazyStringList(lazyList), - new UnmodifiableLazyStringList(LazyStringArrayList.EMPTY) + lazyListNonEmpty, + lazyListEmpty }; for (int i = 0; i < labelLists.length; i++) { diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java index b401ad5ef3..6b3a23e5a8 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/RowMutationTest.java @@ -37,17 +37,21 @@ public class RowMutationTest { 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 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("fake-table", "fake-key") + RowMutation.create(TABLE_ID, TEST_KEY) .setCell("fake-family", "fake-qualifier", "fake-value"); MutateRowRequest actualRowMutation = rowMutation.toProto(REQUEST_CONTEXT); @@ -55,7 +59,27 @@ public void toProtoTest() { com.google.common.collect.Range.closed(timestampMin, System.currentTimeMillis() * 1_000); assertThat(actualRowMutation.getTableName()) - .isEqualTo(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, "fake-table")); + .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()) @@ -68,8 +92,9 @@ public void toProtoTest() { public void toBulkProtoTest() { long timestampMin = System.currentTimeMillis() * 1_000; + // Test RowMutation on a table. RowMutation rowMutation = - RowMutation.create("fake-table", "fake-key") + RowMutation.create(TABLE_ID, TEST_KEY) .setCell("fake-family", "fake-qualifier", "fake-value"); MutateRowsRequest actualRowMutation = rowMutation.toBulkProto(REQUEST_CONTEXT); @@ -79,6 +104,29 @@ public void toBulkProtoTest() { 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); @@ -92,17 +140,26 @@ public void toBulkProtoTest() { @Test public void toProtoTestWithProvidedMutation() { Mutation mutation = Mutation.create().setCell("fake-family", "fake-qualifier", "fake-value"); - RowMutation rowMutation = RowMutation.create("fake-table", "fake-key", mutation); + // 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("fake-table", "fake-key") + RowMutation.create(TABLE_ID, TEST_KEY) .setCell("fake-family", "fake-qualifier", 10_000, "fake-value"); ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -114,12 +171,28 @@ public void serializationTest() throws IOException, ClassNotFoundException { 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("fake-table", "fake-key") + RowMutation.create(TABLE_ID, TEST_KEY) .setCell("fake-family", "fake-qualifier", 100_000L) .setCell("fake-family", "fake-qualifier", 30_000L, 100_000L); @@ -130,6 +203,28 @@ public void testWithLongValue() { 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() @@ -142,8 +237,9 @@ public void testWithLongValue() { @Test public void fromProtoTest() { + // Test RowMutation on a table. RowMutation rowMutation = - RowMutation.create("fake-table", "fake-key") + 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"); @@ -161,6 +257,27 @@ public void fromProtoTest() { 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); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequestTest.java new file mode 100644 index 0000000000..5b9c0cee4b --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/TableIdTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/TableIdTest.java new file mode 100644 index 0000000000..8e1c9d502d --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ValueTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ValueTest.java new file mode 100644 index 0000000000..ed3df85799 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatementTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/BoundStatementTest.java new file mode 100644 index 0000000000..71f46610a2 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/SqlTypeTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/SqlTypeTest.java new file mode 100644 index 0000000000..e8e33387a6 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java index e468999f92..dcdef068a5 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableBatchingCallSettingsTest.java @@ -18,6 +18,7 @@ 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; @@ -53,6 +54,9 @@ public void testEmptyBuilder() { 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 @@ -71,6 +75,35 @@ public void testBuilder() { 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 @@ -82,7 +115,9 @@ public void testBuilderFromSettings() { builder .setBatchingSettings(BATCHING_SETTINGS) .setRetryableCodes(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED) - .setRetrySettings(retrySettings); + .setRetrySettings(retrySettings) + .enableLatencyBasedThrottling(10L) + .setServerInitiatedFlowControl(true); BigtableBatchingCallSettings settings = builder.build(); BigtableBatchingCallSettings.Builder newBuilder = settings.toBuilder(); @@ -91,6 +126,12 @@ public void testBuilderFromSettings() { 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 @@ -110,4 +151,103 @@ public void testMandatorySettings() { } 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java index 3748a5adff..7913e97540 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableChannelPrimerTest.java @@ -16,20 +16,21 @@ 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.ReadRowsRequest; -import com.google.bigtable.v2.ReadRowsResponse; -import com.google.bigtable.v2.RowFilter; -import com.google.bigtable.v2.RowSet; -import com.google.cloud.bigtable.data.v2.FakeServiceHelper; -import com.google.common.collect.ImmutableList; +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; @@ -40,6 +41,8 @@ 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; @@ -60,27 +63,25 @@ public class BigtableChannelPrimerTest { BigtableChannelPrimer primer; ManagedChannel channel; private LogHandler logHandler; - private FakeServiceHelper serviceHelper; + private Server server; @Before public void setup() throws IOException { fakeService = new FakeService(); metadataInterceptor = new MetadataInterceptor(); - serviceHelper = new FakeServiceHelper(metadataInterceptor, fakeService); - serviceHelper.start(); + server = FakeServiceBuilder.create(fakeService).intercept(metadataInterceptor).start(); + primer = BigtableChannelPrimer.create( - OAuth2Credentials.create(new AccessToken(TOKEN_VALUE, null)), "fake-project", "fake-instance", "fake-app-profile", - ImmutableList.of("table1", "table2")); + OAuth2Credentials.create(new AccessToken(TOKEN_VALUE, null)), + ImmutableMap.of("bigtable-feature", "fake-feature")); channel = - ManagedChannelBuilder.forAddress("localhost", serviceHelper.getPort()) - .usePlaintext() - .build(); + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); logHandler = new LogHandler(); Logger.getLogger(BigtableChannelPrimer.class.toString()).addHandler(logHandler); } @@ -89,7 +90,7 @@ public void setup() throws IOException { public void teardown() { Logger.getLogger(BigtableChannelPrimer.class.toString()).removeHandler(logHandler); channel.shutdown(); - serviceHelper.shutdown(); + server.shutdown(); } @Test @@ -105,63 +106,45 @@ public void testCredentials() { @Test public void testRequests() { - final Queue requests = new ConcurrentLinkedQueue<>(); + final Queue requests = new ConcurrentLinkedQueue<>(); - fakeService.readRowsCallback = - new ApiFunction() { + fakeService.pingAndWarmCallback = + new ApiFunction() { @Override - public ReadRowsResponse apply(ReadRowsRequest req) { + public PingAndWarmResponse apply(PingAndWarmRequest req) { requests.add(req); - return ReadRowsResponse.getDefaultInstance(); + return PingAndWarmResponse.getDefaultInstance(); } }; primer.primeChannel(channel); assertThat(requests) .containsExactly( - ReadRowsRequest.newBuilder() - .setTableName("projects/fake-project/instances/fake-instance/tables/table1") - .setAppProfileId("fake-app-profile") - .setRows(RowSet.newBuilder().addRowKeys(BigtableChannelPrimer.PRIMING_ROW_KEY)) - .setFilter(RowFilter.newBuilder().setBlockAllFilter(true).build()) - .setRowsLimit(1) - .build(), - ReadRowsRequest.newBuilder() - .setTableName("projects/fake-project/instances/fake-instance/tables/table2") + PingAndWarmRequest.newBuilder() + .setName("projects/fake-project/instances/fake-instance") .setAppProfileId("fake-app-profile") - .setRows(RowSet.newBuilder().addRowKeys(BigtableChannelPrimer.PRIMING_ROW_KEY)) - .setFilter(RowFilter.newBuilder().setBlockAllFilter(true).build()) - .setRowsLimit(1) .build()); } @Test public void testErrorsAreLogged() { - fakeService.readRowsCallback = - new ApiFunction() { + fakeService.pingAndWarmCallback = + new ApiFunction() { @Override - public ReadRowsResponse apply(ReadRowsRequest req) { + public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { throw new StatusRuntimeException(Status.FAILED_PRECONDITION); } }; primer.primeChannel(channel); - assertThat(logHandler.logs).hasSize(2); + assertThat(logHandler.logs).hasSize(1); for (LogRecord log : logHandler.logs) { - assertThat(log.getMessage()).contains("FAILED_PRECONDITION"); + assertThat(log.getThrown().getMessage()).contains("FAILED_PRECONDITION"); } } @Test - public void testErrorsAreLoggedForBasic() { - BigtableChannelPrimer basicPrimer = - BigtableChannelPrimer.create( - OAuth2Credentials.create(new AccessToken(TOKEN_VALUE, null)), - "fake-project", - "fake-instance", - "fake-app-profile", - ImmutableList.of()); - + public void testChannelErrorsAreLogged() { ManagedChannel channel = Mockito.mock( ManagedChannel.class, new ThrowsException(new UnsupportedOperationException())); @@ -169,10 +152,53 @@ public void testErrorsAreLoggedForBasic() { assertThat(logHandler.logs).hasSize(1); for (LogRecord log : logHandler.logs) { - assertThat(log.getMessage()).contains("Unexpected"); + 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<>(); @@ -188,20 +214,19 @@ public Listener interceptCall( } static class FakeService extends BigtableImplBase { - private ApiFunction readRowsCallback = - new ApiFunction() { + private ApiFunction pingAndWarmCallback = + new ApiFunction() { @Override - public ReadRowsResponse apply(ReadRowsRequest readRowsRequest) { - return ReadRowsResponse.getDefaultInstance(); + public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { + return PingAndWarmResponse.getDefaultInstance(); } }; @Override - public void readRows( - ReadRowsRequest request, StreamObserver responseObserver) { - + public void pingAndWarm( + PingAndWarmRequest request, StreamObserver responseObserver) { try { - responseObserver.onNext(readRowsCallback.apply(request)); + responseObserver.onNext(pingAndWarmCallback.apply(request)); responseObserver.onCompleted(); } catch (RuntimeException e) { responseObserver.onError(e); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/BigtableUnaryOperationCallableTest.java new file mode 100644 index 0000000000..2b07044c9a --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java deleted file mode 100644 index 5441f1d1f8..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CheckAndMutateRowCallableTest.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.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.CheckAndMutateRowRequest; -import com.google.bigtable.v2.CheckAndMutateRowResponse; -import com.google.bigtable.v2.Mutation.DeleteFromRow; -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.ConditionalRowMutation; -import com.google.cloud.bigtable.data.v2.models.Mutation; -import com.google.protobuf.ByteString; -import io.grpc.Status.Code; -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 CheckAndMutateRowCallableTest { - - private final RequestContext requestContext = - RequestContext.create("my-project", "my-instance", "my-app-profile"); - private FakeCallable inner; - private CheckAndMutateRowCallable callable; - - @Before - public void setUp() { - inner = new FakeCallable(); - callable = new CheckAndMutateRowCallable(inner, requestContext); - } - - @Test - public void requestIsCorrect() { - callable.futureCall( - ConditionalRowMutation.create("my-table", "row-key").then(Mutation.create().deleteRow())); - - assertThat(inner.request) - .isEqualTo( - CheckAndMutateRowRequest.newBuilder() - .setTableName( - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) - .setRowKey(ByteString.copyFromUtf8("row-key")) - .setAppProfileId(requestContext.getAppProfileId()) - .addTrueMutations( - com.google.bigtable.v2.Mutation.newBuilder() - .setDeleteFromRow(DeleteFromRow.getDefaultInstance())) - .build()); - } - - @Test - public void responseCorrectlyTransformed() throws Exception { - ApiFuture result = - callable.futureCall( - ConditionalRowMutation.create("my-table", "row-key") - .then(Mutation.create().deleteRow())); - - inner.response.set(CheckAndMutateRowResponse.newBuilder().setPredicateMatched(true).build()); - - assertThat(result.get(1, TimeUnit.SECONDS)).isEqualTo(true); - } - - @Test - public void errorIsPropagated() throws Exception { - ApiFuture result = - callable.futureCall( - ConditionalRowMutation.create("my-table", "row-key") - .then(Mutation.create().deleteRow())); - - 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 { - CheckAndMutateRowRequest request; - ApiCallContext callContext; - SettableApiFuture response = SettableApiFuture.create(); - - @Override - public ApiFuture futureCall( - CheckAndMutateRowRequest request, ApiCallContext context) { - this.request = request; - this.callContext = context; - - return response; - } - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallableTest.java new file mode 100644 index 0000000000..c15e20b561 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java new file mode 100644 index 0000000000..182fd68726 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java @@ -0,0 +1,844 @@ +/* + * 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 + + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlCallableTest.java new file mode 100644 index 0000000000..5a493653a7 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStatsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/DynamicFlowControlStatsTest.java new file mode 100644 index 0000000000..8863b4a1a9 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseRetryTest.java new file mode 100644 index 0000000000..b974649a53 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseTest.java new file mode 100644 index 0000000000..74d05e37fe --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java index 10ba675826..2f243978d1 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettingsTest.java @@ -18,8 +18,8 @@ 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.core.FixedCredentialsProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.retrying.RetrySettings; import com.google.api.gax.rpc.ServerStreamingCallSettings; @@ -27,12 +27,16 @@ 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.stub.metrics.HeaderTracer; +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; @@ -51,6 +55,7 @@ import org.threeten.bp.Duration; @RunWith(JUnit4.class) +@SuppressWarnings("deprecation") // TODO: remove this public class EnhancedBigtableStubSettingsTest { @Test public void instanceNameIsRequiredTest() { @@ -76,7 +81,7 @@ public void settingsAreNotLostTest() { CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); WatchdogProvider watchdogProvider = Mockito.mock(WatchdogProvider.class); Duration watchdogInterval = Duration.ofSeconds(12); - HeaderTracer headerTracer = Mockito.mock(HeaderTracer.class); + String metricsEndpoint = "test-endpoint:443"; EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() @@ -88,7 +93,7 @@ public void settingsAreNotLostTest() { .setCredentialsProvider(credentialsProvider) .setStreamWatchdogProvider(watchdogProvider) .setStreamWatchdogCheckInterval(watchdogInterval) - .setHeaderTracer(headerTracer); + .setMetricsEndpoint(metricsEndpoint); verifyBuilder( builder, @@ -100,7 +105,7 @@ public void settingsAreNotLostTest() { credentialsProvider, watchdogProvider, watchdogInterval, - headerTracer); + metricsEndpoint); verifySettings( builder.build(), projectId, @@ -111,7 +116,7 @@ public void settingsAreNotLostTest() { credentialsProvider, watchdogProvider, watchdogInterval, - headerTracer); + metricsEndpoint); verifyBuilder( builder.build().toBuilder(), projectId, @@ -122,7 +127,7 @@ public void settingsAreNotLostTest() { credentialsProvider, watchdogProvider, watchdogInterval, - headerTracer); + metricsEndpoint); } private void verifyBuilder( @@ -135,7 +140,7 @@ private void verifyBuilder( CredentialsProvider credentialsProvider, WatchdogProvider watchdogProvider, Duration watchdogInterval, - HeaderTracer headerTracer) { + String metricsEndpoint) { assertThat(builder.getProjectId()).isEqualTo(projectId); assertThat(builder.getInstanceId()).isEqualTo(instanceId); assertThat(builder.getAppProfileId()).isEqualTo(appProfileId); @@ -144,7 +149,7 @@ private void verifyBuilder( assertThat(builder.getCredentialsProvider()).isEqualTo(credentialsProvider); assertThat(builder.getStreamWatchdogProvider()).isSameInstanceAs(watchdogProvider); assertThat(builder.getStreamWatchdogCheckInterval()).isEqualTo(watchdogInterval); - assertThat(builder.getHeaderTracer()).isEqualTo(headerTracer); + assertThat(builder.getMetricsEndpoint()).isEqualTo(metricsEndpoint); } private void verifySettings( @@ -157,7 +162,7 @@ private void verifySettings( CredentialsProvider credentialsProvider, WatchdogProvider watchdogProvider, Duration watchdogInterval, - HeaderTracer headerTracer) { + String metricsEndpoint) { assertThat(settings.getProjectId()).isEqualTo(projectId); assertThat(settings.getInstanceId()).isEqualTo(instanceId); assertThat(settings.getAppProfileId()).isEqualTo(appProfileId); @@ -166,7 +171,7 @@ private void verifySettings( assertThat(settings.getCredentialsProvider()).isEqualTo(credentialsProvider); assertThat(settings.getStreamWatchdogProvider()).isSameInstanceAs(watchdogProvider); assertThat(settings.getStreamWatchdogCheckInterval()).isEqualTo(watchdogInterval); - assertThat(settings.getHeaderTracer()).isEqualTo(headerTracer); + assertThat(settings.getMetricsEndpoint()).isEqualTo(metricsEndpoint); } @Test @@ -182,7 +187,7 @@ public void multipleChannelsByDefaultTest() { InstantiatingGrpcChannelProvider provider = (InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider(); - assertThat(provider.toBuilder().getPoolSize()).isGreaterThan(1); + assertThat(provider.getChannelPoolSettings().getInitialChannelCount()).isGreaterThan(1); } @Test @@ -193,7 +198,10 @@ public void readRowsIsNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .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() @@ -202,7 +210,6 @@ public void readRowsIsNotLostTest() { .setInitialRpcTimeout(Duration.ofSeconds(10)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeout(Duration.ofSeconds(10)) - .setJittered(true) .build(); builder @@ -251,7 +258,8 @@ public void readRowIsNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId("my-project") - .setInstanceId("my-instance"); + .setInstanceId("my-instance") + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -260,7 +268,6 @@ public void readRowIsNotLostTest() { .setInitialRpcTimeout(Duration.ofSeconds(10)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeout(Duration.ofSeconds(10)) - .setJittered(true) .build(); builder @@ -303,7 +310,8 @@ public void readRowRetryCodesMustMatch() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId("my-project") - .setInstanceId("my-instance"); + .setInstanceId("my-instance") + .setRefreshingChannel(false); builder.readRowsSettings().setRetryableCodes(Code.DEADLINE_EXCEEDED); @@ -337,7 +345,8 @@ public void sampleRowKeysSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -346,7 +355,6 @@ public void sampleRowKeysSettingsAreNotLostTest() { .setInitialRpcTimeout(Duration.ofSeconds(10)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeout(Duration.ofSeconds(10)) - .setJittered(true) .build(); builder @@ -384,7 +392,8 @@ public void mutateRowSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -393,7 +402,6 @@ public void mutateRowSettingsAreNotLostTest() { .setInitialRpcTimeout(Duration.ofSeconds(10)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeout(Duration.ofSeconds(10)) - .setJittered(true) .build(); builder @@ -431,7 +439,10 @@ public void bulkMutateRowsSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); + + assertThat(builder.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()).isFalse(); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -440,16 +451,24 @@ public void bulkMutateRowsSettingsAreNotLostTest() { .setInitialRpcTimeout(Duration.ofSeconds(10)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeout(Duration.ofSeconds(10)) - .setJittered(true) .build(); - BatchingSettings batchingSettings = BatchingSettings.newBuilder().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()) @@ -457,6 +476,20 @@ public void bulkMutateRowsSettingsAreNotLostTest() { 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); @@ -464,6 +497,23 @@ public void bulkMutateRowsSettingsAreNotLostTest() { .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); @@ -471,6 +521,23 @@ public void bulkMutateRowsSettingsAreNotLostTest() { .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 @@ -481,7 +548,8 @@ public void bulkReadRowsSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -490,7 +558,6 @@ public void bulkReadRowsSettingsAreNotLostTest() { .setInitialRpcTimeout(Duration.ofSeconds(10)) .setRpcTimeoutMultiplier(1) .setMaxRpcTimeout(Duration.ofSeconds(10)) - .setJittered(true) .build(); BatchingSettings batchingSettings = BatchingSettings.newBuilder().build(); @@ -556,7 +623,8 @@ public void checkAndMutateRowSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder().build(); builder @@ -580,6 +648,79 @@ public void checkAndMutateRowSettingsAreNotLostTest() { .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 = @@ -591,6 +732,130 @@ public void checkAndMutateRowSettingsAreSane() { 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); @@ -613,9 +878,7 @@ public void isRefreshingChannelDefaultValueTest() { EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) .setInstanceId(dummyInstanceId); - assertThat(builder.isRefreshingChannel()).isFalse(); - assertThat(builder.build().isRefreshingChannel()).isFalse(); - assertThat(builder.build().toBuilder().isRefreshingChannel()).isFalse(); + assertThat(builder.isRefreshingChannel()).isTrue(); } @Test @@ -632,34 +895,17 @@ public void isRefreshingChannelFalseValueTest() { assertThat(builder.build().toBuilder().isRefreshingChannel()).isFalse(); } - @Test - public void verifyDefaultHeaderTracerNotNullTest() { - String dummyProjectId = "my-project"; - String dummyInstanceId = "my-instance"; - EnhancedBigtableStubSettings.Builder builder = - EnhancedBigtableStubSettings.newBuilder() - .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); - assertThat(builder.getHeaderTracer()).isNotNull(); - assertThat(builder.build().getHeaderTracer()).isNotNull(); - assertThat(builder.build().toBuilder().getHeaderTracer()).isNotNull(); - } - static final String[] SETTINGS_LIST = { "projectId", "instanceId", "appProfileId", "isRefreshingChannel", - "primedTableIds", - "headerTracer", - "readRowsSettings", - "readRowSettings", - "sampleRowKeysSettings", - "mutateRowSettings", - "bulkMutateRowsSettings", - "bulkReadRowsSettings", - "checkAndMutateRowSettings", - "readModifyWriteRowSettings", + "perOpSettings", + "metricsProvider", + "metricsEndpoint", + "areInternalMetricsEnabled", + "jwtAudience", + "directPathConfig", }; @Test @@ -669,21 +915,16 @@ public void testToString() { .setProjectId("our-project-85") .setInstanceId("our-instance-06") .setAppProfileId("our-appProfile-06") + .setRefreshingChannel(false) .build(); checkToString(defaultSettings); - assertThat(defaultSettings.toString()).contains("primedTableIds=[]"); EnhancedBigtableStubSettings settings = - defaultSettings - .toBuilder() - .setPrimedTableIds("2", "12", "85", "06") - .setEndpoint("example.com:1234") - .build(); + defaultSettings.toBuilder().setEndpoint("example.com:1234").build(); checkToString(settings); assertThat(settings.toString()).contains("endpoint=example.com:1234"); - assertThat(settings.toString()).contains("primedTableIds=[2, 12, 85, 06]"); int nonStaticFields = 0; for (Field field : EnhancedBigtableStubSettings.class.getDeclaredFields()) { @@ -691,8 +932,8 @@ public void testToString() { nonStaticFields++; } } - // failure will signal about adding a new settings property - assertThat(SETTINGS_LIST.length).isEqualTo(nonStaticFields); + // failure will signal about adding a new settings property - feature flag field + assertThat(SETTINGS_LIST.length).isEqualTo(nonStaticFields - 1); } void checkToString(EnhancedBigtableStubSettings settings) { @@ -732,16 +973,6 @@ public void refreshingChannelSetFixedCredentialProvider() throws Exception { .setRefreshingChannel(true) .setCredentialsProvider(credentialsProvider); assertThat(builder.isRefreshingChannel()).isTrue(); - // Verify that isRefreshing setting is not lost and stubSettings will always return the same - // credential - EnhancedBigtableStubSettings stubSettings = builder.build(); - assertThat(stubSettings.isRefreshingChannel()).isTrue(); - assertThat(stubSettings.getCredentialsProvider()).isInstanceOf(FixedCredentialsProvider.class); - assertThat(stubSettings.getCredentialsProvider().getCredentials()) - .isEqualTo(expectedCredentials); - assertThat(stubSettings.toBuilder().isRefreshingChannel()).isTrue(); - assertThat(stubSettings.toBuilder().getCredentialsProvider().getCredentials()) - .isEqualTo(expectedCredentials); } private static class FakeCredentials extends Credentials { diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java index 194123b1bd..462699bbd0 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubTest.java @@ -15,51 +15,160 @@ */ 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.FakeServiceHelper; +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, "fake-table"); + 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<>()); - FakeServiceHelper serviceHelper; + private Server server; private MetadataInterceptor metadataInterceptor; + private ContextInterceptor contextInterceptor; private FakeDataService fakeDataService; private EnhancedBigtableStubSettings defaultSettings; private EnhancedBigtableStub enhancedBigtableStub; @@ -67,16 +176,23 @@ public class EnhancedBigtableStubTest { @Before public void setUp() throws IOException, IllegalAccessException, InstantiationException { metadataInterceptor = new MetadataInterceptor(); - fakeDataService = new FakeDataService(); - serviceHelper = new FakeServiceHelper(metadataInterceptor, fakeDataService); - serviceHelper.start(); + contextInterceptor = new ContextInterceptor(); + fakeDataService = Mockito.spy(new FakeDataService()); + + server = + FakeServiceBuilder.create(fakeDataService) + .intercept(contextInterceptor) + .intercept(metadataInterceptor) + .start(); defaultSettings = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setAppProfileId(APP_PROFILE_ID) .setCredentialsProvider(NoCredentialsProvider.create()) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() .build() .getStubSettings(); @@ -85,7 +201,312 @@ public void setUp() throws IOException, IllegalAccessException, InstantiationExc @After public void tearDown() { - serviceHelper.shutdown(); + 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(); + } + } + + @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 @@ -93,7 +514,7 @@ public void testCreateReadRowsCallable() throws InterruptedException { ServerStreamingCallable streamingCallable = enhancedBigtableStub.createReadRowsCallable(new DefaultRowAdapter()); - Query request = Query.create("table-id").rowKey("row-key"); + 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)); @@ -125,16 +546,17 @@ public void testCreateReadRowsRawCallable() throws InterruptedException { @Test public void testChannelPrimerConfigured() throws IOException { + // TODO: remove the suppression once setRefreshingChannel can be removed + @SuppressWarnings("deprecation") EnhancedBigtableStubSettings settings = - defaultSettings - .toBuilder() + defaultSettings.toBuilder() .setRefreshingChannel(true) - .setPrimedTableIds("table1", "table2") + .setDirectPathConfig(EnhancedBigtableStubSettings.DirectPathConfig.DEFAULT) .build(); try (EnhancedBigtableStub ignored = EnhancedBigtableStub.create(settings)) { - // priming will issue a request per table on startup - assertThat(fakeDataService.requests).hasSize(2); + // direct access checker ping + assertThat(fakeDataService.pingRequests).hasSize(2); } } @@ -143,7 +565,7 @@ public void testUserAgent() throws InterruptedException { ServerStreamingCallable streamingCallable = enhancedBigtableStub.createReadRowsCallable(new DefaultRowAdapter()); - Query request = Query.create("table-id").rowKey("row-key"); + Query request = Query.create(TABLE_ID).rowKey("row-key"); streamingCallable.call(request).iterator().next(); assertThat(metadataInterceptor.headers).hasSize(1); @@ -152,6 +574,409 @@ public void testUserAgent() throws InterruptedException { .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(); @@ -165,17 +990,112 @@ public Listener interceptCall( } } + 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(); - @SuppressWarnings("unchecked") 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( @@ -190,5 +1110,65 @@ public void readRows( .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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java index 760dd19911..146cc1017f 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/HeadersTest.java @@ -15,8 +15,13 @@ */ 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; @@ -27,6 +32,8 @@ 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; @@ -35,16 +42,26 @@ 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.FakeServiceHelper; -import com.google.cloud.bigtable.data.v2.internal.NameUtil; -import com.google.cloud.bigtable.data.v2.models.*; +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; @@ -57,9 +74,11 @@ public class HeadersTest { 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 TABLE_NAME = - NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); + 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"; @@ -70,18 +89,20 @@ public class HeadersTest { private static final Metadata.Key TEST_FIXED_HEADER = Metadata.Key.of(TEST_FIXED_HEADER_STRING, Metadata.ASCII_STRING_MARSHALLER); - FakeServiceHelper serviceHelper; - private BlockingQueue sentMetadata = new ArrayBlockingQueue<>(10); + private Server server; + private final BlockingQueue sentMetadata = new ArrayBlockingQueue<>(10); private BigtableDataClient client; @Before public void setUp() throws Exception { - serviceHelper = new FakeServiceHelper(new MetadataInterceptor(), new FakeBigtableService()); - serviceHelper.start(); + server = + FakeServiceBuilder.create(new FakeBigtableService()) + .intercept(new MetadataInterceptor()) + .start(); BigtableDataSettings.Builder settings = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setAppProfileId(APP_PROFILE_ID); @@ -95,11 +116,7 @@ public void setUp() throws Exception { .setHeaderProvider(headerProvider) .bulkMutateRowsSettings() .setBatchingSettings( - settings - .stubSettings() - .bulkMutateRowsSettings() - .getBatchingSettings() - .toBuilder() + settings.stubSettings().bulkMutateRowsSettings().getBatchingSettings().toBuilder() .setElementCountThreshold(1L) .build()); @@ -109,7 +126,7 @@ public void setUp() throws Exception { @After public void tearDown() throws Exception { client.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test @@ -120,20 +137,22 @@ public void readRowsTest() { @Test public void sampleRowKeysTest() { - client.sampleRowKeysAsync(TABLE_ID); + @SuppressWarnings("UnusedVariable") + ApiFuture> ignored = client.sampleRowKeysAsync(TABLE_ID); verifyHeaderSent(); } @Test public void mutateRowTest() { - client.mutateRowAsync(RowMutation.create(TABLE_ID, "fake-key").deleteRow()); + 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)) { - batcher.add(RowMutationEntry.create("fake-key").deleteRow()); + ApiFuture ignored = batcher.add(RowMutationEntry.create("fake-key").deleteRow()); } catch (RuntimeException e) { // Ignore the errors: none of the methods are actually implemented } @@ -142,19 +161,40 @@ public void mutateRowsTest() throws InterruptedException { @Test public void checkAndMutateRowTest() { - client.checkAndMutateRowAsync( - ConditionalRowMutation.create(TABLE_ID, "fake-key").then(Mutation.create().deleteRow())); + ApiFuture ignored = + client.checkAndMutateRowAsync( + ConditionalRowMutation.create(TABLE_ID, "fake-key") + .then(Mutation.create().deleteRow())); verifyHeaderSent(); } @Test public void readModifyWriteTest() { - client.readModifyWriteRowAsync( - ReadModifyWriteRow.create(TABLE_ID, "fake-key").increment("cf", "q", 1)); + 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(); @@ -163,7 +203,11 @@ private void verifyHeaderSent() { } String requestParamsvalue = metadata.get(X_GOOG_REQUEST_PARAMS_KEY); - assertThat(requestParamsvalue).containsMatch("(^|.*&)table_name=" + TABLE_NAME + "($|&.*)"); + 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 + "($|&.*)"); @@ -226,6 +270,7 @@ public void checkAndMutateRow( CheckAndMutateRowRequest request, StreamObserver responseObserver) { responseObserver.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); } @Override @@ -235,5 +280,16 @@ public void readModifyWriteRow( 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java deleted file mode 100644 index 2b68829257..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/MutateRowCallableTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.SettableApiFuture; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.bigtable.v2.MutateRowRequest; -import com.google.bigtable.v2.MutateRowResponse; -import com.google.cloud.bigtable.data.v2.internal.RequestContext; -import com.google.cloud.bigtable.data.v2.models.RowMutation; -import com.google.common.truth.Truth; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -@RunWith(JUnit4.class) -public class MutateRowCallableTest { - - private static final RequestContext REQUEST_CONTEXT = - RequestContext.create("fake-project", "fake-instance", "fake-profile"); - private UnaryCallable innerCallable; - private ArgumentCaptor innerMutation; - private SettableApiFuture innerResult; - - @SuppressWarnings("unchecked") - @Before - public void setUp() { - innerCallable = Mockito.mock(UnaryCallable.class); - innerMutation = ArgumentCaptor.forClass(MutateRowRequest.class); - innerResult = SettableApiFuture.create(); - Mockito.when( - innerCallable.futureCall(innerMutation.capture(), Mockito.any(ApiCallContext.class))) - .thenReturn(innerResult); - } - - @Test - public void testRequestConversion() { - MutateRowCallable callable = new MutateRowCallable(innerCallable, REQUEST_CONTEXT); - RowMutation outerRequest = - RowMutation.create("fake-table", "fake-key") - .setCell("fake-family", "fake-qualifier", 1_000, "fake-value"); - - innerResult.set(MutateRowResponse.getDefaultInstance()); - callable.call(outerRequest); - - Truth.assertThat(innerMutation.getValue()).isEqualTo(outerRequest.toProto(REQUEST_CONTEXT)); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/NoOpChannelPrimerTest.java new file mode 100644 index 0000000000..60bbad5196 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingCallableTest.java new file mode 100644 index 0000000000..652049b266 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java deleted file mode 100644 index 4a8f857d05..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/ReadModifyWriteRowCallableTest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * 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.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.Cell; -import com.google.bigtable.v2.Column; -import com.google.bigtable.v2.Family; -import com.google.bigtable.v2.ReadModifyWriteRowRequest; -import com.google.bigtable.v2.ReadModifyWriteRowResponse; -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.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.common.collect.ImmutableList; -import com.google.protobuf.ByteString; -import io.grpc.Status.Code; -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 ReadModifyWriteRowCallableTest { - private final RequestContext requestContext = - RequestContext.create("fake-project", "fake-instance", "fake-profile"); - private FakeCallable inner; - private ReadModifyWriteRowCallable callable; - - @Before - public void setUp() { - inner = new FakeCallable(); - callable = new ReadModifyWriteRowCallable(inner, requestContext); - } - - @Test - public void requestIsCorrect() { - callable.futureCall( - ReadModifyWriteRow.create("my-table", "my-key").append("my-family", "", "suffix")); - - assertThat(inner.request) - .isEqualTo( - ReadModifyWriteRowRequest.newBuilder() - .setTableName( - NameUtil.formatTableName( - requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) - .setAppProfileId(requestContext.getAppProfileId()) - .setRowKey(ByteString.copyFromUtf8("my-key")) - .addRules( - ReadModifyWriteRule.newBuilder() - .setFamilyName("my-family") - .setColumnQualifier(ByteString.EMPTY) - .setAppendValue(ByteString.copyFromUtf8("suffix"))) - .build()); - } - - @Test - public void responseCorrectlyTransformed() throws Exception { - ApiFuture result = - callable.futureCall( - ReadModifyWriteRow.create("my-table", "my-key").append("my-family", "col", "suffix")); - - inner.response.set( - ReadModifyWriteRowResponse.newBuilder() - .setRow( - com.google.bigtable.v2.Row.newBuilder() - .setKey(ByteString.copyFromUtf8("my-key")) - .addFamilies( - Family.newBuilder() - .setName("my-family") - .addColumns( - Column.newBuilder() - .setQualifier(ByteString.copyFromUtf8("col")) - .addCells( - Cell.newBuilder() - .setTimestampMicros(1_000) - .setValue(ByteString.copyFromUtf8("suffix")))))) - .build()); - - assertThat(result.get(1, TimeUnit.SECONDS)) - .isEqualTo( - Row.create( - ByteString.copyFromUtf8("my-key"), - ImmutableList.of( - RowCell.create( - "my-family", - ByteString.copyFromUtf8("col"), - 1_000, - ImmutableList.of(), - ByteString.copyFromUtf8("suffix"))))); - } - - @Test - public void responseSortsFamilies() throws Exception { - ByteString col = ByteString.copyFromUtf8("col1"); - ByteString value1 = ByteString.copyFromUtf8("value1"); - ByteString value2 = ByteString.copyFromUtf8("value2"); - - ApiFuture result = - callable.futureCall( - ReadModifyWriteRow.create("my-table", "my-key").append("my-family", "col", "suffix")); - - inner.response.set( - ReadModifyWriteRowResponse.newBuilder() - .setRow( - com.google.bigtable.v2.Row.newBuilder() - .setKey(ByteString.copyFromUtf8("my-key")) - // family2 is out of order - .addFamilies( - Family.newBuilder() - .setName("family2") - .addColumns( - Column.newBuilder() - .setQualifier(col) - .addCells( - Cell.newBuilder() - .setTimestampMicros(1_000) - .setValue(value2)))) - .addFamilies( - Family.newBuilder() - .setName("family1") - .addColumns( - Column.newBuilder() - .setQualifier(col) - .addCells( - Cell.newBuilder() - .setTimestampMicros(1_000) - .setValue(value1))) - .build())) - .build()); - - assertThat(result.get(1, TimeUnit.SECONDS)) - .isEqualTo( - Row.create( - ByteString.copyFromUtf8("my-key"), - ImmutableList.of( - RowCell.create("family1", col, 1_000, ImmutableList.of(), value1), - RowCell.create("family2", col, 1_000, ImmutableList.of(), value2)))); - } - - @Test - public void errorIsPropagated() throws Exception { - ApiFuture result = - callable.futureCall( - ReadModifyWriteRow.create("my-table", "my-key").append("my-family", "", "suffix")); - - 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 { - ReadModifyWriteRowRequest request; - ApiCallContext callContext; - SettableApiFuture response = SettableApiFuture.create(); - - @Override - public ApiFuture futureCall( - ReadModifyWriteRowRequest request, ApiCallContext context) { - this.request = request; - this.callContext = context; - - return response; - } - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java new file mode 100644 index 0000000000..4903433a65 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java @@ -0,0 +1,640 @@ +/* + * 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 + + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java similarity index 77% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java index 40a30d3263..8bd40a363b 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google LLC + * 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. @@ -23,11 +23,12 @@ 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.SampleRowKeysRequest; 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; @@ -40,26 +41,27 @@ import org.junit.runners.JUnit4; @RunWith(JUnit4.class) -public class SampleRowKeysCallableTest { +public class SampleRowKeysCallableWithRequestTest { private final RequestContext requestContext = RequestContext.create("my-project", "my-instance", "my-profile"); private FakeCallable inner; - private SampleRowKeysCallable callable; + private SampleRowKeysCallableWithRequest callable; @Before public void setUp() { inner = new FakeCallable(); - callable = new SampleRowKeysCallable(inner, requestContext); + callable = new SampleRowKeysCallableWithRequest(inner, requestContext); } @Test public void requestIsCorrect() { - callable.futureCall("my-table"); + ApiFuture> ignored = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); assertThat(inner.request) .isEqualTo( - SampleRowKeysRequest.newBuilder() + com.google.bigtable.v2.SampleRowKeysRequest.newBuilder() .setTableName( NameUtil.formatTableName( requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) @@ -69,7 +71,8 @@ public void requestIsCorrect() { @Test public void responseCorrectlyTransformed() throws Exception { - ApiFuture> result = callable.futureCall("my-table"); + ApiFuture> result = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); inner.response.set( ImmutableList.of( @@ -91,7 +94,8 @@ public void responseCorrectlyTransformed() throws Exception { @Test public void errorIsPropagated() throws Exception { - ApiFuture> result = callable.futureCall("my-table"); + ApiFuture> result = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); Throwable expectedError = new NotFoundException("fake error", null, GrpcStatusCode.of(Code.NOT_FOUND), false); @@ -108,14 +112,15 @@ public void errorIsPropagated() throws Exception { } static class FakeCallable - extends UnaryCallable> { - SampleRowKeysRequest request; + extends UnaryCallable< + com.google.bigtable.v2.SampleRowKeysRequest, List> { + com.google.bigtable.v2.SampleRowKeysRequest request; ApiCallContext callContext; SettableApiFuture> response = SettableApiFuture.create(); @Override public ApiFuture> futureCall( - SampleRowKeysRequest request, ApiCallContext context) { + com.google.bigtable.v2.SampleRowKeysRequest request, ApiCallContext context) { this.request = request; this.callContext = context; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SkipTrailersTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SkipTrailersTest.java new file mode 100644 index 0000000000..40f7e5b17a --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/TransformingServerStreamingCallableTest.java new file mode 100644 index 0000000000..856d732f5c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java new file mode 100644 index 0000000000..a5201770ee --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachineTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachineTest.java new file mode 100644 index 0000000000..9cdd74f0de --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/GenerateInitialChangeStreamPartitionsUserCallableTest.java new file mode 100644 index 0000000000..885b1c6355 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java new file mode 100644 index 0000000000..ce278f50c8 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamRetryTest.java new file mode 100644 index 0000000000..80f14b02cf --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamUserCallableTest.java new file mode 100644 index 0000000000..84f9765ea6 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java new file mode 100644 index 0000000000..1aceebd64f --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerTest.java deleted file mode 100644 index cedb227bad..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/CompositeTracerTest.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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 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.common.collect.ImmutableList; -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; -import org.threeten.bp.Duration; - -@RunWith(JUnit4.class) -public class CompositeTracerTest { - @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); - - @Mock private ApiTracer child1; - @Mock private ApiTracer child2; - - private CompositeTracer compositeTracer; - - @Before - public void setup() { - compositeTracer = new CompositeTracer(ImmutableList.of(child1, child2)); - } - - @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 parentScope = compositeTracer.inScope(); - - parentScope.close(); - verify(scope1, times(1)).close(); - } - - @Test - public void testOperationSucceeded() { - compositeTracer.operationSucceeded(); - verify(child1, times(1)).operationSucceeded(); - verify(child2, times(1)).operationSucceeded(); - } - - @Test - public void testOperationCancelled() { - compositeTracer.operationCancelled(); - verify(child1, times(1)).operationCancelled(); - verify(child2, 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); - } - - @Test - public void testConnectionSelected() { - compositeTracer.connectionSelected("connection-one"); - verify(child1, times(1)).connectionSelected("connection-one"); - verify(child2, times(1)).connectionSelected("connection-one"); - } - - @Test - public void testAttemptStarted() { - compositeTracer.attemptStarted(3); - verify(child1, times(1)).attemptStarted(3); - verify(child2, times(1)).attemptStarted(3); - } - - @Test - public void testAttemptSucceeded() { - compositeTracer.attemptSucceeded(); - verify(child1, times(1)).attemptSucceeded(); - verify(child2, times(1)).attemptSucceeded(); - } - - @Test - public void testAttemptCancelled() { - compositeTracer.attemptCancelled(); - verify(child1, times(1)).attemptCancelled(); - verify(child2, times(1)).attemptCancelled(); - } - - @Test - public void testAttemptFailed() { - RuntimeException error = new RuntimeException(); - Duration delay = Duration.ofMillis(10); - compositeTracer.attemptFailed(error, delay); - verify(child1, times(1)).attemptFailed(error, delay); - verify(child2, times(1)).attemptFailed(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); - } - - @Test - public void testAttemptPermanentFailure() { - RuntimeException error = new RuntimeException(); - compositeTracer.attemptPermanentFailure(error); - verify(child1, times(1)).attemptPermanentFailure(error); - verify(child2, 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); - } - - @Test - public void testLroStartSucceeded() { - compositeTracer.lroStartSucceeded(); - verify(child1, times(1)).lroStartSucceeded(); - verify(child2, times(1)).lroStartSucceeded(); - } - - @Test - public void testResponseReceived() { - compositeTracer.responseReceived(); - verify(child1, times(1)).responseReceived(); - verify(child2, times(1)).responseReceived(); - } - - @Test - public void testRequestSent() { - compositeTracer.requestSent(); - verify(child1, times(1)).requestSent(); - verify(child2, 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); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerTest.java deleted file mode 100644 index 30e24dbfe3..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 static com.google.common.truth.Truth.assertThat; - -import com.google.common.collect.ImmutableMap; -import io.opencensus.impl.stats.StatsComponentImpl; -import io.opencensus.stats.StatsComponent; -import io.opencensus.stats.StatsRecorder; -import io.opencensus.tags.TagKey; -import io.opencensus.tags.TagValue; -import io.opencensus.tags.Tagger; -import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.Mockito; - -@RunWith(JUnit4.class) -public class HeaderTracerTest { - - private final StatsComponent localStats = new StatsComponentImpl(); - - @Test - public void testDefaultBuilder() { - HeaderTracer.Builder builder = HeaderTracer.newBuilder(); - HeaderTracer tracer = builder.build(); - assertThat(tracer.getStats()).isNotNull(); - assertThat(tracer.getTagger()).isNotNull(); - assertThat(tracer.getStatsAttributes()).isNotNull(); - assertThat(tracer.getStatsAttributes()).isEmpty(); - } - - @Test - public void testBuilder() { - HeaderTracer.Builder builder = HeaderTracer.newBuilder(); - Map attrs = - ImmutableMap.of(TagKey.create("fake-key"), TagValue.create("fake-value")); - Tagger tagger = Mockito.mock(Tagger.class); - StatsRecorder stats = localStats.getStatsRecorder(); - builder.setStats(stats).setStatsAttributes(attrs).setTagger(tagger); - HeaderTracer headerTracer = builder.build(); - assertThat(headerTracer.getStats()).isEqualTo(stats); - assertThat(headerTracer.getTagger()).isEqualTo(tagger); - assertThat(headerTracer.getStatsAttributes()).isEqualTo(attrs); - } - - @Test - public void testToBuilder() { - HeaderTracer.Builder builder = HeaderTracer.newBuilder(); - Map attrs = - ImmutableMap.of(TagKey.create("fake-key"), TagValue.create("fake-value")); - Tagger tagger = Mockito.mock(Tagger.class); - StatsRecorder stats = localStats.getStatsRecorder(); - builder.setStats(stats).setStatsAttributes(attrs).setTagger(tagger); - HeaderTracer headerTracer = builder.build(); - - HeaderTracer.Builder newBuilder = headerTracer.toBuilder(); - assertThat(newBuilder.build().getStats()).isEqualTo(stats); - assertThat(newBuilder.build().getTagger()).isEqualTo(tagger); - assertThat(newBuilder.build().getStatsAttributes()).isEqualTo(attrs); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerTest.java deleted file mode 100644 index eb7bdaa998..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracerTest.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * 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 static com.google.common.truth.Truth.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.doAnswer; - -import com.google.api.gax.rpc.ClientContext; -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.cloud.bigtable.data.v2.BigtableDataSettings; -import com.google.cloud.bigtable.data.v2.FakeServiceHelper; -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.stub.EnhancedBigtableStub; -import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; -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.protobuf.ByteString; -import com.google.protobuf.BytesValue; -import com.google.protobuf.StringValue; -import io.grpc.Status; -import io.grpc.StatusRuntimeException; -import io.grpc.stub.StreamObserver; -import io.opencensus.impl.stats.StatsComponentImpl; -import io.opencensus.tags.TagKey; -import io.opencensus.tags.TagValue; -import io.opencensus.tags.Tags; -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.invocation.InvocationOnMock; -import org.mockito.junit.MockitoJUnit; -import org.mockito.junit.MockitoRule; -import org.mockito.stubbing.Answer; - -@RunWith(JUnit4.class) -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 String TABLE_ID = "fake-table"; - - 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(); - - FakeServiceHelper serviceHelper; - - @Mock(answer = Answers.CALLS_REAL_METHODS) - private BigtableGrpc.BigtableImplBase mockService; - - private StatsComponentImpl localStats = new StatsComponentImpl(); - private EnhancedBigtableStub stub; - - @Before - public void setUp() throws Exception { - serviceHelper = new FakeServiceHelper(mockService); - serviceHelper.start(); - - RpcViews.registerBigtableClientViews(localStats.getViewManager()); - - BigtableDataSettings settings = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) - .setProjectId(PROJECT_ID) - .setInstanceId(INSTANCE_ID) - .setAppProfileId(APP_PROFILE_ID) - .build(); - EnhancedBigtableStubSettings stubSettings = - EnhancedBigtableStub.finalizeSettings( - settings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder()); - stub = new EnhancedBigtableStub(stubSettings, ClientContext.create(stubSettings)); - } - - @After - public void tearDown() { - stub.close(); - serviceHelper.shutdown(); - } - - @Test - public void testReadRowsLatency() throws InterruptedException { - final long sleepTime = 50; - - doAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - @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), anyObserver(ReadRowsResponse.class)); - - Stopwatch stopwatch = Stopwatch.createStarted(); - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); - long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); - - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); - - 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( - new Answer() { - @Override - public Object answer(InvocationOnMock 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), anyObserver(ReadRowsResponse.class)); - - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); - - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); - - 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 - public void testReadRowsFirstRow() throws InterruptedException { - final long beforeSleep = 50; - final long afterSleep = 50; - - doAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - @SuppressWarnings("unchecked") - StreamObserver observer = - (StreamObserver) invocation.getArguments()[1]; - Thread.sleep(beforeSleep); - observer.onNext(DEFAULT_READ_ROWS_RESPONSES); - Thread.sleep(afterSleep); - observer.onCompleted(); - return null; - } - }) - .when(mockService) - .readRows(any(ReadRowsRequest.class), anyObserver(ReadRowsResponse.class)); - - Stopwatch stopwatch = Stopwatch.createStarted(); - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); - long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); - - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); - - long firstRowLatency = - StatsTestUtils.getAggregationValueAsLong( - localStats, - RpcViewConstants.BIGTABLE_READ_ROWS_FIRST_ROW_LATENCY_VIEW, - ImmutableMap.of(), - PROJECT_ID, - INSTANCE_ID, - APP_PROFILE_ID); - - // adding buffer time to the upper range to allow for a race between the emulator and the client - // recording the duration - assertThat(firstRowLatency).isIn(Range.closed(beforeSleep, elapsed - afterSleep / 2)); - } - - @Test - public void testReadRowsAttemptsPerOp() throws InterruptedException { - final AtomicInteger callCount = new AtomicInteger(0); - - doAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock 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), anyObserver(ReadRowsResponse.class)); - - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); - - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); - - 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( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - @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), anyObserver(ReadRowsResponse.class)); - - Stopwatch stopwatch = Stopwatch.createStarted(); - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); - long elapsed = stopwatch.elapsed(TimeUnit.MILLISECONDS); - - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); - - 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() throws InterruptedException { - try { - stub.bulkMutateRowsCallable().call(BulkMutation.create(TABLE_ID)); - Assert.fail("Invalid request should throw exception"); - } catch (IllegalStateException e) { - Thread.sleep(100); - // 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); - } - } - - @SuppressWarnings("unchecked") - private static StreamObserver anyObserver(Class returnType) { - return (StreamObserver) any(returnType); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersCallableTest.java new file mode 100644 index 0000000000..a990424aee --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java index 2df2aaf2b4..60ec5193e4 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsAttemptCallableTest.java @@ -16,16 +16,19 @@ 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; @@ -38,6 +41,7 @@ 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; @@ -45,7 +49,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.threeten.bp.Duration; +import org.mockito.Mockito; @RunWith(JUnit4.class) public class MutateRowsAttemptCallableTest { @@ -62,6 +66,8 @@ public class MutateRowsAttemptCallableTest { private Set retryCodes; private ApiCallContext callContext; private MockRetryingFuture parentFuture; + private final RetryAlgorithm mockRetryAlgorithm = + Mockito.mock(RetryAlgorithm.class); @Before public void setUp() { @@ -69,6 +75,12 @@ public void setUp() { 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 @@ -82,20 +94,53 @@ public void singleEntrySuccessTest() throws Exception { .build()); MutateRowsAttemptCallable attemptCallable = - new MutateRowsAttemptCallable(innerCallable, request, callContext, retryCodes); + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); attemptCallable.setExternalFuture(parentFuture); attemptCallable.call(); - // Attempt completed successfully and the useless response has been suppressed - assertThat(parentFuture.attemptFuture.get()).isNull(); + // 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().setRpcTimeout(Duration.ZERO).build(); + parentFuture.timedAttemptSettings.toBuilder().setRpcTimeoutDuration(Duration.ZERO).build(); MutateRowsRequest request = MutateRowsRequest.newBuilder().addEntries(Entry.getDefaultInstance()).build(); @@ -107,7 +152,8 @@ public void testNoRpcTimeout() { .build()); MutateRowsAttemptCallable attemptCallable = - new MutateRowsAttemptCallable(innerCallable, request, callContext, retryCodes); + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); attemptCallable.setExternalFuture(parentFuture); attemptCallable.call(); @@ -115,7 +161,7 @@ public void testNoRpcTimeout() { } @Test - public void mixedTest() { + public void mixedTest() throws Exception { // Setup the request & response MutateRowsRequest request = MutateRowsRequest.newBuilder() @@ -139,26 +185,18 @@ public void mixedTest() { .build()); MutateRowsAttemptCallable attemptCallable = - new MutateRowsAttemptCallable(innerCallable, request, callContext, retryCodes); + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); attemptCallable.setExternalFuture(parentFuture); // Make the only call attemptCallable.call(); - // Overall error expectations - Throwable actualError = null; - try { - parentFuture.attemptFuture.get(); - } catch (Throwable t) { - actualError = t.getCause(); - } - - assertThat(actualError).isInstanceOf(MutateRowsException.class); - assertThat(((MutateRowsException) actualError).isRetryable()).isTrue(); + MutateRowsAttemptResult result = parentFuture.attemptFuture.get(); // Entry expectations @SuppressWarnings("ConstantConditions") - List failedMutations = ((MutateRowsException) actualError).getFailedMutations(); + List failedMutations = result.getFailedMutations(); assertThat(failedMutations).hasSize(2); assertThat(failedMutations.get(0).getIndex()).isEqualTo(1); @@ -173,7 +211,7 @@ public void mixedTest() { } @Test - public void nextAttemptTest() { + public void nextAttemptTest() throws Exception { // Setup the request & response for the first call MutateRowsRequest request = MutateRowsRequest.newBuilder() @@ -197,7 +235,8 @@ public void nextAttemptTest() { .build()); MutateRowsAttemptCallable attemptCallable = - new MutateRowsAttemptCallable(innerCallable, request, callContext, retryCodes); + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); attemptCallable.setExternalFuture(parentFuture); // Make the first call @@ -217,19 +256,11 @@ public void nextAttemptTest() { assertThat(innerCallable.lastRequest.getEntries(0).getRowKey()) .isEqualTo(ByteString.copyFromUtf8("1-unavailable")); - // Overall error expectations - Throwable actualError = null; - try { - parentFuture.attemptFuture.get(); - } catch (Throwable t) { - actualError = t.getCause(); - } - assertThat(actualError).isInstanceOf(MutateRowsException.class); - assertThat(((MutateRowsException) actualError).isRetryable()).isFalse(); + MutateRowsAttemptResult result = parentFuture.attemptFuture.get(); // Entry expectations @SuppressWarnings("ConstantConditions") - List failedMutations = ((MutateRowsException) actualError).getFailedMutations(); + List failedMutations = result.getFailedMutations(); assertThat(failedMutations).hasSize(1); assertThat(failedMutations.get(0).getIndex()).isEqualTo(2); @@ -262,7 +293,8 @@ public ApiFuture> futureCall( // Make the call MutateRowsAttemptCallable attemptCallable = - new MutateRowsAttemptCallable(innerCallable, request, callContext, retryCodes); + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); attemptCallable.setExternalFuture(parentFuture); attemptCallable.call(); @@ -314,7 +346,8 @@ public ApiFuture> futureCall( // Make the call MutateRowsAttemptCallable attemptCallable = - new MutateRowsAttemptCallable(innerCallable, request, callContext, retryCodes); + new MutateRowsAttemptCallable( + innerCallable, request, callContext, retryCodes, mockRetryAlgorithm); attemptCallable.setExternalFuture(parentFuture); attemptCallable.call(); @@ -359,8 +392,9 @@ public ApiFuture> futureCall( } } - static class MockRetryingFuture extends AbstractApiFuture implements RetryingFuture { - ApiFuture attemptFuture; + static class MockRetryingFuture extends AbstractApiFuture + implements RetryingFuture { + ApiFuture attemptFuture; TimedAttemptSettings timedAttemptSettings; @@ -371,17 +405,18 @@ static class MockRetryingFuture extends AbstractApiFuture implements Retry MockRetryingFuture(Duration totalTimeout) { this.timedAttemptSettings = TimedAttemptSettings.newBuilder() - .setRpcTimeout(Duration.ofSeconds(1)) - .setRetryDelay(Duration.ZERO) - .setRandomizedRetryDelay(Duration.ZERO) + .setRpcTimeoutDuration(Duration.ofSeconds(1)) + .setRetryDelayDuration(Duration.ZERO) + .setRandomizedRetryDelayDuration(Duration.ZERO) .setAttemptCount(0) .setFirstAttemptStartTimeNanos(0) - .setGlobalSettings(RetrySettings.newBuilder().setTotalTimeout(totalTimeout).build()) + .setGlobalSettings( + RetrySettings.newBuilder().setTotalTimeoutDuration(totalTimeout).build()) .build(); } @Override - public void setAttemptFuture(ApiFuture attemptFuture) { + public void setAttemptFuture(ApiFuture attemptFuture) { this.attemptFuture = attemptFuture; } @@ -391,17 +426,17 @@ public TimedAttemptSettings getAttemptSettings() { } @Override - public Callable getCallable() { + public Callable getCallable() { throw new UnsupportedOperationException("not used"); } @Override - public ApiFuture peekAttemptResult() { + public ApiFuture peekAttemptResult() { throw new UnsupportedOperationException("not used"); } @Override - public ApiFuture getAttemptResult() { + public ApiFuture getAttemptResult() { throw new UnsupportedOperationException("not used"); } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java index 875a8e3885..11658d8792 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsBatchingDescriptorTest.java @@ -16,20 +16,28 @@ 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; @@ -38,6 +46,7 @@ @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"; @@ -59,7 +68,7 @@ public void countBytesTest() { public void requestBuilderTest() { MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); long timestamp = 10_000L; - BulkMutation bulkMutation = BulkMutation.create("fake-table"); + BulkMutation bulkMutation = BulkMutation.create(TABLE_ID); BatchingRequestBuilder requestBuilder = underTest.newRequestBuilder(bulkMutation); requestBuilder.add( @@ -70,7 +79,7 @@ public void requestBuilderTest() { BulkMutation actualBulkMutation = requestBuilder.build(); assertThat(actualBulkMutation.toProto(requestContext)) .isEqualTo( - BulkMutation.create("fake-table") + 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)); @@ -91,11 +100,55 @@ public void splitResponseTest() { assertThat(batchResponse.get(1).getResultFuture().isDone()).isFalse(); MutateRowsBatchingDescriptor underTest = new MutateRowsBatchingDescriptor(); - underTest.splitResponse(null, batchResponse); + 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 = @@ -137,8 +190,9 @@ public void splitExceptionWithFailedMutationsTest() { // Threw an exception at 1st and 3rd entry MutateRowsException serverError = - new MutateRowsException( + MutateRowsException.create( null, + GrpcStatusCode.of(Status.Code.UNAVAILABLE), ImmutableList.of( MutateRowsException.FailedMutation.create( 0, @@ -180,4 +234,23 @@ public void splitExceptionWithFailedMutationsTest() { .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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsErrorConverterUnaryCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsErrorConverterUnaryCallableTest.java new file mode 100644 index 0000000000..7f2de3e728 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryTest.java new file mode 100644 index 0000000000..ce2f7a6c7c --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java index 4bcf17674c..32571283a2 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsBatchingDescriptorTest.java @@ -25,6 +25,7 @@ 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; @@ -47,7 +48,7 @@ public class ReadRowsBatchingDescriptorTest { private static final Row ROW_KEY_2_RESPONSE = Row.create(ByteString.copyFromUtf8("row-key-2"), ImmutableList.of(ROW_CELL)); - private ReadRowsBatchingDescriptor underTest = new ReadRowsBatchingDescriptor(); + private final ReadRowsBatchingDescriptor underTest = new ReadRowsBatchingDescriptor(); @Test public void splitResponseTest() throws Exception { @@ -108,7 +109,7 @@ public void countBytesTest() { @Test public void requestBuilderTest() { BatchingRequestBuilder requestBuilder = - underTest.newRequestBuilder(Query.create("table-Id")); + underTest.newRequestBuilder(Query.create(TableId.of("table-Id"))); requestBuilder.add(ByteString.copyFromUtf8("row-key-1")); requestBuilder.add(ByteString.copyFromUtf8("row-key-2")); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java deleted file mode 100644 index e7fb90941e..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.SettableApiFuture; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.UnaryCallable; -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.common.truth.Truth; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; - -@RunWith(JUnit4.class) -public class ReadRowsFirstCallableTest { - private static final RequestContext REQUEST_CONTEXT = - RequestContext.create("fake-project", "fake-instance", "fake-profile"); - private UnaryCallable innerCallable; - private ArgumentCaptor innerQuery; - private SettableApiFuture innerResult; - - @SuppressWarnings("unchecked") - @Before - public void setUp() { - innerCallable = Mockito.mock(UnaryCallable.class); - innerQuery = ArgumentCaptor.forClass(Query.class); - innerResult = SettableApiFuture.create(); - Mockito.when(innerCallable.futureCall(innerQuery.capture(), Mockito.any(ApiCallContext.class))) - .thenReturn(innerResult); - } - - @Test - public void testLimitAdded() { - ReadRowsFirstCallable callable = new ReadRowsFirstCallable<>(innerCallable); - innerResult.set(null); - callable.call(Query.create("fake-table")); - - Truth.assertThat(innerQuery.getValue().toProto(REQUEST_CONTEXT)) - .isEqualTo(Query.create("fake-table").limit(1).toProto(REQUEST_CONTEXT)); - } - - @Test - public void testLimitChanged() { - ReadRowsFirstCallable callable = new ReadRowsFirstCallable<>(innerCallable); - innerResult.set(null); - callable.call(Query.create("fake-table").limit(1_000)); - - Truth.assertThat(innerQuery.getValue().toProto(REQUEST_CONTEXT)) - .isEqualTo(Query.create("fake-table").limit(1).toProto(REQUEST_CONTEXT)); - } -} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java index e478eb911d..fa3a2030c0 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsMergingAcceptanceTest.java @@ -35,6 +35,7 @@ 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; @@ -70,7 +71,7 @@ public static Collection data() throws IOException { .that(dataJson) .isNotNull(); - InputStreamReader reader = new InputStreamReader(dataJson); + InputStreamReader reader = new InputStreamReader(dataJson, StandardCharsets.UTF_8); TestFile.Builder testBuilder = TestFile.newBuilder(); JsonFormat.parser().merge(reader, testBuilder); TestFile testDefinition = testBuilder.build(); @@ -142,20 +143,20 @@ public void test() throws Exception { private static boolean expectsError(ReadRowsTest rrt) { List results = rrt.getResultsList(); - return results != null && !results.isEmpty() && results.get(results.size() - 1).getError(); + return !results.isEmpty() && results.get(results.size() - 1).getError(); } private static List getNonExceptionResults(ReadRowsTest rrt) { List results = rrt.getResultsList(); List response = new ArrayList<>(); - if (results != null) { - for (ReadRowsTest.Result result : results) { - if (!result.getError()) { - response.add(result); - } + + for (ReadRowsTest.Result result : results) { + if (!result.getError()) { + response.add(result); } } + return response; } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java index 1536b01e01..599d7cae5e 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java @@ -15,13 +15,17 @@ */ 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; @@ -33,33 +37,45 @@ 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.Queues; 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.mockito.runners.MockitoJUnitRunner; +import org.junit.runners.JUnit4; -@RunWith(MockitoJUnitRunner.class) +@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 String TABLE_ID = "fake-table"; + 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; @@ -74,7 +90,9 @@ public void setUp() throws IOException { BigtableDataSettings.newBuilder() .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) - .setCredentialsProvider(NoCredentialsProvider.create()); + .setCredentialsProvider(NoCredentialsProvider.create()) + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics(); settings .stubSettings() @@ -102,7 +120,7 @@ public void happyPathTest() { .respondWith("k1", "r1", "r2")); List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3")); - Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); } @Test @@ -119,7 +137,330 @@ public void immediateRetryTest() { .respondWith("k1", "r1", "r2")); List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3")); - Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); + 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 @@ -142,7 +483,7 @@ public void multipleRetryTest() { RpcExpectation.create().expectRequest(Range.open("r7", "r9")).respondWith("r8")); List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r9")); - Truth.assertThat(actualResults) + assertThat(actualResults) .containsExactly("r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8") .inOrder(); } @@ -162,7 +503,7 @@ public void rowLimitTest() { .respondWith("r2")); List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2)); - Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); } @Test @@ -178,7 +519,7 @@ public void errorAfterRowLimitMetTest() { List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").limit(2)); - Truth.assertThat(actualResults).containsExactly("r1", "r2"); + assertThat(actualResults).containsExactly("r1", "r2"); } @Test @@ -194,7 +535,7 @@ public void errorAfterRequestCompleteTest() { List actualResults = getResults(Query.create(TABLE_ID).range("r1", "r3").rowKey("r4")); - Truth.assertThat(actualResults).containsExactly("r2", "r4"); + assertThat(actualResults).containsExactly("r2", "r4"); } @Test @@ -207,7 +548,7 @@ public void pointTest() { service.expectations.add(RpcExpectation.create().expectRequest("r2").respondWith("r2")); List actualResults = getResults(Query.create(TABLE_ID).rowKey("r1").rowKey("r2")); - Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); } @Test @@ -217,7 +558,7 @@ public void fullTableScanTest() { service.expectations.add( RpcExpectation.create().expectRequest(Range.greaterThan("r1")).respondWith("r2")); List actualResults = getResults(Query.create(TABLE_ID)); - Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); } @Test @@ -232,7 +573,7 @@ public void retryUnboundedStartTest() { List actualResults = getResults(Query.create(TABLE_ID).range(ByteStringRange.unbounded().endOpen("r9"))); - Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); } @Test @@ -247,7 +588,7 @@ public void retryUnboundedEndTest() { List actualResults = getResults(Query.create(TABLE_ID).range(ByteStringRange.unbounded().startClosed("r1"))); - Truth.assertThat(actualResults).containsExactly("r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("r1", "r2").inOrder(); } @Test @@ -261,7 +602,7 @@ public void retryWithLastScannedKeyTest() { RpcExpectation.create().expectRequest(Range.open("r5", "r9")).respondWith("r7")); List actualResults = getResults(Query.create(TABLE_ID).range(ByteStringRange.create("r1", "r9"))); - Truth.assertThat(actualResults).containsExactly("r7").inOrder(); + assertThat(actualResults).containsExactly("r7").inOrder(); } @Test @@ -270,7 +611,7 @@ public void retryRstStreamExceptionTest() { new InternalException( new StatusRuntimeException( Status.INTERNAL.withDescription( - "HTTP/2 error code: INTERNAL_ERROR\nReceived Rst stream")), + "INTERNAL: HTTP/2 error code: INTERNAL_ERROR\nReceived Rst Stream")), GrpcStatusCode.of(Code.INTERNAL), false); service.expectations.add( @@ -285,7 +626,7 @@ public void retryRstStreamExceptionTest() { .respondWith("k1", "r1", "r2")); List actualResults = getResults(Query.create(TABLE_ID).rowKey("k1").range("r1", "r3")); - Truth.assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); + assertThat(actualResults).containsExactly("k1", "r1", "r2").inOrder(); } private List getResults(Query query) { @@ -297,8 +638,14 @@ private List getResults(Query query) { 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 = Queues.newArrayDeque(); + Queue expectations = new LinkedBlockingDeque<>(); int i = -1; @Override @@ -306,6 +653,7 @@ public void readRows( ReadRowsRequest request, StreamObserver responseObserver) { RpcExpectation expectedRpc = expectations.poll(); + assertThat(expectedRpc).isNotNull(); i++; Truth.assertWithMessage("Unexpected request#" + i + ":" + request.toString()) @@ -334,6 +682,11 @@ private static class RpcExpectation { ApiException exception; List responses; + private RpcExpectation setReversed(boolean reverse) { + this.requestBuilder.setReversed(reverse); + return this; + } + private RpcExpectation() { this.requestBuilder = ReadRowsRequest.newBuilder() @@ -353,6 +706,52 @@ RpcExpectation expectRequest(String... keys) { 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(); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java index d1e03df2c6..3e1a652050 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsUserCallableTest.java @@ -19,6 +19,7 @@ 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; @@ -35,23 +36,10 @@ public void testRequestConverted() { ServerStreamingStashCallable innerCallable = new ServerStreamingStashCallable<>(); ReadRowsUserCallable callable = new ReadRowsUserCallable<>(innerCallable, REQUEST_CONTEXT); - Query query = Query.create("fake-table"); + Query query = Query.create(TableId.of("fake-table")); callable.call(query); Truth.assertThat(innerCallable.getActualRequest()).isEqualTo(query.toProto(REQUEST_CONTEXT)); } - - @Test - public void testFirstIsLimited() { - ServerStreamingStashCallable innerCallable = - new ServerStreamingStashCallable<>(); - ReadRowsUserCallable callable = new ReadRowsUserCallable<>(innerCallable, REQUEST_CONTEXT); - Query query = Query.create("fake-table"); - - callable.first().call(query); - - Truth.assertThat(innerCallable.getActualRequest()) - .isEqualTo(query.limit(1).toProto(REQUEST_CONTEXT)); - } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java index a8970db1d9..5e9ce44aeb 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/RowMergingCallableTest.java @@ -42,9 +42,18 @@ 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")) @@ -56,6 +65,15 @@ public void scanMarker() { 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())); } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java index cbb5e7d80f..4fe2762146 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachineTest.java @@ -34,7 +34,7 @@ public class StateMachineTest { @Before public void setUp() throws Exception { - stateMachine = new StateMachine<>(new DefaultRowAdapter().createRowBuilder()); + stateMachine = new StateMachine<>(new DefaultRowAdapter().createRowBuilder(), false); } @Test @@ -59,8 +59,7 @@ public void testErrorHandlingStats() { stateMachine.consumeRow(); stateMachine.handleChunk( - chunk - .toBuilder() + chunk.toBuilder() .setRowKey(ByteString.copyFromUtf8("my-key3")) .setValueSize(123) // invalid value size .build()); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContextTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContextTest.java new file mode 100644 index 0000000000..14cfd25f66 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallableTest.java new file mode 100644 index 0000000000..0d51e2d8f0 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategyTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryResumptionStrategyTest.java new file mode 100644 index 0000000000..d42529209f --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryRetryTest.java new file mode 100644 index 0000000000..d6c41397b1 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataErrorHandlingCallableTest.java new file mode 100644 index 0000000000..9312d3ffe5 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/PlanRefreshingCallableTest.java new file mode 100644 index 0000000000..3511f51eae --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineSubject.java new file mode 100644 index 0000000000..e9f6bf09e6 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineTest.java new file mode 100644 index 0000000000..9da5224cf2 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactory.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactory.java new file mode 100644 index 0000000000..1a3441a209 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactoryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactoryTest.java new file mode 100644 index 0000000000..cb2c068939 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerSubject.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerSubject.java new file mode 100644 index 0000000000..6a6f2bc1d0 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerTest.java new file mode 100644 index 0000000000..d61d9d5f20 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallableTest.java new file mode 100644 index 0000000000..fd6f0e2302 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettingsTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolSettingsTest.java new file mode 100644 index 0000000000..7fb35308ea --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/BigtableChannelPoolTest.java new file mode 100644 index 0000000000..6719a70d89 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java new file mode 100644 index 0000000000..6b748b1a59 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/ChannelPoolHealthCheckerTest.java @@ -0,0 +1,192 @@ +/* + * 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.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.Clock; +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; + @Mock private Clock mockClock; + private ChannelPoolHealthChecker healthChecker; + private List channelList; + + @Before + public void setUp() { + executor = TestingExecutors.sameThreadScheduledExecutor(); + channelList = new ArrayList<>(); + Supplier> entrySupplier = () -> ImmutableList.copyOf(channelList); + + healthChecker = new ChannelPoolHealthChecker(entrySupplier, mockPrimer, executor, mockClock); + + // Default the clock to a fixed time + Mockito.when(mockClock.instant()).thenReturn(Instant.parse("2025-08-01T10:00:00Z")); + } + + // 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(mockClock.instant(), false)); + assertThat(entry.failedProbesInWindow.get()).isEqualTo(1); + + Instant newTime = mockClock.instant().plus(Duration.ofMinutes(6)); + Mockito.when(mockClock.instant()).thenReturn(newTime); + 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/grpc/HealthChecker.java new file mode 100644 index 0000000000..5e8e00b040 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java index 426c27f5a3..6adc71cae0 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserverTest.java @@ -15,9 +15,12 @@ */ 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; @@ -27,9 +30,13 @@ 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; @@ -283,32 +290,33 @@ public void testConcurrentCancel() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(2); - executor.submit( - new Runnable() { - @Override - public void run() { - while (!outerObserver.isDone()) { - outerObserver.popNextResponse(); - } - latch.countDown(); - } - }); + @SuppressWarnings("UnusedVariable") + Future ignored = + executor.submit( + () -> { + while (!outerObserver.isDone()) { + outerObserver.popNextResponse(); + } + latch.countDown(); + }); - executor.submit( - new Runnable() { - @Override - public void run() { - while (!innerController.isCancelled()) { - if (innerController.popLastPull() > 0) { - innerController.getObserver().onResponse("a"); + @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(); } - } - innerController - .getObserver() - .onError(new RuntimeException("Some other upstream error")); - latch.countDown(); - } - }); + }); outerObserver.getController().cancel(); @@ -431,6 +439,120 @@ public String pop() { 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 diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java index f1662dcd04..51c4f37880 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/FakeStatusCode.java @@ -37,6 +37,7 @@ public Code getTransportCode() { } @Override + @SuppressWarnings("EqualsGetClass") public boolean equals(Object o) { if (this == o) { return true; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java index 4ecca917ed..f82f1fed45 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/gaxx/testing/MockStreamingApi.java @@ -25,6 +25,7 @@ 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 @@ -36,7 +37,7 @@ public static class MockServerStreamingCallable public void call( RequestT request, ResponseObserver responseObserver, ApiCallContext context) { MockStreamController controller = new MockStreamController<>(responseObserver); - calls.add(new MockServerStreamingCall<>(request, controller)); + calls.add(new MockServerStreamingCall<>(request, controller, context)); responseObserver.onStart(controller); } @@ -52,10 +53,15 @@ public MockServerStreamingCall popLastCall() { public static class MockServerStreamingCall { private final RequestT request; private final MockStreamController controller; + private final ApiCallContext apiCallContext; - public MockServerStreamingCall(RequestT request, MockStreamController controller) { + public MockServerStreamingCall( + RequestT request, + MockStreamController controller, + @Nullable ApiCallContext apiCallContext) { this.request = request; this.controller = controller; + this.apiCallContext = apiCallContext; } public RequestT getRequest() { @@ -65,6 +71,10 @@ public RequestT getRequest() { public MockStreamController getController() { return controller; } + + public ApiCallContext getApiCallContext() { + return apiCallContext; + } } public static class MockStreamController implements StreamController { diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/AuthorizedViewTestHelper.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/AuthorizedViewTestHelper.java new file mode 100644 index 0000000000..70e6a579ac --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/MethodComparator.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/MethodComparator.java new file mode 100644 index 0000000000..4c3ecd2744 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java index f183e5eea0..f4bef01981 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/AbstractTestEnv.java @@ -16,15 +16,20 @@ 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.models.AppProfile; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminSettings; import com.google.cloud.bigtable.admin.v2.models.Cluster; -import com.google.cloud.bigtable.admin.v2.models.Instance; 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 org.threeten.bp.Instant; -import org.threeten.bp.temporal.ChronoUnit; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Defines the interface of a target environment. @@ -32,10 +37,14 @@ *

    This allows for integration tests to run against either production or an emulator. */ public abstract class AbstractTestEnv { - private static final String PREFIX = "temp-"; - public static final String TEST_INSTANCE_PREFIX = "temp-instance-"; - public static final String TEST_CLUSTER_PREFIX = "temp-cluster-"; - public static final String TEST_APP_PREFIX = "temp-Ap-"; + private String primaryClusterId = null; + + public enum ConnectionMode { + DEFAULT, + REQUIRE_CFE, + REQUIRE_DIRECT_PATH, + REQUIRE_DIRECT_PATH_IPV4 + } abstract void start() throws Exception; @@ -43,8 +52,6 @@ public abstract class AbstractTestEnv { public abstract BigtableDataClient getDataClient(); - public abstract BigtableDataClient getDataClientForInstance(String instanceId) throws IOException; - public abstract BigtableTableAdminClient getTableAdminClient(); public abstract BigtableTableAdminClient getTableAdminClientForInstance(String instanceId) @@ -54,38 +61,67 @@ public abstract BigtableTableAdminClient getTableAdminClientForInstance(String i public abstract BigtableDataSettings getDataClientSettings(); + public abstract BigtableInstanceAdminSettings getInstanceAdminClientSettings(); + + public abstract BigtableTableAdminSettings getTableAdminSettings(); + public abstract String getProjectId(); public abstract String getInstanceId(); - public abstract String getTableId(); + /** Try to guess the primary cluster id */ + public synchronized String getPrimaryClusterId() { + if (primaryClusterId != null) { + return primaryClusterId; + } - public String getFamilyId() { - return "cf"; - } + List clusters = getInstanceAdminClient().listClusters(getInstanceId()); + Map byId = new HashMap<>(); + for (Cluster cluster : clusters) { + byId.put(cluster.getId(), cluster); + } - public String generateTableId(String suffix) { - return newPrefix() + "-" + suffix; - } + Cluster cluster = byId.get(getInstanceId()); - private static String newPrefix() { - return newPrefix(Instant.now()); + 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; } - private static String newPrefix(Instant instant) { - return String.format(PREFIX + "015%d", instant.getEpochSecond()); + public abstract TableId getTableId(); + + public abstract String getKmsKeyName(); + + public String getFamilyId() { + return "cf"; } public boolean isInstanceAdminSupported() { return true; } - public boolean isDirectPathEnabled() { - return Boolean.getBoolean("bigtable.attempt-directpath"); + public ConnectionMode getConnectionMode() { + String modeStr = + MoreObjects.firstNonNull( + System.getProperty("bigtable.connection-mode"), ConnectionMode.DEFAULT.name()); + + return ConnectionMode.valueOf(modeStr); } - public boolean isDirectPathIpv4Only() { - return Boolean.getBoolean("bigtable.directpath-ipv4only"); + public boolean shouldWaitForCmekKeyStatusUpdate() { + return Boolean.getBoolean("bigtable.wait-for-cmek-key-status"); } public String getPrimaryZone() { @@ -96,58 +132,11 @@ public String getSecondaryZone() { return "us-east1-b"; } - void cleanUpStale() { - cleanupStaleTables(); - if (isInstanceAdminSupported()) { - cleanUpStaleAppProfile(); - cleanUpStaleClusters(); - cleanUpStaleInstances(); - } - } - - private void cleanupStaleTables() { - String stalePrefix = newPrefix(Instant.now().minus(1, ChronoUnit.DAYS)); - - for (String tableId : getTableAdminClient().listTables()) { - if (!tableId.startsWith(PREFIX)) { - continue; - } - if (stalePrefix.compareTo(tableId) > 0) { - getTableAdminClient().deleteTable(tableId); - } - } - } - - private void cleanUpStaleAppProfile() { - String staleAPPattern = TEST_APP_PREFIX + Instant.now().minus(1, ChronoUnit.DAYS); - - for (AppProfile appProfile : getInstanceAdminClient().listAppProfiles(getInstanceId())) { - String appProfileId = appProfile.getId(); - if (appProfileId.startsWith(staleAPPattern) && staleAPPattern.compareTo(appProfileId) > 0) { - getInstanceAdminClient().deleteAppProfile(getInstanceId(), appProfileId, true); - } - } - } - - private void cleanUpStaleClusters() { - String staleClusterId = TEST_CLUSTER_PREFIX + Instant.now().minus(1, ChronoUnit.DAYS); - - for (Cluster cluster : getInstanceAdminClient().listClusters(getInstanceId())) { - String clusterId = cluster.getId(); - if (clusterId.startsWith(staleClusterId) && staleClusterId.compareTo(clusterId) > 0) { - getInstanceAdminClient().deleteCluster(getInstanceId(), clusterId); - } - } - } - - private void cleanUpStaleInstances() { - String staleInstanceId = TEST_INSTANCE_PREFIX + Instant.now().minus(1, ChronoUnit.DAYS); - - for (Instance ins : getInstanceAdminClient().listInstances()) { - String insId = ins.getId(); - if (insId.startsWith(staleInstanceId) && staleInstanceId.compareTo(insId) > 0) { - getInstanceAdminClient().deleteInstance(insId); - } - } + /** + * 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java index 6afe733ab7..fe849af468 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/CloudEnv.java @@ -17,15 +17,22 @@ import com.google.api.core.ApiFunction; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.rpc.TransportChannelProvider; +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; @@ -36,10 +43,13 @@ import io.grpc.ManagedChannelBuilder; import io.grpc.Metadata; import io.grpc.MethodDescriptor; +import io.grpc.Status; import java.io.IOException; -import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; import javax.annotation.Nullable; /** @@ -52,25 +62,43 @@ *

  • {@code bigtable.table} * */ -class CloudEnv extends AbstractTestEnv { - // IP address prefixes allocated for DirectPath backends. - public static final String DP_IPV6_PREFIX = "2001:4860:8040"; - public static final String DP_IPV4_PREFIX = "34.126"; +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 String tableId; + 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; @@ -80,45 +108,48 @@ 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), - getRequiredProperty(TABLE_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, - String tableId) { + @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); + } - if (isDirectPathEnabled()) { - TransportChannelProvider channelProvider = - dataSettings.stubSettings().getTransportChannelProvider(); - InstantiatingGrpcChannelProvider defaultTransportProvider = - (InstantiatingGrpcChannelProvider) channelProvider; - InstantiatingGrpcChannelProvider instrumentedTransportChannelProvider = - defaultTransportProvider - .toBuilder() - .setChannelConfigurator( - new ApiFunction() { - @Override - public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { - builder.intercept(directPathAddressCheckInterceptor()); - return builder; - } - }) - .build(); - dataSettings.stubSettings().setTransportChannelProvider(instrumentedTransportChannelProvider); + configureConnection(dataSettings.stubSettings()); + configureUserAgent(dataSettings.stubSettings()); + + if (tracingCookie != null) { + injectTracingCookie(tracingCookie, dataSettings.stubSettings()); } this.tableAdminSettings = @@ -133,6 +164,160 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { } } + 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()); @@ -152,19 +337,6 @@ public BigtableDataClient getDataClient() { return dataClient; } - @Override - public BigtableDataClient getDataClientForInstance(String instanceId) throws IOException { - BigtableDataSettings.Builder settings = - BigtableDataSettings.newBuilder() - .setProjectId(dataSettings.getProjectId()) - .setInstanceId(instanceId); - settings - .stubSettings() - .setEndpoint(dataSettings.stubSettings().getEndpoint()) - .setTransportChannelProvider(dataSettings.stubSettings().getTransportChannelProvider()); - return BigtableDataClient.create(settings.build()); - } - @Override public BigtableTableAdminClient getTableAdminClient() { return tableAdminClient; @@ -191,6 +363,25 @@ 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; @@ -202,10 +393,20 @@ public String getInstanceId() { } @Override - public String getTableId() { + 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); } @@ -217,59 +418,4 @@ private static String getRequiredProperty(String prop) { } return value; } - - /** - * Captures the request attributes "Grpc.TRANSPORT_ATTR_REMOTE_ADDR" when connection is - * established and verifies if the remote address is a DirectPath address. This is only used for - * DirectPath testing. {@link ClientCall#getAttributes()} - */ - private ClientInterceptor directPathAddressCheckInterceptor() { - 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 (!verifyRemoteAddress(remoteAddr)) { - throw new RuntimeException( - String.format( - "Synthetically aborting the current request because it did not adhere" - + " to the test environment's requirement for DirectPath." - + " Expected test to access DirectPath via %s," - + " but RPC was destined for %s", - isDirectPathIpv4Only() ? "ipv4 only" : "ipv4 or ipv6", - remoteAddr.toString())); - } - super.onHeaders(headers); - } - }, - headers); - } - }; - } - }; - } - - private boolean verifyRemoteAddress(SocketAddress remoteAddr) { - if (remoteAddr instanceof InetSocketAddress) { - InetAddress inetAddress = ((InetSocketAddress) remoteAddr).getAddress(); - String addr = inetAddress.getHostAddress(); - if (isDirectPathIpv4Only()) { - return addr.startsWith(DP_IPV4_PREFIX); - } else { - // For an ipv6-enabled VM, client could connect to either ipv4 or ipv6 balancer addresses. - return addr.startsWith(DP_IPV6_PREFIX) || addr.startsWith(DP_IPV4_PREFIX); - } - } - return true; - } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java index edb9439dce..2ba3bd72c1 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/EmulatorEnv.java @@ -16,11 +16,14 @@ 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; @@ -31,13 +34,14 @@ public class EmulatorEnv extends AbstractTestEnv { private static final String PROJECT_ID = "fake-project"; private static final String INSTANCE_ID = "fake-instance"; - private static final String TABLE_ID = "default-table"; + 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(); @@ -59,18 +63,22 @@ void start() throws Exception { BigtableDataSettings.newBuilderForEmulator(emulator.getPort()) .setProjectId("fake-project") .setInstanceId("fake-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .disableInternalMetrics() .build(); dataClient = BigtableDataClient.create(dataSettings); - tableAdminClient = - BigtableTableAdminClient.create( - BigtableTableAdminSettings.newBuilderForEmulator(emulator.getPort()) - .setProjectId("fake-project") - .setInstanceId("fake-instance") - .build()); + tableAdminSettings = + BigtableTableAdminSettings.newBuilderForEmulator(emulator.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .build(); + + tableAdminClient = BigtableTableAdminClient.create(tableAdminSettings); - tableAdminClient.createTable(CreateTableRequest.of(TABLE_ID).addFamily(getFamilyId())); + tableAdminClient.createTable( + CreateTableRequest.of(TABLE_ID.getTableId()).addFamily(getFamilyId())); } @Override @@ -85,6 +93,16 @@ 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; @@ -96,7 +114,7 @@ public String getInstanceId() { } @Override - public String getTableId() { + public TableId getTableId() { return TABLE_ID; } @@ -105,11 +123,6 @@ public BigtableDataClient getDataClient() { return dataClient; } - @Override - public BigtableDataClient getDataClientForInstance(String instanceId) throws IOException { - throw new UnsupportedOperationException("Could not create a data client for another instance."); - } - @Override public BigtableTableAdminClient getTableAdminClient() { return tableAdminClient; @@ -126,6 +139,11 @@ 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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/PrefixGenerator.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/PrefixGenerator.java new file mode 100644 index 0000000000..e003e5a6c8 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java index 52c269b72c..dcf0938a5c 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/test_helpers/env/TestEnvRule.java @@ -17,19 +17,31 @@ import static com.google.common.truth.TruthJUnit.assume; -import com.google.common.base.Joiner; -import com.google.common.base.Strings; +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.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; import java.util.Set; -import java.util.logging.FileHandler; +import java.util.concurrent.ExecutionException; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.logging.SimpleFormatter; import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; @@ -57,7 +69,6 @@ public class TestEnvRule implements TestRule { private static final Logger LOGGER = Logger.getLogger(TestEnvRule.class.getName()); - private static final String BIGTABLE_GRPC_LOG_DIR = System.getProperty("bigtable.grpc-log-dir"); 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"); @@ -71,6 +82,7 @@ public class TestEnvRule implements TestRule { @Override public Statement apply(final Statement base, final Description description) { return new Statement() { + @Override public void evaluate() throws Throwable { TestEnvRule.this.before(description); @@ -91,8 +103,6 @@ protected void before(Description description) throws Throwable { .that(System.getenv()) .doesNotContainKey(BIGTABLE_EMULATOR_HOST_ENV_VAR); - configureLogging(description); - switch (env) { case "emulator": testEnv = EmulatorEnv.createBundled(); @@ -103,37 +113,16 @@ protected void before(Description description) throws Throwable { default: throw new IllegalArgumentException( String.format( - "Unknown env: %s. Please set the system property %s to either 'emulator' or 'cloud'.", + "Unknown env: %s. Please set the system property %s to either 'emulator' or" + + " 'cloud'.", env, ENV_PROPERTY)); } testEnv.start(); } - private void configureLogging(Description description) throws IOException { - if (Strings.isNullOrEmpty(BIGTABLE_GRPC_LOG_DIR)) { - return; - } - - Files.createDirectories(Paths.get(BIGTABLE_GRPC_LOG_DIR)); - - String basename = - Joiner.on("-").useForNull("").join(description.getClassName(), description.getMethodName()); - Path logPath = Paths.get(BIGTABLE_GRPC_LOG_DIR, basename + ".log"); - - grpcLogHandler = new FileHandler(logPath.toString()); - grpcLogHandler.setFormatter(new SimpleFormatter()); - grpcLogHandler.setLevel(Level.ALL); - - for (String grpcLoggerName : GRPC_LOGGER_NAMES) { - Logger logger = Logger.getLogger(grpcLoggerName); - logger.setLevel(Level.ALL); - logger.addHandler(grpcLogHandler); - } - } - private void after() { try { - env().cleanUpStale(); + cleanUpStale(); } catch (Exception e) { LOGGER.log(Level.WARNING, "Failed to cleanup environment", e); } @@ -159,6 +148,229 @@ private void teardownLogging() { 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/google-cloud-bigtable/src/test/proto/album.proto b/google-cloud-bigtable/src/test/proto/album.proto new file mode 100644 index 0000000000..900c2c62db --- /dev/null +++ b/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/google-cloud-bigtable/src/test/proto/changestream_tests.proto b/google-cloud-bigtable/src/test/proto/changestream_tests.proto new file mode 100644 index 0000000000..82f0fff492 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/proto/singer.proto b/google-cloud-bigtable/src/test/proto/singer.proto new file mode 100644 index 0000000000..838b85fbe6 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/changestream.json b/google-cloud-bigtable/src/test/resources/changestream.json new file mode 100644 index 0000000000..661bf1b4cb --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/logging-verbose.properties b/google-cloud-bigtable/src/test/resources/logging-verbose.properties new file mode 100644 index 0000000000..58e1b79ef6 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/logging.properties b/google-cloud-bigtable/src/test/resources/logging.properties new file mode 100644 index 0000000000..e181b45a01 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb b/google-cloud-bigtable/src/test/resources/proto_schema_bundle.pb new file mode 100644 index 0000000000..c9ac4086f5 --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/proto_schema_bundle.proto b/google-cloud-bigtable/src/test/resources/proto_schema_bundle.proto new file mode 100644 index 0000000000..e03f0ccccb --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb b/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.pb new file mode 100644 index 0000000000..21f877a2fe --- /dev/null +++ b/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/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.proto b/google-cloud-bigtable/src/test/resources/updated_proto_schema_bundle.proto new file mode 100644 index 0000000000..e9894cabd2 --- /dev/null +++ b/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/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml b/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml index 0ad34755c1..68aac3bcac 100644 --- a/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml +++ b/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml @@ -1,10 +1,20 @@ + - - 6001 - com/google/bigtable/admin/v2/*Grpc - METHOD_* + 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/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index 048227b24a..ae25dfe364 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 1.20.2-SNAPSHOT + 2.76.0 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.20.2-SNAPSHOT + 2.76.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import @@ -74,7 +74,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 protected true diff --git a/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java b/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java index d4245cbdf6..241ed9138f 100644 --- a/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java +++ b/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,6 @@ package com.google.bigtable.admin.v2; import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; /** * @@ -31,14 +26,13 @@ * tables' metadata or data stored in those tables. * */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/bigtable/admin/v2/bigtable_instance_admin.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class BigtableInstanceAdminGrpc { private BigtableInstanceAdminGrpc() {} - public static final String SERVICE_NAME = "google.bigtable.admin.v2.BigtableInstanceAdmin"; + 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< @@ -481,6 +475,56 @@ private BigtableInstanceAdminGrpc() {} 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; @@ -876,774 +920,2112 @@ private BigtableInstanceAdminGrpc() {} return getTestIamPermissionsMethod; } - /** 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); - } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod; - /** - * 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); + @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; } - /** 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); + 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; } - /** - * - * - *
    -   * 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 { + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.GetLogicalViewRequest, + com.google.bigtable.admin.v2.LogicalView> + getGetLogicalViewMethod; - /** - * - * - *
    -     * Create an instance within a project.
    -     * 
    - */ - public void createInstance( - com.google.bigtable.admin.v2.CreateInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateInstanceMethod(), responseObserver); + @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; + } - /** - * - * - *
    -     * Gets information about an instance.
    -     * 
    - */ - public void getInstance( - com.google.bigtable.admin.v2.GetInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetInstanceMethod(), responseObserver); - } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListLogicalViewsRequest, + com.google.bigtable.admin.v2.ListLogicalViewsResponse> + getListLogicalViewsMethod; - /** - * - * - *
    -     * Lists information about instances in a project.
    -     * 
    - */ - public void listInstances( - com.google.bigtable.admin.v2.ListInstancesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getListInstancesMethod(), responseObserver); + @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; + } - /** - * - * - *
    -     * 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) { - asyncUnimplementedUnaryCall(getUpdateInstanceMethod(), responseObserver); - } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.UpdateLogicalViewRequest, com.google.longrunning.Operation> + getUpdateLogicalViewMethod; - /** - * - * - *
    -     * 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) { - asyncUnimplementedUnaryCall(getPartialUpdateInstanceMethod(), responseObserver); + @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; + } - /** - * - * - *
    -     * Delete an instance from a project.
    -     * 
    - */ - public void deleteInstance( - com.google.bigtable.admin.v2.DeleteInstanceRequest request, + 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) { - asyncUnimplementedUnaryCall(getDeleteInstanceMethod(), 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); } - /** - * - * - *
    -     * Creates a cluster within an instance.
    -     * 
    - */ - public void createCluster( - com.google.bigtable.admin.v2.CreateClusterRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateClusterMethod(), responseObserver); + @java.lang.Override + protected BigtableInstanceAdminBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new BigtableInstanceAdminBlockingV2Stub(channel, callOptions); } /** * * *
    -     * Gets information about a cluster.
    +     * 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 getCluster( - com.google.bigtable.admin.v2.GetClusterRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + 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); } /** * * *
    -     * Lists information about clusters in an instance.
    +     * Gets information about an instance.
          * 
    */ - public void listClusters( - com.google.bigtable.admin.v2.ListClustersRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getListClustersMethod(), responseObserver); + 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); } /** * * *
    -     * Updates a cluster within an instance.
    +     * Lists information about instances in a project.
          * 
    */ - public void updateCluster( - com.google.bigtable.admin.v2.Cluster request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getUpdateClusterMethod(), responseObserver); + 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); } /** * * *
    -     * Deletes a cluster from an instance.
    +     * 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 deleteCluster( - com.google.bigtable.admin.v2.DeleteClusterRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDeleteClusterMethod(), responseObserver); + 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); } /** * * *
    -     * Creates an app profile within an instance.
    +     * 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 createAppProfile( - com.google.bigtable.admin.v2.CreateAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateAppProfileMethod(), responseObserver); + 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); } /** * * *
    -     * Gets information about an app profile.
    +     * Delete an instance from a project.
          * 
    */ - public void getAppProfile( - com.google.bigtable.admin.v2.GetAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetAppProfileMethod(), responseObserver); + 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); } /** * * *
    -     * Lists information about app profiles in an instance.
    +     * 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 listAppProfiles( - com.google.bigtable.admin.v2.ListAppProfilesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getListAppProfilesMethod(), responseObserver); + 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); } /** * * *
    -     * Updates an app profile within an instance.
    +     * Gets information about a cluster.
          * 
    */ - public void updateAppProfile( - com.google.bigtable.admin.v2.UpdateAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getUpdateAppProfileMethod(), responseObserver); + 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); } /** * * *
    -     * Deletes an app profile from an instance.
    +     * Lists information about clusters in an instance.
          * 
    */ - public void deleteAppProfile( - com.google.bigtable.admin.v2.DeleteAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDeleteAppProfileMethod(), responseObserver); + 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); } /** * * *
    -     * Gets the access control policy for an instance resource. Returns an empty
    -     * policy if an instance exists but does not have a policy set.
    +     * 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 getIamPolicy( - com.google.iam.v1.GetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetIamPolicyMethod(), responseObserver); + 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); } /** * * *
    -     * Sets the access control policy on an instance resource. Replaces any
    -     * existing policy.
    +     * 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 setIamPolicy( - com.google.iam.v1.SetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getSetIamPolicyMethod(), responseObserver); + 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); } /** * * *
    -     * Returns permissions that the caller has on the specified instance resource.
    +     * Deletes a cluster from an instance.
          * 
    */ - public void testIamPermissions( - com.google.iam.v1.TestIamPermissionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnimplementedUnaryCall(getTestIamPermissionsMethod(), responseObserver); - } - - @java.lang.Override - public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateInstanceMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateInstanceRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) - .addMethod( - getGetInstanceMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetInstanceRequest, - com.google.bigtable.admin.v2.Instance>(this, METHODID_GET_INSTANCE))) - .addMethod( - getListInstancesMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListInstancesRequest, - com.google.bigtable.admin.v2.ListInstancesResponse>( - this, METHODID_LIST_INSTANCES))) - .addMethod( - getUpdateInstanceMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance>( - this, METHODID_UPDATE_INSTANCE))) - .addMethod( - getPartialUpdateInstanceMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, - com.google.longrunning.Operation>(this, METHODID_PARTIAL_UPDATE_INSTANCE))) - .addMethod( - getDeleteInstanceMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteInstanceRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_INSTANCE))) - .addMethod( - getCreateClusterMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateClusterRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_CLUSTER))) - .addMethod( - getGetClusterMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetClusterRequest, - com.google.bigtable.admin.v2.Cluster>(this, METHODID_GET_CLUSTER))) - .addMethod( - getListClustersMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListClustersRequest, - com.google.bigtable.admin.v2.ListClustersResponse>( - this, METHODID_LIST_CLUSTERS))) - .addMethod( - getUpdateClusterMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.Cluster, com.google.longrunning.Operation>( - this, METHODID_UPDATE_CLUSTER))) - .addMethod( - getDeleteClusterMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteClusterRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_CLUSTER))) - .addMethod( - getCreateAppProfileMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateAppProfileRequest, - com.google.bigtable.admin.v2.AppProfile>(this, METHODID_CREATE_APP_PROFILE))) - .addMethod( - getGetAppProfileMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetAppProfileRequest, - com.google.bigtable.admin.v2.AppProfile>(this, METHODID_GET_APP_PROFILE))) - .addMethod( - getListAppProfilesMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListAppProfilesRequest, - com.google.bigtable.admin.v2.ListAppProfilesResponse>( - this, METHODID_LIST_APP_PROFILES))) - .addMethod( - getUpdateAppProfileMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.UpdateAppProfileRequest, - com.google.longrunning.Operation>(this, METHODID_UPDATE_APP_PROFILE))) - .addMethod( - getDeleteAppProfileMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteAppProfileRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_APP_PROFILE))) - .addMethod( - getGetIamPolicyMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_GET_IAM_POLICY))) - .addMethod( - getSetIamPolicyMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_SET_IAM_POLICY))) - .addMethod( - getTestIamPermissionsMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.TestIamPermissionsRequest, - com.google.iam.v1.TestIamPermissionsResponse>( - this, METHODID_TEST_IAM_PERMISSIONS))) - .build(); - } - } - - /** - * - * - *
    -   * 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); + 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); } /** * * *
    -     * Create an instance within a project.
    +     * Creates an app profile within an instance.
          * 
    */ - public void createInstance( - com.google.bigtable.admin.v2.CreateInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), - request, - responseObserver); + 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 instance.
    +     * Gets information about an app profile.
          * 
    */ - public void getInstance( - com.google.bigtable.admin.v2.GetInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetInstanceMethod(), getCallOptions()), - request, - responseObserver); + 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 instances in a project.
    +     * Lists information about app profiles in an instance.
          * 
    */ - public void listInstances( - com.google.bigtable.admin.v2.ListInstancesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getListInstancesMethod(), getCallOptions()), - request, - responseObserver); + 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 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.
    +     * Updates an app profile within an instance.
          * 
    */ - public void updateInstance( - com.google.bigtable.admin.v2.Instance request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * 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.
    +     * Deletes an app profile from an instance.
          * 
    */ - public void partialUpdateInstance( - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getPartialUpdateInstanceMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Delete an instance from a project.
    +     * 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 deleteInstance( - com.google.bigtable.admin.v2.DeleteInstanceRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Creates a cluster within an instance.
    +     * Sets the access control policy on an instance resource. Replaces any
    +     * existing policy.
          * 
    */ - public void createCluster( - com.google.bigtable.admin.v2.CreateClusterRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getCreateClusterMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Gets information about a cluster.
    +     * Returns permissions that the caller has on the specified instance resource.
          * 
    */ - public void getCluster( - com.google.bigtable.admin.v2.GetClusterRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + 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 information about clusters in an instance.
    +     * Lists hot tablets in a cluster, within the time range provided. Hot
    +     * tablets are ordered based on CPU usage.
          * 
    */ - public void listClusters( - com.google.bigtable.admin.v2.ListClustersRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getListClustersMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Updates a cluster within an instance.
    +     * Creates a logical view within an instance.
          * 
    */ - public void updateCluster( - com.google.bigtable.admin.v2.Cluster request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Deletes a cluster from an instance.
    +     * Gets information about a logical view.
          * 
    */ - public void deleteCluster( - com.google.bigtable.admin.v2.DeleteClusterRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Creates an app profile within an instance.
    +     * Lists information about logical views in an instance.
          * 
    */ - public void createAppProfile( - com.google.bigtable.admin.v2.CreateAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getCreateAppProfileMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Gets information about an app profile.
    +     * Updates a logical view within an instance.
          * 
    */ - public void getAppProfile( - com.google.bigtable.admin.v2.GetAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetAppProfileMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Lists information about app profiles in an instance.
    +     * Deletes a logical view from an instance.
          * 
    */ - public void listAppProfiles( - com.google.bigtable.admin.v2.ListAppProfilesRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getListAppProfilesMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Updates an app profile within an instance.
    +     * Creates a materialized view within an instance.
          * 
    */ - public void updateAppProfile( - com.google.bigtable.admin.v2.UpdateAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getUpdateAppProfileMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Deletes an app profile from an instance.
    +     * Gets information about a materialized view.
          * 
    */ - public void deleteAppProfile( - com.google.bigtable.admin.v2.DeleteAppProfileRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getDeleteAppProfileMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Gets the access control policy for an instance resource. Returns an empty
    -     * policy if an instance exists but does not have a policy set.
    +     * Lists information about materialized views in an instance.
          * 
    */ - public void getIamPolicy( - com.google.iam.v1.GetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Sets the access control policy on an instance resource. Replaces any
    -     * existing policy.
    +     * Updates a materialized view within an instance.
          * 
    */ - public void setIamPolicy( - com.google.iam.v1.SetIamPolicyRequest request, - io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( - getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), - request, - responseObserver); + 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); } /** * * *
    -     * Returns permissions that the caller has on the specified instance resource.
    +     * Deletes a materialized view from an instance.
          * 
    */ - public void testIamPermissions( - com.google.iam.v1.TestIamPermissionsRequest request, - io.grpc.stub.StreamObserver - responseObserver) { - asyncUnaryCall( - getChannel().newCall(getTestIamPermissionsMethod(), getCallOptions()), - request, - responseObserver); + 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
    @@ -1669,11 +3051,17 @@ protected BigtableInstanceAdminBlockingStub build(
          *
          * 
          * 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 blockingUnaryCall(getChannel(), getCreateInstanceMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateInstanceMethod(), getCallOptions(), request); } /** @@ -1685,7 +3073,8 @@ public com.google.longrunning.Operation createInstance( */ public com.google.bigtable.admin.v2.Instance getInstance( com.google.bigtable.admin.v2.GetInstanceRequest request) { - return blockingUnaryCall(getChannel(), getGetInstanceMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInstanceMethod(), getCallOptions(), request); } /** @@ -1697,7 +3086,8 @@ public com.google.bigtable.admin.v2.Instance getInstance( */ public com.google.bigtable.admin.v2.ListInstancesResponse listInstances( com.google.bigtable.admin.v2.ListInstancesRequest request) { - return blockingUnaryCall(getChannel(), getListInstancesMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInstancesMethod(), getCallOptions(), request); } /** @@ -1711,7 +3101,8 @@ public com.google.bigtable.admin.v2.ListInstancesResponse listInstances( */ public com.google.bigtable.admin.v2.Instance updateInstance( com.google.bigtable.admin.v2.Instance request) { - return blockingUnaryCall(getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateInstanceMethod(), getCallOptions(), request); } /** @@ -1724,7 +3115,7 @@ public com.google.bigtable.admin.v2.Instance updateInstance( */ public com.google.longrunning.Operation partialUpdateInstance( com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getPartialUpdateInstanceMethod(), getCallOptions(), request); } @@ -1737,7 +3128,8 @@ public com.google.longrunning.Operation partialUpdateInstance( */ public com.google.protobuf.Empty deleteInstance( com.google.bigtable.admin.v2.DeleteInstanceRequest request) { - return blockingUnaryCall(getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteInstanceMethod(), getCallOptions(), request); } /** @@ -1745,11 +3137,17 @@ public com.google.protobuf.Empty deleteInstance( * *
          * 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 blockingUnaryCall(getChannel(), getCreateClusterMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); } /** @@ -1761,7 +3159,8 @@ public com.google.longrunning.Operation createCluster( */ public com.google.bigtable.admin.v2.Cluster getCluster( com.google.bigtable.admin.v2.GetClusterRequest request) { - return blockingUnaryCall(getChannel(), getGetClusterMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); } /** @@ -1773,7 +3172,8 @@ public com.google.bigtable.admin.v2.Cluster getCluster( */ public com.google.bigtable.admin.v2.ListClustersResponse listClusters( com.google.bigtable.admin.v2.ListClustersRequest request) { - return blockingUnaryCall(getChannel(), getListClustersMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); } /** @@ -1781,11 +3181,37 @@ public com.google.bigtable.admin.v2.ListClustersResponse listClusters( * *
          * 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 blockingUnaryCall(getChannel(), getUpdateClusterMethod(), getCallOptions(), 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); } /** @@ -1797,7 +3223,8 @@ public com.google.longrunning.Operation updateCluster( */ public com.google.protobuf.Empty deleteCluster( com.google.bigtable.admin.v2.DeleteClusterRequest request) { - return blockingUnaryCall(getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); } /** @@ -1809,7 +3236,7 @@ public com.google.protobuf.Empty deleteCluster( */ public com.google.bigtable.admin.v2.AppProfile createAppProfile( com.google.bigtable.admin.v2.CreateAppProfileRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getCreateAppProfileMethod(), getCallOptions(), request); } @@ -1822,7 +3249,8 @@ public com.google.bigtable.admin.v2.AppProfile createAppProfile( */ public com.google.bigtable.admin.v2.AppProfile getAppProfile( com.google.bigtable.admin.v2.GetAppProfileRequest request) { - return blockingUnaryCall(getChannel(), getGetAppProfileMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetAppProfileMethod(), getCallOptions(), request); } /** @@ -1834,7 +3262,8 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile( */ public com.google.bigtable.admin.v2.ListAppProfilesResponse listAppProfiles( com.google.bigtable.admin.v2.ListAppProfilesRequest request) { - return blockingUnaryCall(getChannel(), getListAppProfilesMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListAppProfilesMethod(), getCallOptions(), request); } /** @@ -1846,7 +3275,7 @@ public com.google.bigtable.admin.v2.ListAppProfilesResponse listAppProfiles( */ public com.google.longrunning.Operation updateAppProfile( com.google.bigtable.admin.v2.UpdateAppProfileRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getUpdateAppProfileMethod(), getCallOptions(), request); } @@ -1859,7 +3288,7 @@ public com.google.longrunning.Operation updateAppProfile( */ public com.google.protobuf.Empty deleteAppProfile( com.google.bigtable.admin.v2.DeleteAppProfileRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteAppProfileMethod(), getCallOptions(), request); } @@ -1872,7 +3301,8 @@ public com.google.protobuf.Empty deleteAppProfile( *
    */ public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { - return blockingUnaryCall(getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); } /** @@ -1884,7 +3314,8 @@ public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyReque * */ public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { - return blockingUnaryCall(getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); } /** @@ -1896,13 +3327,158 @@ public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyReque */ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( com.google.iam.v1.TestIamPermissionsRequest request) { - return blockingUnaryCall( + 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
    @@ -1928,11 +3504,16 @@ protected BigtableInstanceAdminFutureStub build(
          *
          * 
          * 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 futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCreateInstanceMethod(), getCallOptions()), request); } @@ -1945,7 +3526,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture getInstance(com.google.bigtable.admin.v2.GetInstanceRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetInstanceMethod(), getCallOptions()), request); } @@ -1959,7 +3540,7 @@ protected BigtableInstanceAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.ListInstancesResponse> listInstances(com.google.bigtable.admin.v2.ListInstancesRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListInstancesMethod(), getCallOptions()), request); } @@ -1974,7 +3555,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture updateInstance(com.google.bigtable.admin.v2.Instance request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateInstanceMethod(), getCallOptions()), request); } @@ -1988,7 +3569,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture partialUpdateInstance(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPartialUpdateInstanceMethod(), getCallOptions()), request); } @@ -2001,7 +3582,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture deleteInstance(com.google.bigtable.admin.v2.DeleteInstanceRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteInstanceMethod(), getCallOptions()), request); } @@ -2010,11 +3591,16 @@ protected BigtableInstanceAdminFutureStub build( * *
          * 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 futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); } @@ -2027,7 +3613,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture getCluster(com.google.bigtable.admin.v2.GetClusterRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); } @@ -2041,7 +3627,7 @@ protected BigtableInstanceAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.ListClustersResponse> listClusters(com.google.bigtable.admin.v2.ListClustersRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListClustersMethod(), getCallOptions()), request); } @@ -2050,14 +3636,39 @@ protected BigtableInstanceAdminFutureStub build( * *
          * 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 futureUnaryCall( + 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); + } + /** * * @@ -2067,7 +3678,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture deleteCluster(com.google.bigtable.admin.v2.DeleteClusterRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); } @@ -2081,7 +3692,7 @@ protected BigtableInstanceAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.AppProfile> createAppProfile(com.google.bigtable.admin.v2.CreateAppProfileRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCreateAppProfileMethod(), getCallOptions()), request); } @@ -2095,7 +3706,7 @@ protected BigtableInstanceAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.AppProfile> getAppProfile(com.google.bigtable.admin.v2.GetAppProfileRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetAppProfileMethod(), getCallOptions()), request); } @@ -2109,7 +3720,7 @@ protected BigtableInstanceAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.ListAppProfilesResponse> listAppProfiles(com.google.bigtable.admin.v2.ListAppProfilesRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListAppProfilesMethod(), getCallOptions()), request); } @@ -2122,7 +3733,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture updateAppProfile(com.google.bigtable.admin.v2.UpdateAppProfileRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateAppProfileMethod(), getCallOptions()), request); } @@ -2135,7 +3746,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture deleteAppProfile(com.google.bigtable.admin.v2.DeleteAppProfileRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteAppProfileMethod(), getCallOptions()), request); } @@ -2149,7 +3760,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); } @@ -2163,7 +3774,7 @@ protected BigtableInstanceAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); } @@ -2177,9 +3788,158 @@ protected BigtableInstanceAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.iam.v1.TestIamPermissionsResponse> testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { - return futureUnaryCall( + 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; @@ -2192,25 +3952,37 @@ protected BigtableInstanceAdminFutureStub build( 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_DELETE_CLUSTER = 10; - private static final int METHODID_CREATE_APP_PROFILE = 11; - private static final int METHODID_GET_APP_PROFILE = 12; - private static final int METHODID_LIST_APP_PROFILES = 13; - private static final int METHODID_UPDATE_APP_PROFILE = 14; - private static final int METHODID_DELETE_APP_PROFILE = 15; - private static final int METHODID_GET_IAM_POLICY = 16; - private static final int METHODID_SET_IAM_POLICY = 17; - private static final int METHODID_TEST_IAM_PERMISSIONS = 18; + 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 BigtableInstanceAdminImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(BigtableInstanceAdminImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -2273,6 +4045,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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, @@ -2322,6 +4099,67 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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(); } @@ -2338,6 +4176,203 @@ public io.grpc.stub.StreamObserver invoke( } } + 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 { @@ -2362,9 +4397,9 @@ private static final class BigtableInstanceAdminFileDescriptorSupplier private static final class BigtableInstanceAdminMethodDescriptorSupplier extends BigtableInstanceAdminBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - BigtableInstanceAdminMethodDescriptorSupplier(String methodName) { + BigtableInstanceAdminMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } @@ -2396,6 +4431,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetClusterMethod()) .addMethod(getListClustersMethod()) .addMethod(getUpdateClusterMethod()) + .addMethod(getPartialUpdateClusterMethod()) .addMethod(getDeleteClusterMethod()) .addMethod(getCreateAppProfileMethod()) .addMethod(getGetAppProfileMethod()) @@ -2405,6 +4441,17 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .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(); } } diff --git a/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java b/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java index aafc011eaf..c827b0c4a7 100644 --- a/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java +++ b/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminGrpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,6 @@ package com.google.bigtable.admin.v2; import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; /** * @@ -31,14 +26,12 @@ * the tables. *
    */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/bigtable/admin/v2/bigtable_table_admin.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class BigtableTableAdminGrpc { private BigtableTableAdminGrpc() {} - public static final String SERVICE_NAME = "google.bigtable.admin.v2.BigtableTableAdmin"; + 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< @@ -220,6 +213,48 @@ private BigtableTableAdminGrpc() {} 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; @@ -261,6 +296,290 @@ private BigtableTableAdminGrpc() {} 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> @@ -887,6 +1206,48 @@ private BigtableTableAdminGrpc() {} 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; @@ -1010,42 +1371,286 @@ private BigtableTableAdminGrpc() {} return getTestIamPermissionsMethod; } - /** 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 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); - } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.CreateSchemaBundleRequest, com.google.longrunning.Operation> + getCreateSchemaBundleMethod; - /** 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); + @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); @@ -1060,7 +1665,7 @@ public BigtableTableAdminFutureStub newStub( * the tables. * */ - public abstract static class BigtableTableAdminImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -1071,10 +1676,11 @@ public abstract static class BigtableTableAdminImplBase implements io.grpc.Binda * specified in the request. * */ - public void createTable( + default void createTable( com.google.bigtable.admin.v2.CreateTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateTableMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTableMethod(), responseObserver); } /** @@ -1090,10 +1696,11 @@ public void createTable( * policy. * */ - public void createTableFromSnapshot( + default void createTableFromSnapshot( com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateTableFromSnapshotMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTableFromSnapshotMethod(), responseObserver); } /** @@ -1103,11 +1710,11 @@ public void createTableFromSnapshot( * Lists all tables served from a specified instance. * */ - public void listTables( + default void listTables( com.google.bigtable.admin.v2.ListTablesRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getListTablesMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTablesMethod(), responseObserver); } /** @@ -1117,10 +1724,24 @@ public void listTables( * Gets metadata information about the specified table. * */ - public void getTable( + default void getTable( com.google.bigtable.admin.v2.GetTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetTableMethod(), 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); } /** @@ -1130,10 +1751,96 @@ public void getTable( * Permanently deletes a specified table and all of its data. * */ - public void deleteTable( + default void deleteTable( com.google.bigtable.admin.v2.DeleteTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDeleteTableMethod(), 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); } /** @@ -1146,10 +1853,11 @@ public void deleteTable( * where only some modifications have taken effect. * */ - public void modifyColumnFamilies( + default void modifyColumnFamilies( com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getModifyColumnFamiliesMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getModifyColumnFamiliesMethod(), responseObserver); } /** @@ -1161,10 +1869,11 @@ public void modifyColumnFamilies( * particular prefix. * */ - public void dropRowRange( + default void dropRowRange( com.google.bigtable.admin.v2.DropRowRangeRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDropRowRangeMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDropRowRangeMethod(), responseObserver); } /** @@ -1177,11 +1886,12 @@ public void dropRowRange( * for 90 days. * */ - public void generateConsistencyToken( + default void generateConsistencyToken( com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGenerateConsistencyTokenMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateConsistencyTokenMethod(), responseObserver); } /** @@ -1193,11 +1903,12 @@ public void generateConsistencyToken( * and the check request. * */ - public void checkConsistency( + default void checkConsistency( com.google.bigtable.admin.v2.CheckConsistencyRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCheckConsistencyMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCheckConsistencyMethod(), responseObserver); } /** @@ -1213,10 +1924,11 @@ public void checkConsistency( * policy. * */ - public void snapshotTable( + default void snapshotTable( com.google.bigtable.admin.v2.SnapshotTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getSnapshotTableMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSnapshotTableMethod(), responseObserver); } /** @@ -1231,10 +1943,11 @@ public void snapshotTable( * policy. * */ - public void getSnapshot( + default void getSnapshot( com.google.bigtable.admin.v2.GetSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetSnapshotMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSnapshotMethod(), responseObserver); } /** @@ -1249,11 +1962,12 @@ public void getSnapshot( * policy. * */ - public void listSnapshots( + default void listSnapshots( com.google.bigtable.admin.v2.ListSnapshotsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getListSnapshotsMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSnapshotsMethod(), responseObserver); } /** @@ -1268,10 +1982,11 @@ public void listSnapshots( * policy. * */ - public void deleteSnapshot( + default void deleteSnapshot( com.google.bigtable.admin.v2.DeleteSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDeleteSnapshotMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSnapshotMethod(), responseObserver); } /** @@ -1284,14 +1999,15 @@ public void deleteSnapshot( * [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. + * [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the + * returned operation will stop the creation and delete the backup. * */ - public void createBackup( + default void createBackup( com.google.bigtable.admin.v2.CreateBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateBackupMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBackupMethod(), responseObserver); } /** @@ -1301,10 +2017,10 @@ public void createBackup( * Gets metadata on a pending or completed Cloud Bigtable Backup. * */ - public void getBackup( + default void getBackup( com.google.bigtable.admin.v2.GetBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); } /** @@ -1314,10 +2030,11 @@ public void getBackup( * Updates a pending or completed Cloud Bigtable Backup. * */ - public void updateBackup( + default void updateBackup( com.google.bigtable.admin.v2.UpdateBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getUpdateBackupMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBackupMethod(), responseObserver); } /** @@ -1327,10 +2044,11 @@ public void updateBackup( * Deletes a pending or completed Cloud Bigtable backup. * */ - public void deleteBackup( + default void deleteBackup( com.google.bigtable.admin.v2.DeleteBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getDeleteBackupMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBackupMethod(), responseObserver); } /** @@ -1341,222 +2059,187 @@ public void deleteBackup( * backups. * */ - public void listBackups( + default void listBackups( com.google.bigtable.admin.v2.ListBackupsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getListBackupsMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBackupsMethod(), responseObserver); } /** * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same instance as the instance containing the backup.  The
    +     * 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.RestoreTableMetadata].  The
    +     * [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( + default void restoreTable( com.google.bigtable.admin.v2.RestoreTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getRestoreTableMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRestoreTableMethod(), responseObserver); } /** * * *
    -     * Gets the access control policy for a Table or Backup resource.
    -     * Returns an empty policy if the resource exists but does not have a policy
    +     * 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.
          * 
    */ - public void getIamPolicy( + default void getIamPolicy( com.google.iam.v1.GetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetIamPolicyMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetIamPolicyMethod(), responseObserver); } /** * * *
    -     * Sets the access control policy on a Table or Backup resource.
    +     * Sets the access control policy on a Bigtable resource.
          * Replaces any existing policy.
          * 
    */ - public void setIamPolicy( + default void setIamPolicy( com.google.iam.v1.SetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getSetIamPolicyMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSetIamPolicyMethod(), responseObserver); } /** * * *
    -     * Returns permissions that the caller has on the specified Table or Backup resource.
    +     * Returns permissions that the caller has on the specified Bigtable
    +     * resource.
          * 
    */ - public void testIamPermissions( + default void testIamPermissions( com.google.iam.v1.TestIamPermissionsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getTestIamPermissionsMethod(), 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 io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateTableMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateTableRequest, - com.google.bigtable.admin.v2.Table>(this, METHODID_CREATE_TABLE))) - .addMethod( - getCreateTableFromSnapshotMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_TABLE_FROM_SNAPSHOT))) - .addMethod( - getListTablesMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListTablesRequest, - com.google.bigtable.admin.v2.ListTablesResponse>(this, METHODID_LIST_TABLES))) - .addMethod( - getGetTableMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetTableRequest, - com.google.bigtable.admin.v2.Table>(this, METHODID_GET_TABLE))) - .addMethod( - getDeleteTableMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteTableRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_TABLE))) - .addMethod( - getModifyColumnFamiliesMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, - com.google.bigtable.admin.v2.Table>(this, METHODID_MODIFY_COLUMN_FAMILIES))) - .addMethod( - getDropRowRangeMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DropRowRangeRequest, com.google.protobuf.Empty>( - this, METHODID_DROP_ROW_RANGE))) - .addMethod( - getGenerateConsistencyTokenMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest, - com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse>( - this, METHODID_GENERATE_CONSISTENCY_TOKEN))) - .addMethod( - getCheckConsistencyMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CheckConsistencyRequest, - com.google.bigtable.admin.v2.CheckConsistencyResponse>( - this, METHODID_CHECK_CONSISTENCY))) - .addMethod( - getSnapshotTableMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.SnapshotTableRequest, - com.google.longrunning.Operation>(this, METHODID_SNAPSHOT_TABLE))) - .addMethod( - getGetSnapshotMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetSnapshotRequest, - com.google.bigtable.admin.v2.Snapshot>(this, METHODID_GET_SNAPSHOT))) - .addMethod( - getListSnapshotsMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListSnapshotsRequest, - com.google.bigtable.admin.v2.ListSnapshotsResponse>( - this, METHODID_LIST_SNAPSHOTS))) - .addMethod( - getDeleteSnapshotMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteSnapshotRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_SNAPSHOT))) - .addMethod( - getCreateBackupMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateBackupRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) - .addMethod( - getGetBackupMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetBackupRequest, - com.google.bigtable.admin.v2.Backup>(this, METHODID_GET_BACKUP))) - .addMethod( - getUpdateBackupMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.UpdateBackupRequest, - com.google.bigtable.admin.v2.Backup>(this, METHODID_UPDATE_BACKUP))) - .addMethod( - getDeleteBackupMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteBackupRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_BACKUP))) - .addMethod( - getListBackupsMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListBackupsRequest, - com.google.bigtable.admin.v2.ListBackupsResponse>( - this, METHODID_LIST_BACKUPS))) - .addMethod( - getRestoreTableMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.RestoreTableRequest, - com.google.longrunning.Operation>(this, METHODID_RESTORE_TABLE))) - .addMethod( - getGetIamPolicyMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_GET_IAM_POLICY))) - .addMethod( - getSetIamPolicyMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_SET_IAM_POLICY))) - .addMethod( - getTestIamPermissionsMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.TestIamPermissionsRequest, - com.google.iam.v1.TestIamPermissionsResponse>( - this, METHODID_TEST_IAM_PERMISSIONS))) - .build(); + 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.
    @@ -1588,7 +2271,7 @@ protected BigtableTableAdminStub build(
         public void createTable(
             com.google.bigtable.admin.v2.CreateTableRequest request,
             io.grpc.stub.StreamObserver responseObserver) {
    -      asyncUnaryCall(
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
               getChannel().newCall(getCreateTableMethod(), getCallOptions()),
               request,
               responseObserver);
    @@ -1610,7 +2293,7 @@ public void createTable(
         public void createTableFromSnapshot(
             com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request,
             io.grpc.stub.StreamObserver responseObserver) {
    -      asyncUnaryCall(
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
               getChannel().newCall(getCreateTableFromSnapshotMethod(), getCallOptions()),
               request,
               responseObserver);
    @@ -1627,7 +2310,7 @@ public void listTables(
             com.google.bigtable.admin.v2.ListTablesRequest request,
             io.grpc.stub.StreamObserver
                 responseObserver) {
    -      asyncUnaryCall(
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
               getChannel().newCall(getListTablesMethod(), getCallOptions()), request, responseObserver);
         }
     
    @@ -1641,10 +2324,26 @@ public void listTables(
         public void getTable(
             com.google.bigtable.admin.v2.GetTableRequest request,
             io.grpc.stub.StreamObserver responseObserver) {
    -      asyncUnaryCall(
    +      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); + } + /** * * @@ -1655,12 +2354,109 @@ public void getTable( public void deleteTable( com.google.bigtable.admin.v2.DeleteTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + 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); + } + /** * * @@ -1674,7 +2470,7 @@ public void deleteTable( public void modifyColumnFamilies( com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getModifyColumnFamiliesMethod(), getCallOptions()), request, responseObserver); @@ -1692,7 +2488,7 @@ public void modifyColumnFamilies( public void dropRowRange( com.google.bigtable.admin.v2.DropRowRangeRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getDropRowRangeMethod(), getCallOptions()), request, responseObserver); @@ -1712,7 +2508,7 @@ public void generateConsistencyToken( com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGenerateConsistencyTokenMethod(), getCallOptions()), request, responseObserver); @@ -1731,7 +2527,7 @@ public void checkConsistency( com.google.bigtable.admin.v2.CheckConsistencyRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getCheckConsistencyMethod(), getCallOptions()), request, responseObserver); @@ -1753,7 +2549,7 @@ public void checkConsistency( public void snapshotTable( com.google.bigtable.admin.v2.SnapshotTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getSnapshotTableMethod(), getCallOptions()), request, responseObserver); @@ -1774,7 +2570,7 @@ public void snapshotTable( public void getSnapshot( com.google.bigtable.admin.v2.GetSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), request, responseObserver); @@ -1796,7 +2592,7 @@ public void listSnapshots( com.google.bigtable.admin.v2.ListSnapshotsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), request, responseObserver); @@ -1817,7 +2613,7 @@ public void listSnapshots( public void deleteSnapshot( com.google.bigtable.admin.v2.DeleteSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), request, responseObserver); @@ -1833,14 +2629,14 @@ public void deleteSnapshot( * [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. + * [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) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request, responseObserver); @@ -1856,7 +2652,7 @@ public void createBackup( public void getBackup( com.google.bigtable.admin.v2.GetBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetBackupMethod(), getCallOptions()), request, responseObserver); } @@ -1870,7 +2666,7 @@ public void getBackup( public void updateBackup( com.google.bigtable.admin.v2.UpdateBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request, responseObserver); @@ -1886,7 +2682,7 @@ public void updateBackup( public void deleteBackup( com.google.bigtable.admin.v2.DeleteBackupRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request, responseObserver); @@ -1904,7 +2700,7 @@ public void listBackups( com.google.bigtable.admin.v2.ListBackupsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getListBackupsMethod(), getCallOptions()), request, responseObserver); @@ -1914,12 +2710,11 @@ public void listBackups( * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same instance as the instance containing the backup.  The
    +     * 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.RestoreTableMetadata].  The
    +     * [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].  The
          * [response][google.longrunning.Operation.response] type is
          * [Table][google.bigtable.admin.v2.Table], if successful.
          * 
    @@ -1927,7 +2722,7 @@ public void listBackups( public void restoreTable( com.google.bigtable.admin.v2.RestoreTableRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getRestoreTableMethod(), getCallOptions()), request, responseObserver); @@ -1937,7 +2732,22 @@ public void restoreTable( * * *
    -     * Gets the access control policy for a Table or Backup resource.
    +     * 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.
          * 
    @@ -1945,7 +2755,7 @@ public void restoreTable( public void getIamPolicy( com.google.iam.v1.GetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request, responseObserver); @@ -1955,14 +2765,14 @@ public void getIamPolicy( * * *
    -     * Sets the access control policy on a Table or Backup resource.
    +     * 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) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request, responseObserver); @@ -1972,22 +2782,654 @@ public void setIamPolicy( * * *
    -     * Returns permissions that the caller has on the specified Table or Backup resource.
    +     * 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) { - asyncUnaryCall( + 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.
    @@ -2019,7 +3461,8 @@ protected BigtableTableAdminBlockingStub build(
          */
         public com.google.bigtable.admin.v2.Table createTable(
             com.google.bigtable.admin.v2.CreateTableRequest request) {
    -      return blockingUnaryCall(getChannel(), getCreateTableMethod(), getCallOptions(), request);
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getCreateTableMethod(), getCallOptions(), request);
         }
     
         /**
    @@ -2037,7 +3480,7 @@ public com.google.bigtable.admin.v2.Table createTable(
          */
         public com.google.longrunning.Operation createTableFromSnapshot(
             com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request) {
    -      return blockingUnaryCall(
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
               getChannel(), getCreateTableFromSnapshotMethod(), getCallOptions(), request);
         }
     
    @@ -2050,7 +3493,8 @@ public com.google.longrunning.Operation createTableFromSnapshot(
          */
         public com.google.bigtable.admin.v2.ListTablesResponse listTables(
             com.google.bigtable.admin.v2.ListTablesRequest request) {
    -      return blockingUnaryCall(getChannel(), getListTablesMethod(), getCallOptions(), request);
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getListTablesMethod(), getCallOptions(), request);
         }
     
         /**
    @@ -2062,7 +3506,21 @@ public com.google.bigtable.admin.v2.ListTablesResponse listTables(
          */
         public com.google.bigtable.admin.v2.Table getTable(
             com.google.bigtable.admin.v2.GetTableRequest request) {
    -      return blockingUnaryCall(getChannel(), getGetTableMethod(), getCallOptions(), 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); } /** @@ -2074,7 +3532,86 @@ public com.google.bigtable.admin.v2.Table getTable( */ public com.google.protobuf.Empty deleteTable( com.google.bigtable.admin.v2.DeleteTableRequest request) { - return blockingUnaryCall(getChannel(), getDeleteTableMethod(), getCallOptions(), 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); } /** @@ -2089,7 +3626,7 @@ public com.google.protobuf.Empty deleteTable( */ public com.google.bigtable.admin.v2.Table modifyColumnFamilies( com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getModifyColumnFamiliesMethod(), getCallOptions(), request); } @@ -2104,7 +3641,8 @@ public com.google.bigtable.admin.v2.Table modifyColumnFamilies( */ public com.google.protobuf.Empty dropRowRange( com.google.bigtable.admin.v2.DropRowRangeRequest request) { - return blockingUnaryCall(getChannel(), getDropRowRangeMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDropRowRangeMethod(), getCallOptions(), request); } /** @@ -2119,7 +3657,7 @@ public com.google.protobuf.Empty dropRowRange( */ public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateConsistencyToken( com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGenerateConsistencyTokenMethod(), getCallOptions(), request); } @@ -2134,7 +3672,7 @@ public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse generateCon */ public com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency( com.google.bigtable.admin.v2.CheckConsistencyRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getCheckConsistencyMethod(), getCallOptions(), request); } @@ -2153,7 +3691,8 @@ public com.google.bigtable.admin.v2.CheckConsistencyResponse checkConsistency( */ public com.google.longrunning.Operation snapshotTable( com.google.bigtable.admin.v2.SnapshotTableRequest request) { - return blockingUnaryCall(getChannel(), getSnapshotTableMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSnapshotTableMethod(), getCallOptions(), request); } /** @@ -2170,7 +3709,8 @@ public com.google.longrunning.Operation snapshotTable( */ public com.google.bigtable.admin.v2.Snapshot getSnapshot( com.google.bigtable.admin.v2.GetSnapshotRequest request) { - return blockingUnaryCall(getChannel(), getGetSnapshotMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSnapshotMethod(), getCallOptions(), request); } /** @@ -2187,7 +3727,8 @@ public com.google.bigtable.admin.v2.Snapshot getSnapshot( */ public com.google.bigtable.admin.v2.ListSnapshotsResponse listSnapshots( com.google.bigtable.admin.v2.ListSnapshotsRequest request) { - return blockingUnaryCall(getChannel(), getListSnapshotsMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSnapshotsMethod(), getCallOptions(), request); } /** @@ -2204,7 +3745,8 @@ public com.google.bigtable.admin.v2.ListSnapshotsResponse listSnapshots( */ public com.google.protobuf.Empty deleteSnapshot( com.google.bigtable.admin.v2.DeleteSnapshotRequest request) { - return blockingUnaryCall(getChannel(), getDeleteSnapshotMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSnapshotMethod(), getCallOptions(), request); } /** @@ -2217,13 +3759,14 @@ public com.google.protobuf.Empty deleteSnapshot( * [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. + * [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 blockingUnaryCall(getChannel(), getCreateBackupMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBackupMethod(), getCallOptions(), request); } /** @@ -2235,7 +3778,8 @@ public com.google.longrunning.Operation createBackup( */ public com.google.bigtable.admin.v2.Backup getBackup( com.google.bigtable.admin.v2.GetBackupRequest request) { - return blockingUnaryCall(getChannel(), getGetBackupMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBackupMethod(), getCallOptions(), request); } /** @@ -2247,7 +3791,8 @@ public com.google.bigtable.admin.v2.Backup getBackup( */ public com.google.bigtable.admin.v2.Backup updateBackup( com.google.bigtable.admin.v2.UpdateBackupRequest request) { - return blockingUnaryCall(getChannel(), getUpdateBackupMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBackupMethod(), getCallOptions(), request); } /** @@ -2259,7 +3804,8 @@ public com.google.bigtable.admin.v2.Backup updateBackup( */ public com.google.protobuf.Empty deleteBackup( com.google.bigtable.admin.v2.DeleteBackupRequest request) { - return blockingUnaryCall(getChannel(), getDeleteBackupMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBackupMethod(), getCallOptions(), request); } /** @@ -2272,69 +3818,152 @@ public com.google.protobuf.Empty deleteBackup( */ public com.google.bigtable.admin.v2.ListBackupsResponse listBackups( com.google.bigtable.admin.v2.ListBackupsRequest request) { - return blockingUnaryCall(getChannel(), getListBackupsMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBackupsMethod(), getCallOptions(), request); } /** * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same instance as the instance containing the backup.  The
    +     * 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.RestoreTableMetadata].  The
    +     * [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 blockingUnaryCall(getChannel(), getRestoreTableMethod(), getCallOptions(), 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 Table or Backup resource.
    +     * 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 blockingUnaryCall(getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIamPolicyMethod(), getCallOptions(), request); } /** * * *
    -     * Sets the access control policy on a Table or Backup resource.
    +     * 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 blockingUnaryCall(getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSetIamPolicyMethod(), getCallOptions(), request); } /** * * *
    -     * Returns permissions that the caller has on the specified Table or Backup resource.
    +     * 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 blockingUnaryCall( + 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.
    @@ -2365,7 +3994,7 @@ protected BigtableTableAdminFutureStub build(
          */
         public com.google.common.util.concurrent.ListenableFuture
             createTable(com.google.bigtable.admin.v2.CreateTableRequest request) {
    -      return futureUnaryCall(
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
               getChannel().newCall(getCreateTableMethod(), getCallOptions()), request);
         }
     
    @@ -2385,7 +4014,7 @@ protected BigtableTableAdminFutureStub build(
         public com.google.common.util.concurrent.ListenableFuture
             createTableFromSnapshot(
                 com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request) {
    -      return futureUnaryCall(
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
               getChannel().newCall(getCreateTableFromSnapshotMethod(), getCallOptions()), request);
         }
     
    @@ -2399,7 +4028,7 @@ protected BigtableTableAdminFutureStub build(
         public com.google.common.util.concurrent.ListenableFuture<
                 com.google.bigtable.admin.v2.ListTablesResponse>
             listTables(com.google.bigtable.admin.v2.ListTablesRequest request) {
    -      return futureUnaryCall(
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
               getChannel().newCall(getListTablesMethod(), getCallOptions()), request);
         }
     
    @@ -2412,7 +4041,21 @@ protected BigtableTableAdminFutureStub build(
          */
         public com.google.common.util.concurrent.ListenableFuture
             getTable(com.google.bigtable.admin.v2.GetTableRequest request) {
    -      return futureUnaryCall(getChannel().newCall(getGetTableMethod(), getCallOptions()), 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); } /** @@ -2424,10 +4067,90 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture deleteTable(com.google.bigtable.admin.v2.DeleteTableRequest request) { - return futureUnaryCall( + 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); + } + /** * * @@ -2440,7 +4163,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture modifyColumnFamilies(com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getModifyColumnFamiliesMethod(), getCallOptions()), request); } @@ -2455,7 +4178,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture dropRowRange(com.google.bigtable.admin.v2.DropRowRangeRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDropRowRangeMethod(), getCallOptions()), request); } @@ -2473,7 +4196,7 @@ protected BigtableTableAdminFutureStub build( com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse> generateConsistencyToken( com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGenerateConsistencyTokenMethod(), getCallOptions()), request); } @@ -2489,7 +4212,7 @@ protected BigtableTableAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.CheckConsistencyResponse> checkConsistency(com.google.bigtable.admin.v2.CheckConsistencyRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCheckConsistencyMethod(), getCallOptions()), request); } @@ -2508,7 +4231,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture snapshotTable(com.google.bigtable.admin.v2.SnapshotTableRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getSnapshotTableMethod(), getCallOptions()), request); } @@ -2526,7 +4249,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture getSnapshot(com.google.bigtable.admin.v2.GetSnapshotRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetSnapshotMethod(), getCallOptions()), request); } @@ -2545,7 +4268,7 @@ protected BigtableTableAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.ListSnapshotsResponse> listSnapshots(com.google.bigtable.admin.v2.ListSnapshotsRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListSnapshotsMethod(), getCallOptions()), request); } @@ -2563,7 +4286,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture deleteSnapshot(com.google.bigtable.admin.v2.DeleteSnapshotRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteSnapshotMethod(), getCallOptions()), request); } @@ -2577,13 +4300,13 @@ protected BigtableTableAdminFutureStub build( * [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. + * [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 futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCreateBackupMethod(), getCallOptions()), request); } @@ -2596,7 +4319,8 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture getBackup(com.google.bigtable.admin.v2.GetBackupRequest request) { - return futureUnaryCall(getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBackupMethod(), getCallOptions()), request); } /** @@ -2608,7 +4332,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture updateBackup(com.google.bigtable.admin.v2.UpdateBackupRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateBackupMethod(), getCallOptions()), request); } @@ -2621,7 +4345,7 @@ protected BigtableTableAdminFutureStub build( */ public com.google.common.util.concurrent.ListenableFuture deleteBackup(com.google.bigtable.admin.v2.DeleteBackupRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteBackupMethod(), getCallOptions()), request); } @@ -2636,7 +4360,7 @@ protected BigtableTableAdminFutureStub build( public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.admin.v2.ListBackupsResponse> listBackups(com.google.bigtable.admin.v2.ListBackupsRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListBackupsMethod(), getCallOptions()), request); } @@ -2644,19 +4368,18 @@ protected BigtableTableAdminFutureStub build( * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same instance as the instance containing the backup.  The
    +     * 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.RestoreTableMetadata].  The
    +     * [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 futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getRestoreTableMethod(), getCallOptions()), request); } @@ -2664,14 +4387,28 @@ protected BigtableTableAdminFutureStub build( * * *
    -     * Gets the access control policy for a Table or Backup resource.
    +     * 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 futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetIamPolicyMethod(), getCallOptions()), request); } @@ -2679,13 +4416,13 @@ protected BigtableTableAdminFutureStub build( * * *
    -     * Sets the access control policy on a Table or Backup resource.
    +     * 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 futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getSetIamPolicyMethod(), getCallOptions()), request); } @@ -2693,49 +4430,130 @@ protected BigtableTableAdminFutureStub build( * * *
    -     * Returns permissions that the caller has on the specified Table or Backup resource.
    +     * 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 futureUnaryCall( + 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_DELETE_TABLE = 4; - private static final int METHODID_MODIFY_COLUMN_FAMILIES = 5; - private static final int METHODID_DROP_ROW_RANGE = 6; - private static final int METHODID_GENERATE_CONSISTENCY_TOKEN = 7; - private static final int METHODID_CHECK_CONSISTENCY = 8; - private static final int METHODID_SNAPSHOT_TABLE = 9; - private static final int METHODID_GET_SNAPSHOT = 10; - private static final int METHODID_LIST_SNAPSHOTS = 11; - private static final int METHODID_DELETE_SNAPSHOT = 12; - private static final int METHODID_CREATE_BACKUP = 13; - private static final int METHODID_GET_BACKUP = 14; - private static final int METHODID_UPDATE_BACKUP = 15; - private static final int METHODID_DELETE_BACKUP = 16; - private static final int METHODID_LIST_BACKUPS = 17; - private static final int METHODID_RESTORE_TABLE = 18; - private static final int METHODID_GET_IAM_POLICY = 19; - private static final int METHODID_SET_IAM_POLICY = 20; - private static final int METHODID_TEST_IAM_PERMISSIONS = 21; + 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 BigtableTableAdminImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(BigtableTableAdminImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -2765,11 +4583,49 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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, @@ -2846,6 +4702,11 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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, @@ -2862,6 +4723,33 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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(); } @@ -2878,6 +4766,230 @@ public io.grpc.stub.StreamObserver invoke( } } + 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 { @@ -2902,9 +5014,9 @@ private static final class BigtableTableAdminFileDescriptorSupplier private static final class BigtableTableAdminMethodDescriptorSupplier extends BigtableTableAdminBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - BigtableTableAdminMethodDescriptorSupplier(String methodName) { + BigtableTableAdminMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } @@ -2930,7 +5042,14 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .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()) @@ -2945,9 +5064,15 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .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(); } } diff --git a/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml b/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml index 9f4bd315b7..142d0f217e 100644 --- a/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml +++ b/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml @@ -1,10 +1,10 @@ + - - 6001 - com/google/bigtable/v2/*Grpc - METHOD_* + 7012 + com/google/bigtable/v2/BigtableGrpc$AsyncService + *prepareQuery(* diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index de2a09b39f..ea38d3638e 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 1.20.2-SNAPSHOT + 2.76.0 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.20.2-SNAPSHOT + 2.76.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import @@ -66,7 +66,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 protected true diff --git a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java index 8ad2f7af34..d579262bb9 100644 --- a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java +++ b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,14 +16,6 @@ package com.google.bigtable.v2; import static io.grpc.MethodDescriptor.generateFullMethodName; -import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; -import static io.grpc.stub.ClientCalls.asyncUnaryCall; -import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; -import static io.grpc.stub.ClientCalls.blockingUnaryCall; -import static io.grpc.stub.ClientCalls.futureUnaryCall; -import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; -import static io.grpc.stub.ServerCalls.asyncUnaryCall; -import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; /** * @@ -32,14 +24,12 @@ * Service for reading from and writing to existing Bigtable tables. * */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/bigtable/v2/bigtable.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class BigtableGrpc { private BigtableGrpc() {} - public static final String SERVICE_NAME = "google.bigtable.v2.Bigtable"; + 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< @@ -253,6 +243,47 @@ private BigtableGrpc() {} return getCheckAndMutateRowMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PingAndWarm", + requestType = com.google.bigtable.v2.PingAndWarmRequest.class, + responseType = com.google.bigtable.v2.PingAndWarmResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod; + if ((getPingAndWarmMethod = BigtableGrpc.getPingAndWarmMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getPingAndWarmMethod = BigtableGrpc.getPingAndWarmMethod) == null) { + BigtableGrpc.getPingAndWarmMethod = + getPingAndWarmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PingAndWarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PingAndWarmRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PingAndWarmResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("PingAndWarm")) + .build(); + } + } + } + return getPingAndWarmMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.bigtable.v2.ReadModifyWriteRowRequest, com.google.bigtable.v2.ReadModifyWriteRowResponse> @@ -300,6 +331,186 @@ private BigtableGrpc() {} 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; + } + /** 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 = @@ -312,6 +523,19 @@ public BigtableStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOpt 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 */ @@ -347,7 +571,7 @@ public BigtableFutureStub newStub( * Service for reading from and writing to existing Bigtable tables. * */ - public abstract static class BigtableImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -360,10 +584,10 @@ public abstract static class BigtableImplBase implements io.grpc.BindableService * ReadRowsResponse documentation for details. * */ - public void readRows( + default void readRows( com.google.bigtable.v2.ReadRowsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getReadRowsMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadRowsMethod(), responseObserver); } /** @@ -376,11 +600,12 @@ public void readRows( * mapreduces. * */ - public void sampleRowKeys( + default void sampleRowKeys( com.google.bigtable.v2.SampleRowKeysRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getSampleRowKeysMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSampleRowKeysMethod(), responseObserver); } /** @@ -391,10 +616,10 @@ public void sampleRowKeys( * unchanged unless explicitly changed by `mutation`. * */ - public void mutateRow( + default void mutateRow( com.google.bigtable.v2.MutateRowRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getMutateRowMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMutateRowMethod(), responseObserver); } /** @@ -406,10 +631,10 @@ public void mutateRow( * atomically. * */ - public void mutateRows( + default void mutateRows( com.google.bigtable.v2.MutateRowsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getMutateRowsMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMutateRowsMethod(), responseObserver); } /** @@ -419,11 +644,27 @@ public void mutateRows( * Mutates a row atomically based on the output of a predicate Reader filter. * */ - public void checkAndMutateRow( + default void checkAndMutateRow( com.google.bigtable.v2.CheckAndMutateRowRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCheckAndMutateRowMethod(), 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); } /** @@ -437,61 +678,97 @@ public void checkAndMutateRow( * time. The method returns the new contents of all modified cells. * */ - public void readModifyWriteRow( + default void readModifyWriteRow( com.google.bigtable.v2.ReadModifyWriteRowRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getReadModifyWriteRowMethod(), 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); } + } + + /** + * 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 io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getReadRowsMethod(), - asyncServerStreamingCall( - new MethodHandlers< - com.google.bigtable.v2.ReadRowsRequest, - com.google.bigtable.v2.ReadRowsResponse>(this, METHODID_READ_ROWS))) - .addMethod( - getSampleRowKeysMethod(), - asyncServerStreamingCall( - new MethodHandlers< - com.google.bigtable.v2.SampleRowKeysRequest, - com.google.bigtable.v2.SampleRowKeysResponse>( - this, METHODID_SAMPLE_ROW_KEYS))) - .addMethod( - getMutateRowMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.v2.MutateRowRequest, - com.google.bigtable.v2.MutateRowResponse>(this, METHODID_MUTATE_ROW))) - .addMethod( - getMutateRowsMethod(), - asyncServerStreamingCall( - new MethodHandlers< - com.google.bigtable.v2.MutateRowsRequest, - com.google.bigtable.v2.MutateRowsResponse>(this, METHODID_MUTATE_ROWS))) - .addMethod( - getCheckAndMutateRowMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.v2.CheckAndMutateRowRequest, - com.google.bigtable.v2.CheckAndMutateRowResponse>( - this, METHODID_CHECK_AND_MUTATE_ROW))) - .addMethod( - getReadModifyWriteRowMethod(), - asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.v2.ReadModifyWriteRowRequest, - com.google.bigtable.v2.ReadModifyWriteRowResponse>( - this, METHODID_READ_MODIFY_WRITE_ROW))) - .build(); + 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.
    @@ -521,7 +798,7 @@ protected BigtableStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp
         public void readRows(
             com.google.bigtable.v2.ReadRowsRequest request,
             io.grpc.stub.StreamObserver responseObserver) {
    -      asyncServerStreamingCall(
    +      io.grpc.stub.ClientCalls.asyncServerStreamingCall(
               getChannel().newCall(getReadRowsMethod(), getCallOptions()), request, responseObserver);
         }
     
    @@ -539,7 +816,7 @@ public void sampleRowKeys(
             com.google.bigtable.v2.SampleRowKeysRequest request,
             io.grpc.stub.StreamObserver
                 responseObserver) {
    -      asyncServerStreamingCall(
    +      io.grpc.stub.ClientCalls.asyncServerStreamingCall(
               getChannel().newCall(getSampleRowKeysMethod(), getCallOptions()),
               request,
               responseObserver);
    @@ -556,7 +833,7 @@ public void sampleRowKeys(
         public void mutateRow(
             com.google.bigtable.v2.MutateRowRequest request,
             io.grpc.stub.StreamObserver responseObserver) {
    -      asyncUnaryCall(
    +      io.grpc.stub.ClientCalls.asyncUnaryCall(
               getChannel().newCall(getMutateRowMethod(), getCallOptions()), request, responseObserver);
         }
     
    @@ -572,7 +849,7 @@ public void mutateRow(
         public void mutateRows(
             com.google.bigtable.v2.MutateRowsRequest request,
             io.grpc.stub.StreamObserver responseObserver) {
    -      asyncServerStreamingCall(
    +      io.grpc.stub.ClientCalls.asyncServerStreamingCall(
               getChannel().newCall(getMutateRowsMethod(), getCallOptions()), request, responseObserver);
         }
     
    @@ -587,12 +864,29 @@ public void checkAndMutateRow(
             com.google.bigtable.v2.CheckAndMutateRowRequest request,
             io.grpc.stub.StreamObserver
                 responseObserver) {
    -      asyncUnaryCall(
    +      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); + } + /** * * @@ -608,15 +902,283 @@ public void readModifyWriteRow( com.google.bigtable.v2.ReadModifyWriteRowRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + 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); + } } /** + * 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); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Bigtable. * *
        * Service for reading from and writing to existing Bigtable tables.
    @@ -646,7 +1208,7 @@ protected BigtableBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption
          */
         public java.util.Iterator readRows(
             com.google.bigtable.v2.ReadRowsRequest request) {
    -      return blockingServerStreamingCall(
    +      return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
               getChannel(), getReadRowsMethod(), getCallOptions(), request);
         }
     
    @@ -662,7 +1224,7 @@ public java.util.Iterator readRows(
          */
         public java.util.Iterator sampleRowKeys(
             com.google.bigtable.v2.SampleRowKeysRequest request) {
    -      return blockingServerStreamingCall(
    +      return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
               getChannel(), getSampleRowKeysMethod(), getCallOptions(), request);
         }
     
    @@ -676,7 +1238,8 @@ public java.util.Iterator sampleRo
          */
         public com.google.bigtable.v2.MutateRowResponse mutateRow(
             com.google.bigtable.v2.MutateRowRequest request) {
    -      return blockingUnaryCall(getChannel(), getMutateRowMethod(), getCallOptions(), request);
    +      return io.grpc.stub.ClientCalls.blockingUnaryCall(
    +          getChannel(), getMutateRowMethod(), getCallOptions(), request);
         }
     
         /**
    @@ -690,7 +1253,7 @@ public com.google.bigtable.v2.MutateRowResponse mutateRow(
          */
         public java.util.Iterator mutateRows(
             com.google.bigtable.v2.MutateRowsRequest request) {
    -      return blockingServerStreamingCall(
    +      return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
               getChannel(), getMutateRowsMethod(), getCallOptions(), request);
         }
     
    @@ -703,10 +1266,24 @@ public java.util.Iterator mutateRows(
          */
         public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow(
             com.google.bigtable.v2.CheckAndMutateRowRequest request) {
    -      return blockingUnaryCall(
    +      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); + } + /** * * @@ -720,13 +1297,75 @@ public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow( */ public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow( com.google.bigtable.v2.ReadModifyWriteRowRequest request) { - return blockingUnaryCall( + 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); + } } /** - * + * A stub to allow clients to do ListenableFuture-style rpc calls to service Bigtable. * *
        * Service for reading from and writing to existing Bigtable tables.
    @@ -754,7 +1393,8 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions
         public com.google.common.util.concurrent.ListenableFuture<
                 com.google.bigtable.v2.MutateRowResponse>
             mutateRow(com.google.bigtable.v2.MutateRowRequest request) {
    -      return futureUnaryCall(getChannel().newCall(getMutateRowMethod(), getCallOptions()), request);
    +      return io.grpc.stub.ClientCalls.futureUnaryCall(
    +          getChannel().newCall(getMutateRowMethod(), getCallOptions()), request);
         }
     
         /**
    @@ -767,10 +1407,25 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions
         public com.google.common.util.concurrent.ListenableFuture<
                 com.google.bigtable.v2.CheckAndMutateRowResponse>
             checkAndMutateRow(com.google.bigtable.v2.CheckAndMutateRowRequest request) {
    -      return futureUnaryCall(
    +      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); + } + /** * * @@ -785,9 +1440,23 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions public com.google.common.util.concurrent.ListenableFuture< com.google.bigtable.v2.ReadModifyWriteRowResponse> readModifyWriteRow(com.google.bigtable.v2.ReadModifyWriteRowRequest request) { - return futureUnaryCall( + 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); + } } private static final int METHODID_READ_ROWS = 0; @@ -795,17 +1464,22 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions private static final int METHODID_MUTATE_ROW = 2; private static final int METHODID_MUTATE_ROWS = 3; private static final int METHODID_CHECK_AND_MUTATE_ROW = 4; - private static final int METHODID_READ_MODIFY_WRITE_ROW = 5; + private static final int METHODID_PING_AND_WARM = 5; + private static final int METHODID_READ_MODIFY_WRITE_ROW = 6; + private static final 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 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 BigtableImplBase serviceImpl; + private final AsyncService serviceImpl; private final int methodId; - MethodHandlers(BigtableImplBase serviceImpl, int methodId) { + MethodHandlers(AsyncService serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @@ -844,12 +1518,43 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_PING_AND_WARM: + serviceImpl.pingAndWarm( + (com.google.bigtable.v2.PingAndWarmRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_READ_MODIFY_WRITE_ROW: serviceImpl.readModifyWriteRow( (com.google.bigtable.v2.ReadModifyWriteRowRequest) request, (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; default: throw new AssertionError(); } @@ -866,6 +1571,82 @@ public io.grpc.stub.StreamObserver invoke( } } + 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))) + .build(); + } + private abstract static class BigtableBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { @@ -888,9 +1669,9 @@ private static final class BigtableFileDescriptorSupplier extends BigtableBaseDe private static final class BigtableMethodDescriptorSupplier extends BigtableBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - BigtableMethodDescriptorSupplier(String methodName) { + BigtableMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } @@ -917,7 +1698,12 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getMutateRowMethod()) .addMethod(getMutateRowsMethod()) .addMethod(getCheckAndMutateRowMethod()) + .addMethod(getPingAndWarmMethod()) .addMethod(getReadModifyWriteRowMethod()) + .addMethod(getGenerateInitialChangeStreamPartitionsMethod()) + .addMethod(getReadChangeStreamMethod()) + .addMethod(getPrepareQueryMethod()) + .addMethod(getExecuteQueryMethod()) .build(); } } diff --git a/java.header b/java.header index 3a9b503aa2..d0970ba7d3 100644 --- a/java.header +++ b/java.header @@ -1,5 +1,5 @@ ^/\*$ -^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)( All [rR]ights [rR]eserved\.)?$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ ^ \*$ ^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ ^ \* you may not use this file except in compliance with the License\.$ diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 0000000000..f3f71fd2aa --- /dev/null +++ b/owlbot.py @@ -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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import re +import os.path +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +# Paths are relative to the destination, which is the current working directory +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", +] + +# TODO: try to move the GAPIC surface hiding to the gapic-generator: +# https://github.com/googleapis/gapic-generator/issues/2742 +def make_internal_only(sources): + """Annotates all toplevel classes with `@InternalOnly`""" + # Insert InternalOnly import in the non-static. + s.replace(sources, + before=r'^(import (?!static).*?\n)\n', + after=r'\1import com.google.api.core.InternalApi;\n\n', + flags=re.MULTILINE | re.DOTALL) + + # Replace javadoc and annotations before every public class with InternalApi + # javadoc and annotation + s.replace(sources, + before=r'/\*\*.+?\*/\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) + + # googleapis-gen copy of bigtable has some files that are not part of the existing library. + # owlbot copies them over. If you don't want to keep them, uncomment the deletions below. + 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.move(library) + +s.remove_staging_dirs() + +java.common_templates(excludes=[ + '.gitignore', + '.kokoro/presubmit/integration.cfg', + '.kokoro/presubmit/graalvm-native.cfg', + '.kokoro/presubmit/graalvm-native-17.cfg', + '.kokoro/nightly/integration.cfg', + '.kokoro/presubmit/samples.cfg', + '.kokoro/nightly/samples.cfg', + # todo remove once template is updated + '.github/ISSUE_TEMPLATE/bug_report.md', + '.github/PULL_REQUEST_TEMPLATE.md', + '.github/trusted-contribution.yml', + 'CONTRIBUTING.md', + # exclude autogen + 'codecov.yaml', + # needed for extraFiles + '.github/release-please.yml', + 'renovate.json', + '.kokoro/requirements.in', + '.kokoro/requirements.txt' +]) diff --git a/pom.xml b/pom.xml index 11c0dd825c..533d157503 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 1.20.2-SNAPSHOT + 2.76.0 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -13,8 +13,9 @@ com.google.cloud - google-cloud-shared-config - 0.10.0 + sdk-platform-java-config + 3.59.0 + @@ -129,16 +130,7 @@ https://github.com/googleapis/java-bigtable/issues GitHub Issues - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - + Apache-2.0 @@ -152,36 +144,62 @@ 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.76.0 + + + com.google.api.grpc + proto-google-cloud-bigtable-admin-v2 + 2.76.0 + + + com.google.api.grpc + grpc-google-cloud-bigtable-v2 + 2.76.0 + + + com.google.api.grpc + grpc-google-cloud-bigtable-admin-v2 + 2.76.0 + + + com.google.cloud + google-cloud-bigtable + 2.76.0 + - com.google.cloud - google-cloud-conformance-tests - 0.0.13 - - - - * - * - - + com.google.cloud + google-cloud-conformance-tests + 0.3.7 com.google.truth truth - 1.1.2 + 1.4.4 + + + com.google.truth.extensions + truth-proto-extension + 1.4.4 + + + + com.google.protobuf + protobuf-java + + junit @@ -189,29 +207,16 @@ 4.13.2 - org.mockito - mockito-all - 1.10.19 + org.mockito + mockito-bom + 4.11.0 + pom + import - - - - maven-compiler-plugin - 3.8.1 - - 1.7 - 1.7 - UTF-8 - -Xlint:unchecked - - - - - @@ -225,7 +230,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.2.0 + 3.8.0 aggregate @@ -244,6 +249,7 @@ + none protected true @@ -257,18 +263,8 @@ **/com/google/cloud/bigtable/admin/v2/internal/** - **/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java - **/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java - **/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java - **/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java - **/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java - **/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java - **/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java - **/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java - **/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java - **/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java **/com/google/cloud/bigtable/admin/v2/stub/EnhancedBigtableTableAdminStub.java @@ -284,25 +280,80 @@ **/com/google/cloud/bigtable/data/v2/stub/readrows/** **/com/google/cloud/bigtable/data/v2/stub/metrics/** - - - - https://googleapis.dev/java/gax/${gax.version}/ - https://googleapis.github.io/api-common-java/${google.api-common.version}/apidocs/ - + + + + 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 + + + + + + + + + - proto-google-cloud-bigtable-v2 - grpc-google-cloud-bigtable-v2 - proto-google-cloud-bigtable-admin-v2 - grpc-google-cloud-bigtable-admin-v2 - google-cloud-bigtable - google-cloud-bigtable-emulator - google-cloud-bigtable-bom - google-cloud-bigtable-deps-bom - - + 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/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml b/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml index 696c323a99..6ad718d75f 100644 --- a/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml +++ b/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml @@ -21,4 +21,66 @@ 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/proto-google-cloud-bigtable-admin-v2/pom.xml b/proto-google-cloud-bigtable-admin-v2/pom.xml index 3cbd482fea..21af6fe4e0 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 1.20.2-SNAPSHOT + 2.76.0 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 1.20.2-SNAPSHOT + 2.76.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java index 10fbb9ef5d..bb01b15b95 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.AppProfile} */ -public final class AppProfile extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private AppProfile(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,126 +58,13 @@ private AppProfile() { description_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new AppProfile(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AppProfile( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - etag_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - description_ = s; - break; - } - case 42: - { - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder subBuilder = - null; - if (routingPolicyCase_ == 5) { - subBuilder = - ((com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) - routingPolicy_) - .toBuilder(); - } - routingPolicy_ = - input.readMessage( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) - routingPolicy_); - routingPolicy_ = subBuilder.buildPartial(); - } - routingPolicyCase_ = 5; - break; - } - case 50: - { - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder subBuilder = - null; - if (routingPolicyCase_ == 6) { - subBuilder = - ((com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_) - .toBuilder(); - } - routingPolicy_ = - input.readMessage( - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom( - (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_); - routingPolicy_ = subBuilder.buildPartial(); - } - routingPolicyCase_ = 6; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_AppProfile_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_AppProfile_fieldAccessorTable @@ -172,10 +73,266 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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 {} + 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(); + } + /** * * @@ -189,64 +346,29 @@ public interface MultiClusterRoutingUseAnyOrBuilder * * Protobuf type {@code google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} */ - public static final class MultiClusterRoutingUseAny extends com.google.protobuf.GeneratedMessageV3 + 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; - // Use MultiClusterRoutingUseAny.newBuilder() to construct. - private MultiClusterRoutingUseAny(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private MultiClusterRoutingUseAny() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MultiClusterRoutingUseAny(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MultiClusterRoutingUseAny"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use MultiClusterRoutingUseAny.newBuilder() to construct. + private MultiClusterRoutingUseAny(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private MultiClusterRoutingUseAny( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + private MultiClusterRoutingUseAny() { + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -255,7 +377,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable @@ -264,592 +386,624 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.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; + public interface RowAffinityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + com.google.protobuf.MessageOrBuilder {} - memoizedIsInitialized = 1; - return true; - } + /** + * + * + *
    +     * 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"); + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); - } + // Use RowAffinity.newBuilder() to construct. + private RowAffinity(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private RowAffinity() {} - size = 0; - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.bigtable.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 (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.bigtable.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder( - com.google.bigtable.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.GeneratedMessageV3.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.GeneratedMessageV3.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; + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.class, - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder.class); + 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.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private byte memoizedIsInitialized = -1; - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + memoizedIsInitialized = 1; + return true; } @java.lang.Override - public Builder clear() { - super.clear(); - return this; + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); } @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; + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; } @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance(); + 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 com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny build() { - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - return result; + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; } - @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); - onBuilt(); - return result; + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - @java.lang.Override - public Builder clone() { - return super.clone(); + 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); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + 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); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + 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); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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); } - @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 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 Builder mergeFrom( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other) { - if (other - == com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; + 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); } - @java.lang.Override - public final boolean isInitialized() { - return true; + 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 mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; + 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 final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.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.
    +       * 
    + * + * 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; + } - // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) - private static final com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - DEFAULT_INSTANCE; + @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); + } - static { - DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); - } + // Construct using + // com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.newBuilder() + private Builder() {} - public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + } - 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 { - return new MultiClusterRoutingUseAny(input, extensionRegistry); + @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; + } - public static com.google.protobuf.Parser parser() { - return PARSER; - } + @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 com.google.protobuf.Parser getParserForType() { - return PARSER; + @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; + } } - @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - 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 interface SingleClusterRoutingOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) - com.google.protobuf.MessageOrBuilder { + public static final int CLUSTER_IDS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList clusterIds_ = + com.google.protobuf.LazyStringArrayList.emptyList(); /** * * *
    -     * The cluster to which read/write requests should be routed.
    +     * 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.
          * 
    * - * string cluster_id = 1; + * repeated string cluster_ids = 1; * - * @return The clusterId. + * @return A list containing the clusterIds. */ - java.lang.String getClusterId(); + public com.google.protobuf.ProtocolStringList getClusterIdsList() { + return clusterIds_; + } + /** * * *
    -     * The cluster to which read/write requests should be routed.
    +     * 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.
          * 
    * - * string cluster_id = 1; + * repeated string cluster_ids = 1; * - * @return The bytes for clusterId. + * @return The count of clusterIds. */ - com.google.protobuf.ByteString getClusterIdBytes(); + public int getClusterIdsCount() { + return clusterIds_.size(); + } /** * * *
    -     * 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.
    +     * 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.
          * 
    * - * bool allow_transactional_writes = 2; + * repeated string cluster_ids = 1; * - * @return The allowTransactionalWrites. + * @param index The index of the element to return. + * @return The clusterIds at the given index. */ - 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.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) - SingleClusterRoutingOrBuilder { - private static final long serialVersionUID = 0L; - // Use SingleClusterRouting.newBuilder() to construct. - private SingleClusterRouting(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private SingleClusterRouting() { - clusterId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SingleClusterRouting(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SingleClusterRouting( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - clusterId_ = s; - break; - } - case 16: - { - allowTransactionalWrites_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + public java.lang.String getClusterIds(int index) { + return clusterIds_.get(index); } - 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; + /** + * + * + *
    +     * 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); } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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 ROW_AFFINITY_FIELD_NUMBER = 3; - public static final int CLUSTER_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object clusterId_; /** * * *
    -     * The cluster to which read/write requests should be routed.
    +     * Row affinity sticky routing based on the row key of the request.
    +     * Requests that span multiple rows are routed non-deterministically.
          * 
    * - * string cluster_id = 1; + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * * - * @return The clusterId. + * @return Whether the rowAffinity field is set. */ @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; - } + public boolean hasRowAffinity() { + return affinityCase_ == 3; } + /** * * *
    -     * The cluster to which read/write requests should be routed.
    +     * Row affinity sticky routing based on the row key of the request.
    +     * Requests that span multiple rows are routed non-deterministically.
          * 
    * - * string cluster_id = 1; + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * * - * @return The bytes for clusterId. + * @return The rowAffinity. */ @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 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(); } - public static final int ALLOW_TRANSACTIONAL_WRITES_FIELD_NUMBER = 2; - 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.
    +     * Row affinity sticky routing based on the row key of the request.
    +     * Requests that span multiple rows are routed non-deterministically.
          * 
    * - * bool allow_transactional_writes = 2; - * - * @return The allowTransactionalWrites. + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * */ @java.lang.Override - public boolean getAllowTransactionalWrites() { - return allowTransactionalWrites_; + 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; @@ -866,13 +1020,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getClusterIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clusterId_); + for (int i = 0; i < clusterIds_.size(); i++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, clusterIds_.getRaw(i)); } - if (allowTransactionalWrites_ != false) { - output.writeBool(2, allowTransactionalWrites_); + if (affinityCase_ == 3) { + output.writeMessage( + 3, + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -881,13 +1038,22 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getClusterIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clusterId_); + { + int dataSize = 0; + for (int i = 0; i < clusterIds_.size(); i++) { + dataSize += computeStringSizeNoTag(clusterIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getClusterIdsList().size(); } - if (allowTransactionalWrites_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowTransactionalWrites_); + if (affinityCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -897,15 +1063,22 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting)) { + if (!(obj instanceof com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny)) { return super.equals(obj); } - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting other = - (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) obj; + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other = + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) obj; - if (!getClusterId().equals(other.getClusterId())) return false; - if (getAllowTransactionalWrites() != other.getAllowTransactionalWrites()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + 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; } @@ -916,84 +1089,93 @@ public int hashCode() { } 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) + unknownFields.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.SingleClusterRouting parseFrom( + 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.SingleClusterRouting parseFrom( + 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.SingleClusterRouting parseFrom( + 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.SingleClusterRouting parseFrom( + 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.SingleClusterRouting parseFrom( + 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.SingleClusterRouting parseFrom( + 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.SingleClusterRouting parseFrom( + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } - public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.SingleClusterRouting parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + 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.SingleClusterRouting parseFrom( + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } - public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1007,7 +1189,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting prototype) { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -1017,81 +1199,80 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.
    +     * 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.SingleClusterRouting} + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { + // @@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_SingleClusterRouting_descriptor; + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_fieldAccessorTable + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.class, - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder.class); + 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.SingleClusterRouting.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + // Construct using + // com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); - clusterId_ = ""; - - allowTransactionalWrites_ = false; - + 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_SingleClusterRouting_descriptor; + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; } @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); } @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting build() { - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting result = buildPartial(); + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny build() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1099,72 +1280,73 @@ public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting build() { } @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); - result.clusterId_ = clusterId_; - result.allowTransactionalWrites_ = allowTransactionalWrites_; + 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; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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.SingleClusterRouting) { - return mergeFrom((com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) 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.SingleClusterRouting other) { + public Builder mergeFrom( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other) { if (other - == com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance()) - return this; - if (!other.getClusterId().isEmpty()) { - clusterId_ = other.clusterId_; + == 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(); } - if (other.getAllowTransactionalWrites() != false) { - setAllowTransactionalWrites(other.getAllowTransactionalWrites()); + switch (other.getAffinityCase()) { + case ROW_AFFINITY: + { + mergeRowAffinity(other.getRowAffinity()); + break; + } + case AFFINITY_NOT_SET: + { + break; + } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1179,1842 +1361,5436 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } - private java.lang.Object clusterId_ = ""; + 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 cluster to which read/write requests should be routed.
    +       * 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.
            * 
    * - * string cluster_id = 1; + * repeated string cluster_ids = 1; * - * @return The clusterId. + * @return A list containing the clusterIds. */ - 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; - } + public com.google.protobuf.ProtocolStringList getClusterIdsList() { + clusterIds_.makeImmutable(); + return clusterIds_; } + /** * * *
    -       * The cluster to which read/write requests should be routed.
    +       * 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.
            * 
    * - * string cluster_id = 1; + * repeated string cluster_ids = 1; * - * @return The bytes for clusterId. + * @return The count of clusterIds. */ - 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; - } + public int getClusterIdsCount() { + return clusterIds_.size(); } + /** * * *
    -       * The cluster to which read/write requests should be routed.
    +       * 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.
            * 
    * - * string cluster_id = 1; + * repeated string cluster_ids = 1; * - * @param value The clusterId to set. - * @return This builder for chaining. + * @param index The index of the element to return. + * @return The clusterIds at the given index. */ - public Builder setClusterId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + public java.lang.String getClusterIds(int index) { + return clusterIds_.get(index); + } - clusterId_ = value; - 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 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 cluster to which read/write requests should be routed.
    +       * 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.
            * 
    * - * string cluster_id = 1; + * 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 clearClusterId() { - - clusterId_ = getDefaultInstance().getClusterId(); + 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 cluster to which read/write requests should be routed.
    +       * 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.
            * 
    * - * string cluster_id = 1; + * repeated string cluster_ids = 1; * - * @param value The bytes for clusterId to set. + * @param value The clusterIds to add. * @return This builder for chaining. */ - public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + public Builder addClusterIds(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - - clusterId_ = value; + ensureClusterIdsIsMutable(); + clusterIds_.add(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.
    +       * 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.
            * 
    * - * bool allow_transactional_writes = 2; + * repeated string cluster_ids = 1; * - * @return The allowTransactionalWrites. + * @param values The clusterIds to add. + * @return This builder for chaining. */ - @java.lang.Override - public boolean getAllowTransactionalWrites() { - return allowTransactionalWrites_; + public Builder addAllClusterIds(java.lang.Iterable values) { + ensureClusterIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterIds_); + bitField0_ |= 0x00000001; + 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.
    +       * 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.
            * 
    * - * bool allow_transactional_writes = 2; + * repeated string cluster_ids = 1; * - * @param value The allowTransactionalWrites to set. * @return This builder for chaining. */ - public Builder setAllowTransactionalWrites(boolean value) { - - allowTransactionalWrites_ = value; + public Builder clearClusterIds() { + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; 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.
    +       * 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.
            * 
    * - * bool allow_transactional_writes = 2; + * repeated string cluster_ids = 1; * + * @param value The bytes of the clusterIds to add. * @return This builder for chaining. */ - public Builder clearAllowTransactionalWrites() { - - allowTransactionalWrites_ = false; + 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; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + 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 final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + public boolean hasRowAffinity() { + return affinityCase_ == 3; } - // @@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(); + /** + * + * + *
    +       * 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) } - public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + // @@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() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public SingleClusterRouting parsePartialFrom( + public MultiClusterRoutingUseAny parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SingleClusterRouting(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - private int routingPolicyCase_ = 0; - 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; + public interface SingleClusterRoutingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + com.google.protobuf.MessageOrBuilder { - 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. + * + * + *
    +     * The cluster to which read/write requests should be routed.
    +     * 
    + * + * string cluster_id = 1; + * + * @return The clusterId. */ - @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; - } - } + java.lang.String getClusterId(); - public int getNumber() { - return this.value; - } - }; + /** + * + * + *
    +     * The cluster to which read/write requests should be routed.
    +     * 
    + * + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); - public RoutingPolicyCase getRoutingPolicyCase() { - return RoutingPolicyCase.forNumber(routingPolicyCase_); + /** + * + * + *
    +     * 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(); } - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; /** * * *
    -   * (`OutputOnly`)
    -   * 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]*`.
    +   * Unconditionally routes all read/write requests to a specific cluster.
    +   * This option preserves read-your-writes consistency but does not improve
    +   * availability.
        * 
    * - * string name = 1; - * - * @return The name. + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.SingleClusterRouting} */ - @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; + 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"); } - } - /** - * - * - *
    -   * (`OutputOnly`)
    -   * 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; - 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; + // Use SingleClusterRouting.newBuilder() to construct. + private SingleClusterRouting(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - } - public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; - /** - * - * - *
    -   * Optional 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; - } - } - /** - * - * - *
    -   * Optional 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; + private SingleClusterRouting() { + clusterId_ = ""; } - } - 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_; + 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; } - 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_; + @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); } - return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.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; + public static final int CLUSTER_ID_FIELD_NUMBER = 1; - memoizedIsInitialized = 1; - return true; - } + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!getEtagBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); - } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.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_); + /** + * + * + *
    +     * 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; + } } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + /** + * + * + *
    +     * 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; + } } - if (!getEtagBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + + 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_; } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; } - if (routingPolicyCase_ == 5) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 5, - (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_); + + @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); } - if (routingPolicyCase_ == 6) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 6, (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_); + + @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; } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { + @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; } - if (!(obj instanceof com.google.bigtable.admin.v2.AppProfile)) { - return super.equals(obj); + + @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; } - 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: + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + 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); } - 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: + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - hash = (29 * hash) + unknownFields.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.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 parseFrom( - 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( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - 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.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 parseFrom( - com.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( + 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(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + 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 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 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=421 + * @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=421 + * @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=421 + * @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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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 com.google.bigtable.admin.v2.AppProfile parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + public static 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; + } - public static com.google.bigtable.admin.v2.AppProfile parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } + private java.lang.Object etag_ = ""; - 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.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + /** + * + * + *
    +     * 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; + } + } - public static com.google.bigtable.admin.v2.AppProfile parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + /** + * + * + *
    +     * 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; + } + } - 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.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + /** + * + * + *
    +     * 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; + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + /** + * + * + *
    +     * 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; + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + /** + * + * + *
    +     * 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; + } - public static Builder newBuilder(com.google.bigtable.admin.v2.AppProfile prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + private java.lang.Object description_ = ""; - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + /** + * + * + *
    +     * 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; + } + } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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; + /** + * + * + *
    +     * 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; + } } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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); + /** + * + * + *
    +     * 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; } - // Construct using com.google.bigtable.admin.v2.AppProfile.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * + * + *
    +     * 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; } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * + * + *
    +     * 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 void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } + 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 Builder clear() { - super.clear(); - name_ = ""; - - etag_ = ""; - - description_ = ""; - - routingPolicyCase_ = 0; - routingPolicy_ = null; - return this; + 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.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_AppProfile_descriptor; + 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(); + } } - @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.AppProfile.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; } - @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); + /** + * + * + *
    +     * 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()); } - return result; + routingPolicyCase_ = 5; + return this; } - @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); - result.name_ = name_; - result.etag_ = etag_; - result.description_ = description_; - if (routingPolicyCase_ == 5) { - if (multiClusterRoutingUseAnyBuilder_ == null) { - result.routingPolicy_ = routingPolicy_; + /** + * + * + *
    +     * 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 { - result.routingPolicy_ = multiClusterRoutingUseAnyBuilder_.build(); + routingPolicy_ = value; } - } - if (routingPolicyCase_ == 6) { - if (singleClusterRoutingBuilder_ == null) { - result.routingPolicy_ = routingPolicy_; + onChanged(); + } else { + if (routingPolicyCase_ == 5) { + multiClusterRoutingUseAnyBuilder_.mergeFrom(value); } else { - result.routingPolicy_ = singleClusterRoutingBuilder_.build(); + multiClusterRoutingUseAnyBuilder_.setMessage(value); } } - result.routingPolicyCase_ = routingPolicyCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + routingPolicyCase_ = 5; + return this; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
    +     * 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 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); + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder + getMultiClusterRoutingUseAnyOrBuilder() { + if ((routingPolicyCase_ == 5) && (multiClusterRoutingUseAnyBuilder_ != null)) { + return multiClusterRoutingUseAnyBuilder_.getMessageOrBuilder(); } else { - super.mergeFrom(other); - return this; + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); } } - 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_; - onChanged(); - } - if (!other.getEtag().isEmpty()) { - etag_ = other.etag_; - onChanged(); - } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - 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; - } + /** + * + * + *
    +     * 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; } - this.mergeUnknownFields(other.unknownFields); + routingPolicyCase_ = 5; onChanged(); - return this; + 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 final boolean isInitialized() { - return true; + 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 Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.admin.v2.AppProfile parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.bigtable.admin.v2.AppProfile) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + 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(); } - 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 java.lang.Object name_ = ""; /** * * *
    -     * (`OutputOnly`)
    -     * 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]*`.
    +     * Use a single-cluster routing policy.
          * 
    * - * string name = 1; - * - * @return The name. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - 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; + public Builder setSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting value) { + if (singleClusterRoutingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingPolicy_ = value; + onChanged(); } else { - return (java.lang.String) ref; + singleClusterRoutingBuilder_.setMessage(value); } + routingPolicyCase_ = 6; + return this; } + /** * * *
    -     * (`OutputOnly`)
    -     * 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]*`.
    +     * Use a single-cluster routing policy.
          * 
    * - * string name = 1; - * - * @return The bytes for name. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - 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; + public Builder setSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder builderForValue) { + if (singleClusterRoutingBuilder_ == null) { + routingPolicy_ = builderForValue.build(); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + singleClusterRoutingBuilder_.setMessage(builderForValue.build()); } + routingPolicyCase_ = 6; + return this; } + /** * * *
    -     * (`OutputOnly`)
    -     * 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]*`.
    +     * Use a single-cluster routing policy.
          * 
    * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); + 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; } - /** - * - * - *
    -     * (`OutputOnly`)
    -     * 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(); - onChanged(); - return this; - } /** * * *
    -     * (`OutputOnly`)
    -     * 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]*`.
    +     * Use a single-cluster routing policy.
          * 
    * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearSingleClusterRouting() { + if (singleClusterRoutingBuilder_ == null) { + if (routingPolicyCase_ == 6) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + onChanged(); + } + } else { + if (routingPolicyCase_ == 6) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + } + singleClusterRoutingBuilder_.clear(); } - checkByteStringIsUtf8(value); - - name_ = value; - 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.
    +     * Use a single-cluster routing policy.
          * 
    * - * string etag = 2; - * - * @return The etag. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - 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; - } + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder + getSingleClusterRoutingBuilder() { + return internalGetSingleClusterRoutingFieldBuilder().getBuilder(); } + /** * * *
    -     * 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.
    +     * Use a single-cluster routing policy.
          * 
    * - * string etag = 2; - * - * @return The bytes for etag. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - 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; + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder + getSingleClusterRoutingOrBuilder() { + if ((routingPolicyCase_ == 6) && (singleClusterRoutingBuilder_ != null)) { + return singleClusterRoutingBuilder_.getMessageOrBuilder(); } else { - return (com.google.protobuf.ByteString) ref; + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); } } + /** * * *
    -     * 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.
    +     * Use a single-cluster routing policy.
          * 
    * - * string etag = 2; - * - * @param value The etag to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - public Builder setEtag(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + 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; } - - etag_ = value; + routingPolicyCase_ = 6; onChanged(); - return this; + return singleClusterRoutingBuilder_; } + /** * * *
    -     * 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.
    +     * 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.
          * 
    * - * string etag = 2; + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * - * @return This builder for chaining. + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=421 + * @return Whether the priority field is set. */ - public Builder clearEtag() { - - etag_ = getDefaultInstance().getEtag(); - onChanged(); - return this; + @java.lang.Override + @java.lang.Deprecated + public boolean hasPriority() { + return isolationCase_ == 7; } + /** * * *
    -     * 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.
    +     * 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.
          * 
    * - * string etag = 2; + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * - * @param value The bytes for etag to set. - * @return This builder for chaining. + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=421 + * @return The enum numeric value on the wire for priority. */ - public Builder setEtagBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + @java.lang.Override + @java.lang.Deprecated + public int getPriorityValue() { + if (isolationCase_ == 7) { + return ((java.lang.Integer) isolation_).intValue(); } - checkByteStringIsUtf8(value); - - etag_ = value; - onChanged(); - return this; + return 0; } - private java.lang.Object description_ = ""; /** * * *
    -     * Optional long form description of the use case for this AppProfile.
    +     * 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.
          * 
    * - * string description = 3; + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * - * @return The description. + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=421 + * @param value The enum numeric value on the wire for priority to set. + * @return This builder for chaining. */ - 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; - } + @java.lang.Deprecated + public Builder setPriorityValue(int value) { + isolationCase_ = 7; + isolation_ = value; + onChanged(); + return this; } + /** * * *
    -     * Optional long form description of the use case for this AppProfile.
    +     * 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.
          * 
    * - * string description = 3; + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * - * @return The bytes for description. + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=421 + * @return The priority. */ - 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; + @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; } + /** * * *
    -     * Optional long form description of the use case for this AppProfile.
    +     * 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.
          * 
    * - * string description = 3; + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * - * @param value The description to set. + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=421 + * @param value The priority to set. * @return This builder for chaining. */ - public Builder setDescription(java.lang.String value) { + @java.lang.Deprecated + public Builder setPriority(com.google.bigtable.admin.v2.AppProfile.Priority value) { if (value == null) { throw new NullPointerException(); } - - description_ = value; + isolationCase_ = 7; + isolation_ = value.getNumber(); onChanged(); return this; } - /** - * - * - *
    -     * Optional long form description of the use case for this AppProfile.
    -     * 
    - * - * string description = 3; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; - } /** * * *
    -     * Optional long form description of the use case for this AppProfile.
    +     * 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.
          * 
    * - * string description = 3; + * .google.bigtable.admin.v2.AppProfile.Priority priority = 7 [deprecated = true]; * - * @param value The bytes for description to set. + * @deprecated google.bigtable.admin.v2.AppProfile.priority is deprecated. See + * google/bigtable/admin/v2/instance.proto;l=421 * @return This builder for chaining. */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - description_ = value; - onChanged(); + @java.lang.Deprecated + public Builder clearPriority() { + if (isolationCase_ == 7) { + isolationCase_ = 0; + isolation_ = null; + onChanged(); + } return this; } - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder, - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder> - multiClusterRoutingUseAnyBuilder_; + 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_; + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; * - * @return Whether the multiClusterRoutingUseAny field is set. + * @return Whether the standardIsolation field is set. */ @java.lang.Override - public boolean hasMultiClusterRoutingUseAny() { - return routingPolicyCase_ == 5; + public boolean hasStandardIsolation() { + return isolationCase_ == 11; } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; * - * @return The multiClusterRoutingUseAny. + * @return The standardIsolation. */ @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_; + 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.MultiClusterRoutingUseAny - .getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); } else { - if (routingPolicyCase_ == 5) { - return multiClusterRoutingUseAnyBuilder_.getMessage(); + if (isolationCase_ == 11) { + return standardIsolationBuilder_.getMessage(); } - return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); } } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ - public Builder setMultiClusterRoutingUseAny( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny value) { - if (multiClusterRoutingUseAnyBuilder_ == null) { + public Builder setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation value) { + if (standardIsolationBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - routingPolicy_ = value; + isolation_ = value; onChanged(); } else { - multiClusterRoutingUseAnyBuilder_.setMessage(value); + standardIsolationBuilder_.setMessage(value); } - routingPolicyCase_ = 5; + isolationCase_ = 11; return this; } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ - public Builder setMultiClusterRoutingUseAny( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder builderForValue) { - if (multiClusterRoutingUseAnyBuilder_ == null) { - routingPolicy_ = builderForValue.build(); + public Builder setStandardIsolation( + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder builderForValue) { + if (standardIsolationBuilder_ == null) { + isolation_ = builderForValue.build(); onChanged(); } else { - multiClusterRoutingUseAnyBuilder_.setMessage(builderForValue.build()); + standardIsolationBuilder_.setMessage(builderForValue.build()); } - routingPolicyCase_ = 5; + isolationCase_ = 11; return this; } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ - 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_) + 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 { - routingPolicy_ = value; + isolation_ = value; } onChanged(); } else { - if (routingPolicyCase_ == 5) { - multiClusterRoutingUseAnyBuilder_.mergeFrom(value); + if (isolationCase_ == 11) { + standardIsolationBuilder_.mergeFrom(value); + } else { + standardIsolationBuilder_.setMessage(value); } - multiClusterRoutingUseAnyBuilder_.setMessage(value); } - routingPolicyCase_ = 5; + isolationCase_ = 11; return this; } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ - public Builder clearMultiClusterRoutingUseAny() { - if (multiClusterRoutingUseAnyBuilder_ == null) { - if (routingPolicyCase_ == 5) { - routingPolicyCase_ = 0; - routingPolicy_ = null; + public Builder clearStandardIsolation() { + if (standardIsolationBuilder_ == null) { + if (isolationCase_ == 11) { + isolationCase_ = 0; + isolation_ = null; onChanged(); } } else { - if (routingPolicyCase_ == 5) { - routingPolicyCase_ = 0; - routingPolicy_ = null; + if (isolationCase_ == 11) { + isolationCase_ = 0; + isolation_ = null; } - multiClusterRoutingUseAnyBuilder_.clear(); + standardIsolationBuilder_.clear(); } return this; } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder - getMultiClusterRoutingUseAnyBuilder() { - return getMultiClusterRoutingUseAnyFieldBuilder().getBuilder(); + public com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder + getStandardIsolationBuilder() { + return internalGetStandardIsolationFieldBuilder().getBuilder(); } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder - getMultiClusterRoutingUseAnyOrBuilder() { - if ((routingPolicyCase_ == 5) && (multiClusterRoutingUseAnyBuilder_ != null)) { - return multiClusterRoutingUseAnyBuilder_.getMessageOrBuilder(); + public com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder + getStandardIsolationOrBuilder() { + if ((isolationCase_ == 11) && (standardIsolationBuilder_ != null)) { + return standardIsolationBuilder_.getMessageOrBuilder(); } else { - if (routingPolicyCase_ == 5) { - return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + if (isolationCase_ == 11) { + return (com.google.bigtable.admin.v2.AppProfile.StandardIsolation) isolation_; } - return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); } } + /** * * *
    -     * Use a multi-cluster routing policy.
    +     * The standard options used for isolating this app profile's traffic from
    +     * other use cases.
          * 
    * - * - * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - * + * .google.bigtable.admin.v2.AppProfile.StandardIsolation standard_isolation = 11; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny, - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder, - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder> - getMultiClusterRoutingUseAnyFieldBuilder() { - if (multiClusterRoutingUseAnyBuilder_ == null) { - if (!(routingPolicyCase_ == 5)) { - routingPolicy_ = - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance(); + 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(); } - multiClusterRoutingUseAnyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - 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_, + 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()); - routingPolicy_ = null; + isolation_ = null; } - routingPolicyCase_ = 5; + isolationCase_ = 11; onChanged(); - ; - return multiClusterRoutingUseAnyBuilder_; + return standardIsolationBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting, - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder, - com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder> - singleClusterRoutingBuilder_; + 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_; + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * * - * @return Whether the singleClusterRouting field is set. + * @return Whether the dataBoostIsolationReadOnly field is set. */ @java.lang.Override - public boolean hasSingleClusterRouting() { - return routingPolicyCase_ == 6; + public boolean hasDataBoostIsolationReadOnly() { + return isolationCase_ == 10; } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * * - * @return The singleClusterRouting. + * @return The dataBoostIsolationReadOnly. */ @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_; + 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.SingleClusterRouting.getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); } else { - if (routingPolicyCase_ == 6) { - return singleClusterRoutingBuilder_.getMessage(); + if (isolationCase_ == 10) { + return dataBoostIsolationReadOnlyBuilder_.getMessage(); } - return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); } } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ - public Builder setSingleClusterRouting( - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting value) { - if (singleClusterRoutingBuilder_ == null) { + public Builder setDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly value) { + if (dataBoostIsolationReadOnlyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - routingPolicy_ = value; + isolation_ = value; onChanged(); } else { - singleClusterRoutingBuilder_.setMessage(value); + dataBoostIsolationReadOnlyBuilder_.setMessage(value); } - routingPolicyCase_ = 6; + isolationCase_ = 10; return this; } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ - public Builder setSingleClusterRouting( - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder builderForValue) { - if (singleClusterRoutingBuilder_ == null) { - routingPolicy_ = builderForValue.build(); + public Builder setDataBoostIsolationReadOnly( + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder + builderForValue) { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + isolation_ = builderForValue.build(); onChanged(); } else { - singleClusterRoutingBuilder_.setMessage(builderForValue.build()); + dataBoostIsolationReadOnlyBuilder_.setMessage(builderForValue.build()); } - routingPolicyCase_ = 6; + isolationCase_ = 10; return this; } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ - 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 + 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()) { - routingPolicy_ = - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.newBuilder( - (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_) + isolation_ = + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.newBuilder( + (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + isolation_) .mergeFrom(value) .buildPartial(); } else { - routingPolicy_ = value; + isolation_ = value; } onChanged(); } else { - if (routingPolicyCase_ == 6) { - singleClusterRoutingBuilder_.mergeFrom(value); + if (isolationCase_ == 10) { + dataBoostIsolationReadOnlyBuilder_.mergeFrom(value); + } else { + dataBoostIsolationReadOnlyBuilder_.setMessage(value); } - singleClusterRoutingBuilder_.setMessage(value); } - routingPolicyCase_ = 6; + isolationCase_ = 10; return this; } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ - public Builder clearSingleClusterRouting() { - if (singleClusterRoutingBuilder_ == null) { - if (routingPolicyCase_ == 6) { - routingPolicyCase_ = 0; - routingPolicy_ = null; + public Builder clearDataBoostIsolationReadOnly() { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (isolationCase_ == 10) { + isolationCase_ = 0; + isolation_ = null; onChanged(); } } else { - if (routingPolicyCase_ == 6) { - routingPolicyCase_ = 0; - routingPolicy_ = null; + if (isolationCase_ == 10) { + isolationCase_ = 0; + isolation_ = null; } - singleClusterRoutingBuilder_.clear(); + dataBoostIsolationReadOnlyBuilder_.clear(); } return this; } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ - public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder - getSingleClusterRoutingBuilder() { - return getSingleClusterRoutingFieldBuilder().getBuilder(); + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder + getDataBoostIsolationReadOnlyBuilder() { + return internalGetDataBoostIsolationReadOnlyFieldBuilder().getBuilder(); } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder - getSingleClusterRoutingOrBuilder() { - if ((routingPolicyCase_ == 6) && (singleClusterRoutingBuilder_ != null)) { - return singleClusterRoutingBuilder_.getMessageOrBuilder(); + public com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder + getDataBoostIsolationReadOnlyOrBuilder() { + if ((isolationCase_ == 10) && (dataBoostIsolationReadOnlyBuilder_ != null)) { + return dataBoostIsolationReadOnlyBuilder_.getMessageOrBuilder(); } else { - if (routingPolicyCase_ == 6) { - return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + if (isolationCase_ == 10) { + return (com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) isolation_; } - return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); } } + /** * * *
    -     * Use a single-cluster routing policy.
    +     * Specifies that this app profile is intended for read-only usage via the
    +     * Data Boost feature.
          * 
    * - * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + * .google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly data_boost_isolation_read_only = 10; * */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting, - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder, - com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder> - getSingleClusterRoutingFieldBuilder() { - if (singleClusterRoutingBuilder_ == null) { - if (!(routingPolicyCase_ == 6)) { - routingPolicy_ = - com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + 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(); } - singleClusterRoutingBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - 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_, + 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()); - routingPolicy_ = null; + isolation_ = null; } - routingPolicyCase_ = 6; + isolationCase_ = 10; onChanged(); - ; - return singleClusterRoutingBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + return dataBoostIsolationReadOnlyBuilder_; } // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile) @@ -3038,7 +6814,18 @@ public AppProfile parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AppProfile(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java index f4a4955f71..4bf12b0cc8 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { AppProfileName that = ((AppProfileName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) @@ -211,9 +211,9 @@ public Builder setAppProfile(String appProfile) { } private Builder(AppProfileName appProfileName) { - project = appProfileName.project; - instance = appProfileName.instance; - appProfile = appProfileName.appProfile; + this.project = appProfileName.project; + this.instance = appProfileName.instance; + this.appProfile = appProfileName.appProfile; } public AppProfileName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java index d5b904a185..cc859c4516 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,7 +30,6 @@ public interface AppProfileOrBuilder * * *
    -   * (`OutputOnly`)
        * 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]*`.
        * 
    @@ -37,11 +39,11 @@ public interface AppProfileOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
    -   * (`OutputOnly`)
        * 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]*`.
        * 
    @@ -71,6 +73,7 @@ public interface AppProfileOrBuilder * @return The etag. */ java.lang.String getEtag(); + /** * * @@ -95,7 +98,7 @@ public interface AppProfileOrBuilder * * *
    -   * Optional long form description of the use case for this AppProfile.
    +   * Long form description of the use case for this AppProfile.
        * 
    * * string description = 3; @@ -103,11 +106,12 @@ public interface AppProfileOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * *
    -   * Optional long form description of the use case for this AppProfile.
    +   * Long form description of the use case for this AppProfile.
        * 
    * * string description = 3; @@ -130,6 +134,7 @@ public interface AppProfileOrBuilder * @return Whether the multiClusterRoutingUseAny field is set. */ boolean hasMultiClusterRoutingUseAny(); + /** * * @@ -144,6 +149,7 @@ public interface AppProfileOrBuilder * @return The multiClusterRoutingUseAny. */ com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny getMultiClusterRoutingUseAny(); + /** * * @@ -171,6 +177,7 @@ public interface AppProfileOrBuilder * @return Whether the singleClusterRouting field is set. */ boolean hasSingleClusterRouting(); + /** * * @@ -184,6 +191,7 @@ public interface AppProfileOrBuilder * @return The singleClusterRouting. */ com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting getSingleClusterRouting(); + /** * * @@ -197,5 +205,153 @@ public interface AppProfileOrBuilder com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder getSingleClusterRoutingOrBuilder(); - public com.google.bigtable.admin.v2.AppProfile.RoutingPolicyCase getRoutingPolicyCase(); + /** + * + * + *
    +   * 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=421 + * @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=421 + * @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=421 + * @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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedView.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedView.java new file mode 100644 index 0000000000..585753b1e9 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewName.java new file mode 100644 index 0000000000..47c2d1a75b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewOrBuilder.java new file mode 100644 index 0000000000..ba46de74aa --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimits.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimits.java new file mode 100644 index 0000000000..2bda6d07ff --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java new file mode 100644 index 0000000000..b68006991a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargets.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargets.java new file mode 100644 index 0000000000..c002885620 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java new file mode 100644 index 0000000000..d0f15adb8b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java index 0fa7625c14..c77f088df5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,155 +29,34 @@ * * Protobuf type {@code google.bigtable.admin.v2.Backup} */ -public final class Backup extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Backup(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Backup() { name_ = ""; sourceTable_ = ""; + sourceBackup_ = ""; state_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Backup(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Backup( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - sourceTable_ = s; - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (expireTime_ != null) { - subBuilder = expireTime_.toBuilder(); - } - expireTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(expireTime_); - expireTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 42: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 48: - { - sizeBytes_ = input.readInt64(); - break; - } - case 56: - { - int rawValue = input.readEnum(); - - state_ = rawValue; - break; - } - case 74: - { - com.google.bigtable.admin.v2.EncryptionInfo.Builder subBuilder = null; - if (encryptionInfo_ != null) { - subBuilder = encryptionInfo_.toBuilder(); - } - encryptionInfo_ = - input.readMessage( - com.google.bigtable.admin.v2.EncryptionInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(encryptionInfo_); - encryptionInfo_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + backupType_ = 0; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -184,7 +65,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable @@ -237,6 +118,16 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + /** * * @@ -247,6 +138,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * STATE_UNSPECIFIED = 0; */ public static final int STATE_UNSPECIFIED_VALUE = 0; + /** * * @@ -258,6 +150,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * CREATING = 1; */ public static final int CREATING_VALUE = 1; + /** * * @@ -327,7 +220,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Backup.getDescriptor().getEnumTypes().get(0); } @@ -352,24 +245,208 @@ private State(int 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; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
    -   * Output only. A globally unique identifier for the backup which cannot be
    +   * 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]*`
    +   * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ @@ -385,22 +462,24 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Output only. A globally unique identifier for the backup which cannot be
    +   * 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]*`
    +   * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -418,7 +497,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int SOURCE_TABLE_FIELD_NUMBER = 2; - private volatile java.lang.Object sourceTable_; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceTable_ = ""; + /** * * @@ -446,6 +528,7 @@ public java.lang.String getSourceTable() { return s; } } + /** * * @@ -474,17 +557,79 @@ public com.google.protobuf.ByteString getSourceTableBytes() { } } + 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, with microseconds
    -   * 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.
    +   * 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]; @@ -494,17 +639,20 @@ public com.google.protobuf.ByteString getSourceTableBytes() { */ @java.lang.Override public boolean hasExpireTime() { - return expireTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * *
    -   * Required. The expiration time of the backup, with microseconds
    -   * 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.
    +   * 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]; @@ -516,15 +664,18 @@ public boolean hasExpireTime() { public com.google.protobuf.Timestamp getExpireTime() { return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; } + /** * * *
    -   * Required. The expiration time of the backup, with microseconds
    -   * 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.
    +   * 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]; @@ -532,11 +683,12 @@ public com.google.protobuf.Timestamp getExpireTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { - return getExpireTime(); + return expireTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expireTime_; } public static final int START_TIME_FIELD_NUMBER = 4; private com.google.protobuf.Timestamp startTime_; + /** * * @@ -555,8 +707,9 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -577,6 +730,7 @@ public boolean hasStartTime() { public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } + /** * * @@ -593,11 +747,12 @@ public com.google.protobuf.Timestamp getStartTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp endTime_; + /** * * @@ -613,8 +768,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -632,6 +788,7 @@ public boolean hasEndTime() { public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } + /** * * @@ -645,11 +802,12 @@ public com.google.protobuf.Timestamp getEndTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } public static final int SIZE_BYTES_FIELD_NUMBER = 6; - private long sizeBytes_; + private long sizeBytes_ = 0L; + /** * * @@ -667,7 +825,8 @@ public long getSizeBytes() { } public static final int STATE_FIELD_NUMBER = 7; - private int state_; + private int state_ = 0; + /** * * @@ -685,6 +844,7 @@ public long getSizeBytes() { public int getStateValue() { return state_; } + /** * * @@ -700,14 +860,14 @@ public int getStateValue() { */ @java.lang.Override public com.google.bigtable.admin.v2.Backup.State getState() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Backup.State result = - com.google.bigtable.admin.v2.Backup.State.valueOf(state_); + 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_; + /** * * @@ -723,8 +883,9 @@ public com.google.bigtable.admin.v2.Backup.State getState() { */ @java.lang.Override public boolean hasEncryptionInfo() { - return encryptionInfo_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -736,28 +897,142 @@ public boolean hasEncryptionInfo() { * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * - * @return The encryptionInfo. + * @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.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { - return encryptionInfo_ == null - ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() - : encryptionInfo_; + public com.google.protobuf.Timestamp getHotToStandardTime() { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; } + /** * * *
    -   * Output only. The encryption information for the backup.
    +   * 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.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * .google.protobuf.Timestamp hot_to_standard_time = 12; */ @java.lang.Override - public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { - return getEncryptionInfo(); + public com.google.protobuf.TimestampOrBuilder getHotToStandardTimeOrBuilder() { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; } private byte memoizedIsInitialized = -1; @@ -774,19 +1049,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!getSourceTableBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceTable_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sourceTable_); } - if (expireTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getExpireTime()); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(4, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(5, getEndTime()); } if (sizeBytes_ != 0L) { @@ -795,10 +1070,20 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (state_ != com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED.getNumber()) { output.writeEnum(7, state_); } - if (encryptionInfo_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeMessage(9, getEncryptionInfo()); } - unknownFields.writeTo(output); + 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 @@ -807,19 +1092,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!getSourceTableBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceTable_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sourceTable_); } - if (expireTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getExpireTime()); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndTime()); } if (sizeBytes_ != 0L) { @@ -828,10 +1113,20 @@ public int getSerializedSize() { if (state_ != com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); } - if (encryptionInfo_ != null) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getEncryptionInfo()); } - size += unknownFields.getSerializedSize(); + 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; } @@ -848,6 +1143,7 @@ public boolean equals(final java.lang.Object 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; @@ -866,7 +1162,12 @@ public boolean equals(final java.lang.Object obj) { if (hasEncryptionInfo()) { if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; } - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -881,6 +1182,8 @@ public int hashCode() { 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(); @@ -901,7 +1204,13 @@ public int hashCode() { hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; hash = (53 * hash) + getEncryptionInfo().hashCode(); } - hash = (29 * hash) + unknownFields.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; } @@ -942,38 +1251,38 @@ public static com.google.bigtable.admin.v2.Backup parseFrom( public static com.google.bigtable.admin.v2.Backup parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -996,10 +1305,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1009,7 +1319,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.Backup} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1019,7 +1329,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable @@ -1033,50 +1343,56 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetExpireTimeFieldBuilder(); + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + internalGetEncryptionInfoFieldBuilder(); + internalGetHotToStandardTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - sourceTable_ = ""; - - if (expireTimeBuilder_ == null) { - expireTime_ = null; - } else { - expireTime_ = null; + sourceBackup_ = ""; + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); expireTimeBuilder_ = null; } - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } sizeBytes_ = 0L; - state_ = 0; - - if (encryptionInfoBuilder_ == null) { - encryptionInfo_ = null; - } else { - encryptionInfo_ = null; + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); encryptionInfoBuilder_ = null; } + backupType_ = 0; + hotToStandardTime_ = null; + if (hotToStandardTimeBuilder_ != null) { + hotToStandardTimeBuilder_.dispose(); + hotToStandardTimeBuilder_ = null; + } return this; } @@ -1103,65 +1419,59 @@ public com.google.bigtable.admin.v2.Backup build() { @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); - result.name_ = name_; - result.sourceTable_ = sourceTable_; - if (expireTimeBuilder_ == null) { - result.expireTime_ = expireTime_; - } else { - result.expireTime_ = expireTimeBuilder_.build(); - } - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.sizeBytes_ = sizeBytes_; - result.state_ = state_; - if (encryptionInfoBuilder_ == null) { - result.encryptionInfo_ = encryptionInfo_; - } else { - result.encryptionInfo_ = encryptionInfoBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -1178,10 +1488,17 @@ 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()) { @@ -1202,7 +1519,13 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Backup other) { if (other.hasEncryptionInfo()) { mergeEncryptionInfo(other.getEncryptionInfo()); } - this.mergeUnknownFields(other.unknownFields); + if (other.backupType_ != 0) { + setBackupTypeValue(other.getBackupTypeValue()); + } + if (other.hasHotToStandardTime()) { + mergeHotToStandardTime(other.getHotToStandardTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1217,37 +1540,125 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.Backup parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.Backup) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * *
    -     * Output only. A globally unique identifier for the backup which cannot be
    +     * 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]*`
    +     * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ @@ -1262,22 +1673,24 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
    -     * Output only. A globally unique identifier for the backup which cannot be
    +     * 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]*`
    +     * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -1292,22 +1705,24 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Output only. A globally unique identifier for the backup which cannot be
    +     * 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]*`
    +     * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @param value The name to set. * @return This builder for chaining. @@ -1316,52 +1731,56 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
    -     * Output only. A globally unique identifier for the backup which cannot be
    +     * 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]*`
    +     * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
    -     * Output only. A globally unique identifier for the backup which cannot be
    +     * 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]*`
    +     * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1371,13 +1790,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object sourceTable_ = ""; + /** * * @@ -1404,6 +1824,7 @@ public java.lang.String getSourceTable() { return (java.lang.String) ref; } } + /** * * @@ -1430,6 +1851,7 @@ public com.google.protobuf.ByteString getSourceTableBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1450,11 +1872,12 @@ public Builder setSourceTable(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceTable_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1471,11 +1894,12 @@ public Builder setSourceTable(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSourceTable() { - sourceTable_ = getDefaultInstance().getSourceTable(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1497,27 +1921,156 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { 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.SingleFieldBuilderV3< + 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, with microseconds
    -     * 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.
    +     * 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]; @@ -1526,17 +2079,20 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { * @return Whether the expireTime field is set. */ public boolean hasExpireTime() { - return expireTimeBuilder_ != null || expireTime_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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]; @@ -1553,15 +2109,18 @@ public com.google.protobuf.Timestamp getExpireTime() { return expireTimeBuilder_.getMessage(); } } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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]; @@ -1573,22 +2132,25 @@ public Builder setExpireTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } expireTime_ = value; - onChanged(); } else { expireTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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]; @@ -1597,22 +2159,25 @@ public Builder setExpireTime(com.google.protobuf.Timestamp value) { public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (expireTimeBuilder_ == null) { expireTime_ = builderForValue.build(); - onChanged(); } else { expireTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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]; @@ -1620,72 +2185,83 @@ public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { if (expireTimeBuilder_ == null) { - if (expireTime_ != null) { - expireTime_ = - com.google.protobuf.Timestamp.newBuilder(expireTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && expireTime_ != null + && expireTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getExpireTimeBuilder().mergeFrom(value); } else { expireTime_ = value; } - onChanged(); } else { expireTimeBuilder_.mergeFrom(value); } - + if (expireTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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() { - if (expireTimeBuilder_ == null) { - expireTime_ = null; - onChanged(); - } else { - expireTime_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + expireTime_ = null; + if (expireTimeBuilder_ != null) { + expireTimeBuilder_.dispose(); expireTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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 getExpireTimeFieldBuilder().getBuilder(); + return internalGetExpireTimeFieldBuilder().getBuilder(); } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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]; @@ -1700,28 +2276,31 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { : expireTime_; } } + /** * * *
    -     * Required. The expiration time of the backup, with microseconds
    -     * 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.
    +     * 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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getExpireTimeFieldBuilder() { + internalGetExpireTimeFieldBuilder() { if (expireTimeBuilder_ == null) { expireTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1732,11 +2311,12 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { } private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** * * @@ -1754,8 +2334,9 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { * @return Whether the startTime field is set. */ public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -1779,6 +2360,7 @@ public com.google.protobuf.Timestamp getStartTime() { return startTimeBuilder_.getMessage(); } } + /** * * @@ -1799,13 +2381,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1823,13 +2406,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); - onChanged(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1846,19 +2430,23 @@ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } - onChanged(); } else { startTimeBuilder_.mergeFrom(value); } - + if (startTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -1874,16 +2462,16 @@ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { *
    */ public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1899,10 +2487,11 @@ public Builder clearStartTime() { *
    */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getStartTimeFieldBuilder().getBuilder(); + return internalGetStartTimeFieldBuilder().getBuilder(); } + /** * * @@ -1924,6 +2513,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } + /** * * @@ -1938,14 +2528,14 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * .google.protobuf.Timestamp start_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { + internalGetStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1956,11 +2546,12 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { } private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** * * @@ -1975,8 +2566,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * @return Whether the endTime field is set. */ public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -1997,6 +2589,7 @@ public com.google.protobuf.Timestamp getEndTime() { return endTimeBuilder_.getMessage(); } } + /** * * @@ -2014,13 +2607,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * @@ -2035,13 +2629,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); - onChanged(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * @@ -2055,19 +2650,23 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000020) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } - onChanged(); } else { endTimeBuilder_.mergeFrom(value); } - + if (endTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } return this; } + /** * * @@ -2080,16 +2679,16 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { *
    */ public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; + bitField0_ = (bitField0_ & ~0x00000020); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2102,10 +2701,11 @@ public Builder clearEndTime() { *
    */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000020; onChanged(); - return getEndTimeFieldBuilder().getBuilder(); + return internalGetEndTimeFieldBuilder().getBuilder(); } + /** * * @@ -2124,6 +2724,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } + /** * * @@ -2135,14 +2736,14 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { * .google.protobuf.Timestamp end_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { + internalGetEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -2153,6 +2754,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { } private long sizeBytes_; + /** * * @@ -2168,6 +2770,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { public long getSizeBytes() { return sizeBytes_; } + /** * * @@ -2183,9 +2786,11 @@ public long getSizeBytes() { public Builder setSizeBytes(long value) { sizeBytes_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -2198,13 +2803,14 @@ public Builder setSizeBytes(long value) { * @return This builder for chaining. */ public Builder clearSizeBytes() { - + bitField0_ = (bitField0_ & ~0x00000040); sizeBytes_ = 0L; onChanged(); return this; } private int state_ = 0; + /** * * @@ -2222,6 +2828,7 @@ public Builder clearSizeBytes() { public int getStateValue() { return state_; } + /** * * @@ -2237,11 +2844,12 @@ public int getStateValue() { * @return This builder for chaining. */ public Builder setStateValue(int value) { - state_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } + /** * * @@ -2257,11 +2865,11 @@ public Builder setStateValue(int value) { */ @java.lang.Override public com.google.bigtable.admin.v2.Backup.State getState() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Backup.State result = - com.google.bigtable.admin.v2.Backup.State.valueOf(state_); + com.google.bigtable.admin.v2.Backup.State.forNumber(state_); return result == null ? com.google.bigtable.admin.v2.Backup.State.UNRECOGNIZED : result; } + /** * * @@ -2280,11 +2888,12 @@ 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; } + /** * * @@ -2299,18 +2908,19 @@ public Builder setState(com.google.bigtable.admin.v2.Backup.State value) { * @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.SingleFieldBuilderV3< + 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_; + /** * * @@ -2325,8 +2935,9 @@ public Builder clearState() { * @return Whether the encryptionInfo field is set. */ public boolean hasEncryptionInfo() { - return encryptionInfoBuilder_ != null || encryptionInfo_ != null; + return ((bitField0_ & 0x00000100) != 0); } + /** * * @@ -2349,6 +2960,7 @@ public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { return encryptionInfoBuilder_.getMessage(); } } + /** * * @@ -2366,13 +2978,14 @@ public Builder setEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo val throw new NullPointerException(); } encryptionInfo_ = value; - onChanged(); } else { encryptionInfoBuilder_.setMessage(value); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2388,13 +3001,14 @@ public Builder setEncryptionInfo( com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { if (encryptionInfoBuilder_ == null) { encryptionInfo_ = builderForValue.build(); - onChanged(); } else { encryptionInfoBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * @@ -2408,21 +3022,24 @@ public Builder setEncryptionInfo( */ public Builder mergeEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { if (encryptionInfoBuilder_ == null) { - if (encryptionInfo_ != null) { - encryptionInfo_ = - com.google.bigtable.admin.v2.EncryptionInfo.newBuilder(encryptionInfo_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000100) != 0) + && encryptionInfo_ != null + && encryptionInfo_ + != com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()) { + getEncryptionInfoBuilder().mergeFrom(value); } else { encryptionInfo_ = value; } - onChanged(); } else { encryptionInfoBuilder_.mergeFrom(value); } - + if (encryptionInfo_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } return this; } + /** * * @@ -2435,16 +3052,16 @@ public Builder mergeEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo v *
    */ public Builder clearEncryptionInfo() { - if (encryptionInfoBuilder_ == null) { - encryptionInfo_ = null; - onChanged(); - } else { - encryptionInfo_ = null; + bitField0_ = (bitField0_ & ~0x00000100); + encryptionInfo_ = null; + if (encryptionInfoBuilder_ != null) { + encryptionInfoBuilder_.dispose(); encryptionInfoBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2457,10 +3074,11 @@ public Builder clearEncryptionInfo() { *
    */ public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder() { - + bitField0_ |= 0x00000100; onChanged(); - return getEncryptionInfoFieldBuilder().getBuilder(); + return internalGetEncryptionInfoFieldBuilder().getBuilder(); } + /** * * @@ -2481,6 +3099,7 @@ public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrB : encryptionInfo_; } } + /** * * @@ -2492,14 +3111,14 @@ public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrB * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.EncryptionInfo, com.google.bigtable.admin.v2.EncryptionInfo.Builder, com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> - getEncryptionInfoFieldBuilder() { + internalGetEncryptionInfoFieldBuilder() { if (encryptionInfoBuilder_ == null) { encryptionInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.EncryptionInfo, com.google.bigtable.admin.v2.EncryptionInfo.Builder, com.google.bigtable.admin.v2.EncryptionInfoOrBuilder>( @@ -2509,15 +3128,356 @@ public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrB 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 final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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 final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + 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) @@ -2541,7 +3501,18 @@ public Backup parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Backup(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java index 62868b8c9a..070bffc478 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,111 +29,32 @@ * * Protobuf type {@code google.bigtable.admin.v2.BackupInfo} */ -public final class BackupInfo extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private BackupInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private BackupInfo() { backup_ = ""; sourceTable_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new BackupInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private BackupInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - backup_ = s; - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - sourceTable_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + sourceBackup_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -140,7 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable @@ -149,8 +72,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.BackupInfo.Builder.class); } + private int bitField0_; public static final int BACKUP_FIELD_NUMBER = 1; - private volatile java.lang.Object backup_; + + @SuppressWarnings("serial") + private volatile java.lang.Object backup_ = ""; + /** * * @@ -174,6 +101,7 @@ public java.lang.String getBackup() { return s; } } + /** * * @@ -200,6 +128,7 @@ public com.google.protobuf.ByteString getBackupBytes() { public static final int START_TIME_FIELD_NUMBER = 2; private com.google.protobuf.Timestamp startTime_; + /** * * @@ -215,8 +144,9 @@ public com.google.protobuf.ByteString getBackupBytes() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -234,6 +164,7 @@ public boolean hasStartTime() { public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } + /** * * @@ -247,11 +178,12 @@ public com.google.protobuf.Timestamp getStartTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp endTime_; + /** * * @@ -267,8 +199,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -286,6 +219,7 @@ public boolean hasEndTime() { public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } + /** * * @@ -299,11 +233,14 @@ public com.google.protobuf.Timestamp getEndTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } public static final int SOURCE_TABLE_FIELD_NUMBER = 4; - private volatile java.lang.Object sourceTable_; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceTable_ = ""; + /** * * @@ -327,6 +264,7 @@ public java.lang.String getSourceTable() { return s; } } + /** * * @@ -351,6 +289,65 @@ public com.google.protobuf.ByteString getSourceTableBytes() { } } + 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 @@ -365,19 +362,22 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getBackupBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, backup_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, backup_); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getEndTime()); } - if (!getSourceTableBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sourceTable_); + 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_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -386,19 +386,22 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getBackupBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, backup_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, backup_); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); } - if (!getSourceTableBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sourceTable_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, sourceTable_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(10, sourceBackup_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -423,7 +426,8 @@ public boolean equals(final java.lang.Object obj) { if (!getEndTime().equals(other.getEndTime())) return false; } if (!getSourceTable().equals(other.getSourceTable())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getSourceBackup().equals(other.getSourceBackup())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -446,7 +450,9 @@ public int hashCode() { } hash = (37 * hash) + SOURCE_TABLE_FIELD_NUMBER; hash = (53 * hash) + getSourceTable().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (37 * hash) + SOURCE_BACKUP_FIELD_NUMBER; + hash = (53 * hash) + getSourceBackup().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -488,38 +494,38 @@ public static com.google.bigtable.admin.v2.BackupInfo parseFrom( public static com.google.bigtable.admin.v2.BackupInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -542,10 +548,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -555,7 +562,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.BackupInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -565,7 +572,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable @@ -579,34 +586,35 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; backup_ = ""; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } sourceTable_ = ""; - + sourceBackup_ = ""; return this; } @@ -634,53 +642,34 @@ public com.google.bigtable.admin.v2.BackupInfo build() { public com.google.bigtable.admin.v2.BackupInfo buildPartial() { com.google.bigtable.admin.v2.BackupInfo result = new com.google.bigtable.admin.v2.BackupInfo(this); - result.backup_ = backup_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.sourceTable_ = sourceTable_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -697,6 +686,7 @@ 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()) { @@ -707,9 +697,15 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.BackupInfo other) { } if (!other.getSourceTable().isEmpty()) { sourceTable_ = other.sourceTable_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getSourceBackup().isEmpty()) { + sourceBackup_ = other.sourceBackup_; + bitField0_ |= 0x00000010; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -724,21 +720,69 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.BackupInfo parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.BackupInfo) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object backup_ = ""; + /** * * @@ -761,6 +805,7 @@ public java.lang.String getBackup() { return (java.lang.String) ref; } } + /** * * @@ -783,6 +828,7 @@ public com.google.protobuf.ByteString getBackupBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -799,11 +845,12 @@ public Builder setBackup(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - backup_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -816,11 +863,12 @@ public Builder setBackup(java.lang.String value) { * @return This builder for chaining. */ public Builder clearBackup() { - backup_ = getDefaultInstance().getBackup(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -838,18 +886,19 @@ public Builder setBackupBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - backup_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** * * @@ -864,8 +913,9 @@ public Builder setBackupBytes(com.google.protobuf.ByteString value) { * @return Whether the startTime field is set. */ public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -886,6 +936,7 @@ public com.google.protobuf.Timestamp getStartTime() { return startTimeBuilder_.getMessage(); } } + /** * * @@ -903,13 +954,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -924,13 +976,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); - onChanged(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -944,19 +997,23 @@ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } - onChanged(); } else { startTimeBuilder_.mergeFrom(value); } - + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -969,16 +1026,16 @@ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { * */ public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -991,10 +1048,11 @@ public Builder clearStartTime() { * */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getStartTimeFieldBuilder().getBuilder(); + return internalGetStartTimeFieldBuilder().getBuilder(); } + /** * * @@ -1013,6 +1071,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } + /** * * @@ -1024,14 +1083,14 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * .google.protobuf.Timestamp start_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { + internalGetStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1042,11 +1101,12 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { } private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** * * @@ -1061,8 +1121,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * @return Whether the endTime field is set. */ public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1083,6 +1144,7 @@ public com.google.protobuf.Timestamp getEndTime() { return endTimeBuilder_.getMessage(); } } + /** * * @@ -1100,13 +1162,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1121,13 +1184,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); - onChanged(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1141,19 +1205,23 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } - onChanged(); } else { endTimeBuilder_.mergeFrom(value); } - + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1166,16 +1234,16 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { * */ public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1188,10 +1256,11 @@ public Builder clearEndTime() { * */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getEndTimeFieldBuilder().getBuilder(); + return internalGetEndTimeFieldBuilder().getBuilder(); } + /** * * @@ -1210,6 +1279,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } + /** * * @@ -1221,14 +1291,14 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { * .google.protobuf.Timestamp end_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { + internalGetEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1239,6 +1309,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { } private java.lang.Object sourceTable_ = ""; + /** * * @@ -1261,6 +1332,7 @@ public java.lang.String getSourceTable() { return (java.lang.String) ref; } } + /** * * @@ -1283,6 +1355,7 @@ public com.google.protobuf.ByteString getSourceTableBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1299,11 +1372,12 @@ public Builder setSourceTable(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceTable_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1316,11 +1390,12 @@ public Builder setSourceTable(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSourceTable() { - sourceTable_ = getDefaultInstance().getSourceTable(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1338,21 +1413,136 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sourceTable_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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; + } } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -1376,7 +1566,18 @@ public BackupInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new BackupInfo(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java index 2f255fd08f..740dc7228f 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface BackupInfoOrBuilder * @return The backup. */ java.lang.String getBackup(); + /** * * @@ -62,6 +66,7 @@ public interface BackupInfoOrBuilder * @return Whether the startTime field is set. */ boolean hasStartTime(); + /** * * @@ -76,6 +81,7 @@ public interface BackupInfoOrBuilder * @return The startTime. */ com.google.protobuf.Timestamp getStartTime(); + /** * * @@ -103,6 +109,7 @@ public interface BackupInfoOrBuilder * @return Whether the endTime field is set. */ boolean hasEndTime(); + /** * * @@ -117,6 +124,7 @@ public interface BackupInfoOrBuilder * @return The endTime. */ com.google.protobuf.Timestamp getEndTime(); + /** * * @@ -142,6 +150,7 @@ public interface BackupInfoOrBuilder * @return The sourceTable. */ java.lang.String getSourceTable(); + /** * * @@ -154,4 +163,36 @@ public interface BackupInfoOrBuilder * @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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java index 25c72d0469..9899f0aad2 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -174,7 +174,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { BackupName that = ((BackupName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) @@ -244,10 +244,10 @@ public Builder setBackup(String backup) { } private Builder(BackupName backupName) { - project = backupName.project; - instance = backupName.instance; - cluster = backupName.cluster; - backup = backupName.backup; + this.project = backupName.project; + this.instance = backupName.instance; + this.cluster = backupName.cluster; + this.backup = backupName.backup; } public BackupName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java index 2e31e823c0..d41f103a66 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,38 +30,41 @@ public interface BackupOrBuilder * * *
    -   * Output only. A globally unique identifier for the backup which cannot be
    +   * 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]*`
    +   * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ java.lang.String getName(); + /** * * *
    -   * Output only. A globally unique identifier for the backup which cannot be
    +   * 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]*`
    +   * 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -80,6 +86,7 @@ public interface BackupOrBuilder * @return The sourceTable. */ java.lang.String getSourceTable(); + /** * * @@ -101,11 +108,45 @@ public interface BackupOrBuilder * * *
    -   * Required. The expiration time of the backup, with microseconds
    -   * 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.
    +   * 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]; @@ -114,15 +155,18 @@ public interface BackupOrBuilder * @return Whether the expireTime field is set. */ boolean hasExpireTime(); + /** * * *
    -   * Required. The expiration time of the backup, with microseconds
    -   * 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.
    +   * 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]; @@ -131,15 +175,18 @@ public interface BackupOrBuilder * @return The expireTime. */ com.google.protobuf.Timestamp getExpireTime(); + /** * * *
    -   * Required. The expiration time of the backup, with microseconds
    -   * 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.
    +   * 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]; @@ -164,6 +211,7 @@ public interface BackupOrBuilder * @return Whether the startTime field is set. */ boolean hasStartTime(); + /** * * @@ -181,6 +229,7 @@ public interface BackupOrBuilder * @return The startTime. */ com.google.protobuf.Timestamp getStartTime(); + /** * * @@ -211,6 +260,7 @@ public interface BackupOrBuilder * @return Whether the endTime field is set. */ boolean hasEndTime(); + /** * * @@ -225,6 +275,7 @@ public interface BackupOrBuilder * @return The endTime. */ com.google.protobuf.Timestamp getEndTime(); + /** * * @@ -265,6 +316,7 @@ public interface BackupOrBuilder * @return The enum numeric value on the wire for state. */ int getStateValue(); + /** * * @@ -294,6 +346,7 @@ public interface BackupOrBuilder * @return Whether the encryptionInfo field is set. */ boolean hasEncryptionInfo(); + /** * * @@ -308,6 +361,7 @@ public interface BackupOrBuilder * @return The encryptionInfo. */ com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(); + /** * * @@ -320,4 +374,88 @@ public interface BackupOrBuilder * */ 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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java index 0969a2efd3..7d1bf5db90 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class BigtableInstanceAdminProto { +@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) { @@ -29,96 +42,184 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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; @@ -147,63 +248,84 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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\"L\n\022GetInstanceRequ" - + "est\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n bigtable.goog" - + "leapis.com/Instance\"o\n\024ListInstancesRequ" - + "est\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudresour" - + "cemanager.googleapis.com/Project\022\022\n\npage" - + "_token\030\002 \001(\t\"\201\001\n\025ListInstancesResponse\0225" - + "\n\tinstances\030\001 \003(\0132\".google.bigtable.admi" - + "n.v2.Instance\022\030\n\020failed_locations\030\002 \003(\t\022" - + "\027\n\017next_page_token\030\003 \001(\t\"\217\001\n\034PartialUpda" - + "teInstanceRequest\0229\n\010instance\030\001 \001(\0132\".go" - + "ogle.bigtable.admin.v2.InstanceB\003\340A\002\0224\n\013" - + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" - + "dMaskB\003\340A\002\"O\n\025DeleteInstanceRequest\0226\n\004n" - + "ame\030\001 \001(\tB(\340A\002\372A\"\n bigtable.googleapis.c" - + "om/Instance\"\242\001\n\024CreateClusterRequest\0228\n\006" - + "parent\030\001 \001(\tB(\340A\002\372A\"\n bigtable.googleapi" - + "s.com/Instance\022\027\n\ncluster_id\030\002 \001(\tB\003\340A\002\022" - + "7\n\007cluster\030\003 \001(\0132!.google.bigtable.admin" - + ".v2.ClusterB\003\340A\002\"J\n\021GetClusterRequest\0225\n" - + "\004name\030\001 \001(\tB\'\340A\002\372A!\n\037bigtable.googleapis" - + ".com/Cluster\"c\n\023ListClustersRequest\0228\n\006p" - + "arent\030\001 \001(\tB(\340A\002\372A\"\n bigtable.googleapis" - + ".com/Instance\022\022\n\npage_token\030\002 \001(\t\"~\n\024Lis" - + "tClustersResponse\0223\n\010clusters\030\001 \003(\0132!.go" - + "ogle.bigtable.admin.v2.Cluster\022\030\n\020failed" - + "_locations\030\002 \003(\t\022\027\n\017next_page_token\030\003 \001(" - + "\t\"M\n\024DeleteClusterRequest\0225\n\004name\030\001 \001(\tB" - + "\'\340A\002\372A!\n\037bigtable.googleapis.com/Cluster" - + "\"\306\001\n\026CreateInstanceMetadata\022I\n\020original_" - + "request\030\001 \001(\0132/.google.bigtable.admin.v2" - + ".CreateInstanceRequest\0220\n\014request_time\030\002" - + " \001(\0132\032.google.protobuf.Timestamp\022/\n\013fini" - + "sh_time\030\003 \001(\0132\032.google.protobuf.Timestam" - + "p\"\315\001\n\026UpdateInstanceMetadata\022P\n\020original" - + "_request\030\001 \001(\01326.google.bigtable.admin.v" - + "2.PartialUpdateInstanceRequest\0220\n\014reques" - + "t_time\030\002 \001(\0132\032.google.protobuf.Timestamp" - + "\022/\n\013finish_time\030\003 \001(\0132\032.google.protobuf." - + "Timestamp\"\304\001\n\025CreateClusterMetadata\022H\n\020o" - + "riginal_request\030\001 \001(\0132..google.bigtable." - + "admin.v2.CreateClusterRequest\0220\n\014request" - + "_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022" - + "/\n\013finish_time\030\003 \001(\0132\032.google.protobuf.T" - + "imestamp\"\267\001\n\025UpdateClusterMetadata\022;\n\020or" - + "iginal_request\030\001 \001(\0132!.google.bigtable.a" - + "dmin.v2.Cluster\0220\n\014request_time\030\002 \001(\0132\032." - + "google.protobuf.Timestamp\022/\n\013finish_time" - + "\030\003 \001(\0132\032.google.protobuf.Timestamp\"\311\001\n\027C" - + "reateAppProfileRequest\0228\n\006parent\030\001 \001(\tB(" - + "\340A\002\372A\"\n bigtable.googleapis.com/Instance" - + "\022\033\n\016app_profile_id\030\002 \001(\tB\003\340A\002\022>\n\013app_pro" - + "file\030\003 \001(\0132$.google.bigtable.admin.v2.Ap" - + "pProfileB\003\340A\002\022\027\n\017ignore_warnings\030\004 \001(\010\"P" - + "\n\024GetAppProfileRequest\0228\n\004name\030\001 \001(\tB*\340A" - + "\002\372A$\n\"bigtable.googleapis.com/AppProfile" - + "\"y\n\026ListAppProfilesRequest\0228\n\006parent\030\001 \001" - + "(\tB(\340A\002\372A\"\n bigtable.googleapis.com/Inst" + + ".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" @@ -212,113 +334,263 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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\"q\n\027Del" - + "eteAppProfileRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372" - + "A$\n\"bigtable.googleapis.com/AppProfile\022\034" - + "\n\017ignore_warnings\030\002 \001(\010B\003\340A\002\"\032\n\030UpdateAp" - + "pProfileMetadata2\222\036\n\025BigtableInstanceAdm" - + "in\022\332\001\n\016CreateInstance\022/.google.bigtable." - + "admin.v2.CreateInstanceRequest\032\035.google." - + "longrunning.Operation\"x\202\323\344\223\002&\"!/v2/{pare" - + "nt=projects/*}/instances:\001*\332A$parent,ins" - + "tance_id,instance,clusters\312A\"\n\010Instance\022" - + "\026CreateInstanceMetadata\022\221\001\n\013GetInstance\022" - + ",.google.bigtable.admin.v2.GetInstanceRe" - + "quest\032\".google.bigtable.admin.v2.Instanc" - + "e\"0\202\323\344\223\002#\022!/v2/{name=projects/*/instance" - + "s/*}\332A\004name\022\244\001\n\rListInstances\022..google.b" - + "igtable.admin.v2.ListInstancesRequest\032/." - + "google.bigtable.admin.v2.ListInstancesRe" - + "sponse\"2\202\323\344\223\002#\022!/v2/{parent=projects/*}/" - + "instances\332A\006parent\022\206\001\n\016UpdateInstance\022\"." - + "google.bigtable.admin.v2.Instance\032\".goog" - + "le.bigtable.admin.v2.Instance\",\202\323\344\223\002&\032!/" - + "v2/{name=projects/*/instances/*}:\001*\022\350\001\n\025" - + "PartialUpdateInstance\0226.google.bigtable." - + "admin.v2.PartialUpdateInstanceRequest\032\035." - + "google.longrunning.Operation\"x\202\323\344\223\00262*/v" - + "2/{instance.name=projects/*/instances/*}" - + ":\010instance\332A\024instance,update_mask\312A\"\n\010In" - + "stance\022\026UpdateInstanceMetadata\022\213\001\n\016Delet" - + "eInstance\022/.google.bigtable.admin.v2.Del" - + "eteInstanceRequest\032\026.google.protobuf.Emp" - + "ty\"0\202\323\344\223\002#*!/v2/{name=projects/*/instanc" - + "es/*}\332A\004name\022\334\001\n\rCreateCluster\022..google." - + "bigtable.admin.v2.CreateClusterRequest\032\035" - + ".google.longrunning.Operation\"|\202\323\344\223\0027\",/" - + "v2/{parent=projects/*/instances/*}/clust" - + "ers:\007cluster\332A\031parent,cluster_id,cluster" - + "\312A \n\007Cluster\022\025CreateClusterMetadata\022\231\001\n\n" - + "GetCluster\022+.google.bigtable.admin.v2.Ge" - + "tClusterRequest\032!.google.bigtable.admin." - + "v2.Cluster\";\202\323\344\223\002.\022,/v2/{name=projects/*" - + "/instances/*/clusters/*}\332A\004name\022\254\001\n\014List" - + "Clusters\022-.google.bigtable.admin.v2.List" - + "ClustersRequest\032..google.bigtable.admin." - + "v2.ListClustersResponse\"=\202\323\344\223\002.\022,/v2/{pa" - + "rent=projects/*/instances/*}/clusters\332A\006" - + "parent\022\255\001\n\rUpdateCluster\022!.google.bigtab" - + "le.admin.v2.Cluster\032\035.google.longrunning" - + ".Operation\"Z\202\323\344\223\0021\032,/v2/{name=projects/*" - + "/instances/*/clusters/*}:\001*\312A \n\007Cluster\022" - + "\025UpdateClusterMetadata\022\224\001\n\rDeleteCluster" - + "\022..google.bigtable.admin.v2.DeleteCluste" - + "rRequest\032\026.google.protobuf.Empty\";\202\323\344\223\002." - + "*,/v2/{name=projects/*/instances/*/clust" - + "ers/*}\332A\004name\022\325\001\n\020CreateAppProfile\0221.goo" - + "gle.bigtable.admin.v2.CreateAppProfileRe" - + "quest\032$.google.bigtable.admin.v2.AppProf" - + "ile\"h\202\323\344\223\002>\"//v2/{parent=projects/*/inst" - + "ances/*}/appProfiles:\013app_profile\332A!pare" - + "nt,app_profile_id,app_profile\022\245\001\n\rGetApp" - + "Profile\022..google.bigtable.admin.v2.GetAp" - + "pProfileRequest\032$.google.bigtable.admin." - + "v2.AppProfile\">\202\323\344\223\0021\022//v2/{name=project" - + "s/*/instances/*/appProfiles/*}\332A\004name\022\270\001" - + "\n\017ListAppProfiles\0220.google.bigtable.admi" - + "n.v2.ListAppProfilesRequest\0321.google.big" - + "table.admin.v2.ListAppProfilesResponse\"@" - + "\202\323\344\223\0021\022//v2/{parent=projects/*/instances" - + "/*}/appProfiles\332A\006parent\022\372\001\n\020UpdateAppPr" - + "ofile\0221.google.bigtable.admin.v2.UpdateA" - + "ppProfileRequest\032\035.google.longrunning.Op" - + "eration\"\223\001\202\323\344\223\002J2;/v2/{app_profile.name=" - + "projects/*/instances/*/appProfiles/*}:\013a" - + "pp_profile\332A\027app_profile,update_mask\312A&\n" - + "\nAppProfile\022\030UpdateAppProfileMetadata\022\235\001" - + "\n\020DeleteAppProfile\0221.google.bigtable.adm" - + "in.v2.DeleteAppProfileRequest\032\026.google.p" - + "rotobuf.Empty\">\202\323\344\223\0021*//v2/{name=project" - + "s/*/instances/*/appProfiles/*}\332A\004name\022\223\001" - + "\n\014GetIamPolicy\022\".google.iam.v1.GetIamPol" - + "icyRequest\032\025.google.iam.v1.Policy\"H\202\323\344\223\002" - + "7\"2/v2/{resource=projects/*/instances/*}" - + ":getIamPolicy:\001*\332A\010resource\022\232\001\n\014SetIamPo" - + "licy\022\".google.iam.v1.SetIamPolicyRequest" - + "\032\025.google.iam.v1.Policy\"O\202\323\344\223\0027\"2/v2/{re" - + "source=projects/*/instances/*}:setIamPol" - + "icy:\001*\332A\017resource,policy\022\305\001\n\022TestIamPerm" - + "issions\022(.google.iam.v1.TestIamPermissio" - + "nsRequest\032).google.iam.v1.TestIamPermiss" - + "ionsResponse\"Z\202\323\344\223\002=\"8/v2/{resource=proj" - + "ects/*/instances/*}:testIamPermissions:\001" - + "*\332A\024resource,permissions\032\232\003\312A\034bigtablead" - + "min.googleapis.com\322A\367\002https://www.google" - + "apis.com/auth/bigtable.admin,https://www" - + ".googleapis.com/auth/bigtable.admin.clus" - + "ter,https://www.googleapis.com/auth/bigt" - + "able.admin.instance,https://www.googleap" - + "is.com/auth/cloud-bigtable.admin,https:/" - + "/www.googleapis.com/auth/cloud-bigtable." - + "admin.cluster,https://www.googleapis.com" - + "/auth/cloud-platform,https://www.googlea" - + "pis.com/auth/cloud-platform.read-onlyB\342\001" - + "\n\034com.google.bigtable.admin.v2B\032Bigtable" - + "InstanceAdminProtoP\001Z=google.golang.org/" - + "genproto/googleapis/bigtable/admin/v2;ad" - + "min\252\002\036Google.Cloud.Bigtable.Admin.V2\312\002\036G" - + "oogle\\Cloud\\Bigtable\\Admin\\V2\352\002\"Google::" - + "Cloud::Bigtable::Admin::V2b\006proto3" + + "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( @@ -337,200 +609,364 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor = - getDescriptor().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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 - .getNestedTypes() - .get(0); + internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor.getNestedType(0); internal_static_google_bigtable_admin_v2_CreateInstanceRequest_ClustersEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(1); + getDescriptor().getMessageType(1); internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(3); + getDescriptor().getMessageType(3); internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(4); + getDescriptor().getMessageType(4); internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(5); + getDescriptor().getMessageType(5); internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(6); + getDescriptor().getMessageType(6); internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(7); + getDescriptor().getMessageType(7); internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(8); + getDescriptor().getMessageType(8); internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(9); + getDescriptor().getMessageType(9); internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(10); + getDescriptor().getMessageType(10); internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(11); + getDescriptor().getMessageType(11); internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(12); + getDescriptor().getMessageType(12); internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(13); + getDescriptor().getMessageType(13); internal_static_google_bigtable_admin_v2_CreateClusterMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor, new java.lang.String[] { - "OriginalRequest", "RequestTime", "FinishTime", + "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().getMessageTypes().get(14); + getDescriptor().getMessageType(14); internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(15); + getDescriptor().getMessageType(17); internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(16); + getDescriptor().getMessageType(18); internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(17); + getDescriptor().getMessageType(19); internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(18); + getDescriptor().getMessageType(20); internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(19); + getDescriptor().getMessageType(21); internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(20); + getDescriptor().getMessageType(22); internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(21); + getDescriptor().getMessageType(23); internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor, new java.lang.String[] {}); - 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); + 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(); @@ -542,6 +978,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor 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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java index 8c8bc4b006..dad424b055 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class BigtableTableAdminProto { +@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) { @@ -29,128 +42,224 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_RestoreTableRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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; @@ -160,7 +269,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n3google/bigtable/admin/v2/bigtable_tabl" + "\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" @@ -169,239 +279,430 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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/pr" - + "otobuf/field_mask.proto\032\037google/protobuf" - + "/timestamp.proto\"\247\001\n\023RestoreTableRequest" - + "\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\n bigtable.googl" - + "eapis.com/Instance\022\025\n\010table_id\030\002 \001(\tB\003\340A" - + "\002\0225\n\006backup\030\003 \001(\tB#\372A \n\036bigtable.googlea" - + "pis.com/BackupH\000B\010\n\006source\"\230\002\n\024RestoreTa" - + "bleMetadata\022\014\n\004name\030\001 \001(\t\022@\n\013source_type" - + "\030\002 \001(\0162+.google.bigtable.admin.v2.Restor" - + "eSourceType\022;\n\013backup_info\030\003 \001(\0132$.googl" - + "e.bigtable.admin.v2.BackupInfoH\000\022%\n\035opti" - + "mize_table_operation_name\030\004 \001(\t\022=\n\010progr" - + "ess\030\005 \001(\0132+.google.bigtable.admin.v2.Ope" - + "rationProgressB\r\n\013source_info\"l\n\035Optimiz" - + "eRestoredTableMetadata\022\014\n\004name\030\001 \001(\t\022=\n\010" - + "progress\030\002 \001(\0132+.google.bigtable.admin.v" - + "2.OperationProgress\"\374\001\n\022CreateTableReque" - + "st\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\n bigtable.goo" - + "gleapis.com/Instance\022\025\n\010table_id\030\002 \001(\tB\003" - + "\340A\002\0223\n\005table\030\003 \001(\0132\037.google.bigtable.adm" - + "in.v2.TableB\003\340A\002\022J\n\016initial_splits\030\004 \003(\013" - + "22.google.bigtable.admin.v2.CreateTableR" - + "equest.Split\032\024\n\005Split\022\013\n\003key\030\001 \001(\014\"\264\001\n\036C" - + "reateTableFromSnapshotRequest\0228\n\006parent\030" - + "\001 \001(\tB(\340A\002\372A\"\n bigtable.googleapis.com/I" - + "nstance\022\025\n\010table_id\030\002 \001(\tB\003\340A\002\022A\n\017source" - + "_snapshot\030\003 \001(\tB(\340A\002\372A\"\n bigtable.google" - + "apis.com/Snapshot\"\224\001\n\023DropRowRangeReques" - + "t\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtable.google" - + "apis.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\"\250\001\n\021ListTablesRequest\0228\n\006parent" - + "\030\001 \001(\tB(\340A\002\372A\"\n bigtable.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\npage_token\030\003 \001(\t\"^\n\022ListTablesRespons" - + "e\022/\n\006tables\030\001 \003(\0132\037.google.bigtable.admi" - + "n.v2.Table\022\027\n\017next_page_token\030\002 \001(\t\"z\n\017G" - + "etTableRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035bi" - + "gtable.googleapis.com/Table\0222\n\004view\030\002 \001(" - + "\0162$.google.bigtable.admin.v2.Table.View\"" - + "I\n\022DeleteTableRequest\0223\n\004name\030\001 \001(\tB%\340A\002" - + "\372A\037\n\035bigtable.googleapis.com/Table\"\332\002\n\033M" - + "odifyColumnFamiliesRequest\0223\n\004name\030\001 \001(\t" - + "B%\340A\002\372A\037\n\035bigtable.googleapis.com/Table\022" - + "^\n\rmodifications\030\002 \003(\0132B.google.bigtable" - + ".admin.v2.ModifyColumnFamiliesRequest.Mo" - + "dificationB\003\340A\002\032\245\001\n\014Modification\022\n\n\002id\030\001" - + " \001(\t\0228\n\006create\030\002 \001(\0132&.google.bigtable.a" - + "dmin.v2.ColumnFamilyH\000\0228\n\006update\030\003 \001(\0132&" - + ".google.bigtable.admin.v2.ColumnFamilyH\000" - + "\022\016\n\004drop\030\004 \001(\010H\000B\005\n\003mod\"V\n\037GenerateConsi" - + "stencyTokenRequest\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037" - + "\n\035bigtable.googleapis.com/Table\"=\n Gener" - + "ateConsistencyTokenResponse\022\031\n\021consisten" - + "cy_token\030\001 \001(\t\"n\n\027CheckConsistencyReques" - + "t\0223\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtable.google" - + "apis.com/Table\022\036\n\021consistency_token\030\002 \001(" - + "\tB\003\340A\002\".\n\030CheckConsistencyResponse\022\022\n\nco" - + "nsistent\030\001 \001(\010\"\334\001\n\024SnapshotTableRequest\022" - + "3\n\004name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtable.googleap" - + "is.com/Table\0228\n\007cluster\030\002 \001(\tB\'\340A\002\372A!\n\037b" - + "igtable.googleapis.com/Cluster\022\030\n\013snapsh" - + "ot_id\030\003 \001(\tB\003\340A\002\022&\n\003ttl\030\004 \001(\0132\031.google.p" - + "rotobuf.Duration\022\023\n\013description\030\005 \001(\t\"L\n" - + "\022GetSnapshotRequest\0226\n\004name\030\001 \001(\tB(\340A\002\372A" - + "\"\n bigtable.googleapis.com/Snapshot\"v\n\024L" - + "istSnapshotsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002" - + "\372A!\n\037bigtable.googleapis.com/Cluster\022\021\n\t" - + "page_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"g\n\025L" - + "istSnapshotsResponse\0225\n\tsnapshots\030\001 \003(\0132" - + "\".google.bigtable.admin.v2.Snapshot\022\027\n\017n" - + "ext_page_token\030\002 \001(\t\"O\n\025DeleteSnapshotRe" - + "quest\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n bigtable.go" - + "ogleapis.com/Snapshot\"\304\001\n\025SnapshotTableM" - + "etadata\022H\n\020original_request\030\001 \001(\0132..goog" - + "le.bigtable.admin.v2.SnapshotTableReques" - + "t\0220\n\014request_time\030\002 \001(\0132\032.google.protobu" - + "f.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.googl" - + "e.protobuf.Timestamp\"\330\001\n\037CreateTableFrom" - + "SnapshotMetadata\022R\n\020original_request\030\001 \001" - + "(\01328.google.bigtable.admin.v2.CreateTabl" - + "eFromSnapshotRequest\0220\n\014request_time\030\002 \001" - + "(\0132\032.google.protobuf.Timestamp\022/\n\013finish" - + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" - + "\235\001\n\023CreateBackupRequest\0227\n\006parent\030\001 \001(\tB" - + "\'\340A\002\372A!\n\037bigtable.googleapis.com/Cluster" - + "\022\026\n\tbackup_id\030\002 \001(\tB\003\340A\002\0225\n\006backup\030\003 \001(\013" - + "2 .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\nstart_time\030\003 \001(\013" - + "2\032.google.protobuf.Timestamp\022,\n\010end_time" - + "\030\004 \001(\0132\032.google.protobuf.Timestamp\"\202\001\n\023U" - + "pdateBackupRequest\0225\n\006backup\030\001 \001(\0132 .goo" - + "gle.bigtable.admin.v2.BackupB\003\340A\002\0224\n\013upd" - + "ate_mask\030\002 \001(\0132\032.google.protobuf.FieldMa" - + "skB\003\340A\002\"H\n\020GetBackupRequest\0224\n\004name\030\001 \001(" - + "\tB&\340A\002\372A \n\036bigtable.googleapis.com/Backu" - + "p\"K\n\023DeleteBackupRequest\0224\n\004name\030\001 \001(\tB&" - + "\340A\002\372A \n\036bigtable.googleapis.com/Backup\"\226" - + "\001\n\022ListBackupsRequest\0227\n\006parent\030\001 \001(\tB\'\340" - + "A\002\372A!\n\037bigtable.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\npage_token\030\005 \001(\t\"a\n\023ListB" - + "ackupsResponse\0221\n\007backups\030\001 \003(\0132 .google" - + ".bigtable.admin.v2.Backup\022\027\n\017next_page_t" - + "oken\030\002 \001(\t2\230%\n\022BigtableTableAdmin\022\253\001\n\013Cr" - + "eateTable\022,.google.bigtable.admin.v2.Cre" - + "ateTableRequest\032\037.google.bigtable.admin." - + "v2.Table\"M\202\323\344\223\002/\"*/v2/{parent=projects/*" - + "/instances/*}/tables:\001*\332A\025parent,table_i" - + "d,table\022\212\002\n\027CreateTableFromSnapshot\0228.go" - + "ogle.bigtable.admin.v2.CreateTableFromSn" - + "apshotRequest\032\035.google.longrunning.Opera" - + "tion\"\225\001\202\323\344\223\002B\"=/v2/{parent=projects/*/in" - + "stances/*}/tables:createFromSnapshot:\001*\332" - + "A\037parent,table_id,source_snapshot\312A(\n\005Ta" - + "ble\022\037CreateTableFromSnapshotMetadata\022\244\001\n" - + "\nListTables\022+.google.bigtable.admin.v2.L" - + "istTablesRequest\032,.google.bigtable.admin" - + ".v2.ListTablesResponse\";\202\323\344\223\002,\022*/v2/{par" - + "ent=projects/*/instances/*}/tables\332A\006par" - + "ent\022\221\001\n\010GetTable\022).google.bigtable.admin" - + ".v2.GetTableRequest\032\037.google.bigtable.ad" - + "min.v2.Table\"9\202\323\344\223\002,\022*/v2/{name=projects" - + "/*/instances/*/tables/*}\332A\004name\022\216\001\n\013Dele" - + "teTable\022,.google.bigtable.admin.v2.Delet" - + "eTableRequest\032\026.google.protobuf.Empty\"9\202" - + "\323\344\223\002,**/v2/{name=projects/*/instances/*/" - + "tables/*}\332A\004name\022\317\001\n\024ModifyColumnFamilie" - + "s\0225.google.bigtable.admin.v2.ModifyColum" - + "nFamiliesRequest\032\037.google.bigtable.admin" - + ".v2.Table\"_\202\323\344\223\002D\"?/v2/{name=projects/*/" - + "instances/*/tables/*}:modifyColumnFamili" - + "es:\001*\332A\022name,modifications\022\231\001\n\014DropRowRa" - + "nge\022-.google.bigtable.admin.v2.DropRowRa" - + "ngeRequest\032\026.google.protobuf.Empty\"B\202\323\344\223" - + "\002<\"7/v2/{name=projects/*/instances/*/tab" - + "les/*}:dropRowRange:\001*\022\350\001\n\030GenerateConsi" - + "stencyToken\0229.google.bigtable.admin.v2.G" - + "enerateConsistencyTokenRequest\032:.google." - + "bigtable.admin.v2.GenerateConsistencyTok" - + "enResponse\"U\202\323\344\223\002H\"C/v2/{name=projects/*" - + "/instances/*/tables/*}:generateConsisten" - + "cyToken:\001*\332A\004name\022\332\001\n\020CheckConsistency\0221" - + ".google.bigtable.admin.v2.CheckConsisten" - + "cyRequest\0322.google.bigtable.admin.v2.Che" - + "ckConsistencyResponse\"_\202\323\344\223\002@\";/v2/{name" - + "=projects/*/instances/*/tables/*}:checkC" - + "onsistency:\001*\332A\026name,consistency_token\022\352" - + "\001\n\rSnapshotTable\022..google.bigtable.admin" - + ".v2.SnapshotTableRequest\032\035.google.longru" - + "nning.Operation\"\211\001\202\323\344\223\0028\"3/v2/{name=proj" - + "ects/*/instances/*/tables/*}:snapshot:\001*" - + "\332A$name,cluster,snapshot_id,description\312" - + "A!\n\010Snapshot\022\025SnapshotTableMetadata\022\250\001\n\013" - + "GetSnapshot\022,.google.bigtable.admin.v2.G" - + "etSnapshotRequest\032\".google.bigtable.admi" - + "n.v2.Snapshot\"G\202\323\344\223\002:\0228/v2/{name=project" - + "s/*/instances/*/clusters/*/snapshots/*}\332" - + "A\004name\022\273\001\n\rListSnapshots\022..google.bigtab" - + "le.admin.v2.ListSnapshotsRequest\032/.googl" - + "e.bigtable.admin.v2.ListSnapshotsRespons" - + "e\"I\202\323\344\223\002:\0228/v2/{parent=projects/*/instan" - + "ces/*/clusters/*}/snapshots\332A\006parent\022\242\001\n" - + "\016DeleteSnapshot\022/.google.bigtable.admin." - + "v2.DeleteSnapshotRequest\032\026.google.protob" - + "uf.Empty\"G\202\323\344\223\002:*8/v2/{name=projects/*/i" - + "nstances/*/clusters/*/snapshots/*}\332A\004nam" - + "e\022\340\001\n\014CreateBackup\022-.google.bigtable.adm" - + "in.v2.CreateBackupRequest\032\035.google.longr" - + "unning.Operation\"\201\001\202\323\344\223\002@\"6/v2/{parent=p" - + "rojects/*/instances/*/clusters/*}/backup" - + "s:\006backup\332A\027parent,backup_id,backup\312A\036\n\006" - + "Backup\022\024CreateBackupMetadata\022\240\001\n\tGetBack" - + "up\022*.google.bigtable.admin.v2.GetBackupR" - + "equest\032 .google.bigtable.admin.v2.Backup" - + "\"E\202\323\344\223\0028\0226/v2/{name=projects/*/instances" - + "/*/clusters/*/backups/*}\332A\004name\022\303\001\n\014Upda" - + "teBackup\022-.google.bigtable.admin.v2.Upda" - + "teBackupRequest\032 .google.bigtable.admin." - + "v2.Backup\"b\202\323\344\223\002G2=/v2/{backup.name=proj" - + "ects/*/instances/*/clusters/*/backups/*}" - + ":\006backup\332A\022backup,update_mask\022\234\001\n\014Delete" - + "Backup\022-.google.bigtable.admin.v2.Delete" - + "BackupRequest\032\026.google.protobuf.Empty\"E\202" - + "\323\344\223\0028*6/v2/{name=projects/*/instances/*/" - + "clusters/*/backups/*}\332A\004name\022\263\001\n\013ListBac" - + "kups\022,.google.bigtable.admin.v2.ListBack" - + "upsRequest\032-.google.bigtable.admin.v2.Li" - + "stBackupsResponse\"G\202\323\344\223\0028\0226/v2/{parent=p" - + "rojects/*/instances/*/clusters/*}/backup" - + "s\332A\006parent\022\273\001\n\014RestoreTable\022-.google.big" - + "table.admin.v2.RestoreTableRequest\032\035.goo" - + "gle.longrunning.Operation\"]\202\323\344\223\0027\"2/v2/{" - + "parent=projects/*/instances/*}/tables:re" - + "store:\001*\312A\035\n\005Table\022\024RestoreTableMetadata" - + "\022\354\001\n\014GetIamPolicy\022\".google.iam.v1.GetIam" - + "PolicyRequest\032\025.google.iam.v1.Policy\"\240\001\202" - + "\323\344\223\002\216\001\";/v2/{resource=projects/*/instanc" - + "es/*/tables/*}:getIamPolicy:\001*ZL\"G/v2/{r" - + "esource=projects/*/instances/*/clusters/" - + "*/backups/*}:getIamPolicy:\001*\332A\010resource\022" - + "\363\001\n\014SetIamPolicy\022\".google.iam.v1.SetIamP" - + "olicyRequest\032\025.google.iam.v1.Policy\"\247\001\202\323" - + "\344\223\002\216\001\";/v2/{resource=projects/*/instance" - + "s/*/tables/*}:setIamPolicy:\001*ZL\"G/v2/{re" - + "source=projects/*/instances/*/clusters/*" - + "/backups/*}:setIamPolicy:\001*\332A\017resource,p" - + "olicy\022\244\002\n\022TestIamPermissions\022(.google.ia" - + "m.v1.TestIamPermissionsRequest\032).google." - + "iam.v1.TestIamPermissionsResponse\"\270\001\202\323\344\223" - + "\002\232\001\"A/v2/{resource=projects/*/instances/" - + "*/tables/*}:testIamPermissions:\001*ZR\"M/v2" - + "/{resource=projects/*/instances/*/cluste" - + "rs/*/backups/*}:testIamPermissions:\001*\332A\024" - + "resource,permissions\032\336\002\312A\034bigtableadmin." - + "googleapis.com\322A\273\002https://www.googleapis" - + ".com/auth/bigtable.admin,https://www.goo" - + "gleapis.com/auth/bigtable.admin.table,ht" - + "tps://www.googleapis.com/auth/cloud-bigt" - + "able.admin,https://www.googleapis.com/au" - + "th/cloud-bigtable.admin.table,https://ww" - + "w.googleapis.com/auth/cloud-platform,htt" - + "ps://www.googleapis.com/auth/cloud-platf" - + "orm.read-onlyB\337\001\n\034com.google.bigtable.ad" - + "min.v2B\027BigtableTableAdminProtoP\001Z=googl" - + "e.golang.org/genproto/googleapis/bigtabl" - + "e/admin/v2;admin\252\002\036Google.Cloud.Bigtable" - + ".Admin.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\" - + "V2\352\002\"Google::Cloud::Bigtable::Admin::V2b" - + "\006proto3" + + "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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ChangeStreamConfigOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ChangeStreamConfigOrBuilder.java new file mode 100644 index 0000000000..bac5676174 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java index a470430641..716d13ce6c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyRequest} */ -public final class CheckConsistencyRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CheckConsistencyRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,75 +57,13 @@ private CheckConsistencyRequest() { consistencyToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CheckConsistencyRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CheckConsistencyRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - consistencyToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_fieldAccessorTable @@ -120,14 +72,67 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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; - private volatile java.lang.Object name_; + + @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
    +   * Required. The unique name of the Table for which to check replication
    +   * consistency. Values are of the form
        * `projects/{project}/instances/{instance}/tables/{table}`.
        * 
    * @@ -149,12 +154,13 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Required. The unique name of the Table for which to check replication consistency.
    -   * Values are of the form
    +   * Required. The unique name of the Table for which to check replication
    +   * consistency. Values are of the form
        * `projects/{project}/instances/{instance}/tables/{table}`.
        * 
    * @@ -178,7 +184,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int CONSISTENCY_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object consistencyToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object consistencyToken_ = ""; + /** * * @@ -202,6 +211,7 @@ public java.lang.String getConsistencyToken() { return s; } } + /** * * @@ -226,6 +236,134 @@ public com.google.protobuf.ByteString getConsistencyTokenBytes() { } } + 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 @@ -240,13 +378,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + 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 (!getConsistencyTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, consistencyToken_); + if (modeCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_); } - unknownFields.writeTo(output); + if (modeCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -255,13 +399,23 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + 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 (!getConsistencyTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, consistencyToken_); + if (modeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_); } - size += unknownFields.getSerializedSize(); + if (modeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -279,7 +433,20 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getConsistencyToken().equals(other.getConsistencyToken())) return false; - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -294,7 +461,19 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONSISTENCY_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getConsistencyToken().hashCode(); - hash = (29 * hash) + unknownFields.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; } @@ -336,38 +515,38 @@ public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( public static com.google.bigtable.admin.v2.CheckConsistencyRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -390,10 +569,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -404,7 +584,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -414,7 +594,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_fieldAccessorTable @@ -424,26 +604,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.CheckConsistencyRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @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; } @@ -471,43 +651,33 @@ public com.google.bigtable.admin.v2.CheckConsistencyRequest build() { public com.google.bigtable.admin.v2.CheckConsistencyRequest buildPartial() { com.google.bigtable.admin.v2.CheckConsistencyRequest result = new com.google.bigtable.admin.v2.CheckConsistencyRequest(this); - result.name_ = name_; - result.consistencyToken_ = consistencyToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -525,13 +695,31 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CheckConsistencyRequest ot return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (!other.getConsistencyToken().isEmpty()) { consistencyToken_ = other.consistencyToken_; + bitField0_ |= 0x00000002; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + 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; } @@ -546,28 +734,86 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CheckConsistencyRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CheckConsistencyRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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
    +     * Required. The unique name of the Table for which to check replication
    +     * consistency. Values are of the form
          * `projects/{project}/instances/{instance}/tables/{table}`.
          * 
    * @@ -588,12 +834,13 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the Table for which to check replication consistency.
    -     * Values are of the form
    +     * Required. The unique name of the Table for which to check replication
    +     * consistency. Values are of the form
          * `projects/{project}/instances/{instance}/tables/{table}`.
          * 
    * @@ -614,12 +861,13 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the Table for which to check replication consistency.
    -     * Values are of the form
    +     * Required. The unique name of the Table for which to check replication
    +     * consistency. Values are of the form
          * `projects/{project}/instances/{instance}/tables/{table}`.
          * 
    * @@ -634,17 +882,18 @@ 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
    +     * Required. The unique name of the Table for which to check replication
    +     * consistency. Values are of the form
          * `projects/{project}/instances/{instance}/tables/{table}`.
          * 
    * @@ -655,17 +904,18 @@ public Builder setName(java.lang.String value) { * @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
    +     * Required. The unique name of the Table for which to check replication
    +     * consistency. Values are of the form
          * `projects/{project}/instances/{instance}/tables/{table}`.
          * 
    * @@ -681,13 +931,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object consistencyToken_ = ""; + /** * * @@ -710,6 +961,7 @@ public java.lang.String getConsistencyToken() { return (java.lang.String) ref; } } + /** * * @@ -732,6 +984,7 @@ public com.google.protobuf.ByteString getConsistencyTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -748,11 +1001,12 @@ public Builder setConsistencyToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - consistencyToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -765,11 +1019,12 @@ public Builder setConsistencyToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearConsistencyToken() { - consistencyToken_ = getDefaultInstance().getConsistencyToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -787,21 +1042,510 @@ public Builder setConsistencyTokenBytes(com.google.protobuf.ByteString value) { 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 final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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 final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + 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) @@ -825,7 +1569,18 @@ public CheckConsistencyRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CheckConsistencyRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java index b6accf6535..95dbad6897 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,8 +30,8 @@ public interface CheckConsistencyRequestOrBuilder * * *
    -   * Required. The unique name of the Table for which to check replication consistency.
    -   * Values are of the form
    +   * Required. The unique name of the Table for which to check replication
    +   * consistency. Values are of the form
        * `projects/{project}/instances/{instance}/tables/{table}`.
        * 
    * @@ -39,12 +42,13 @@ public interface CheckConsistencyRequestOrBuilder * @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
    +   * Required. The unique name of the Table for which to check replication
    +   * consistency. Values are of the form
        * `projects/{project}/instances/{instance}/tables/{table}`.
        * 
    * @@ -68,6 +72,7 @@ public interface CheckConsistencyRequestOrBuilder * @return The consistencyToken. */ java.lang.String getConsistencyToken(); + /** * * @@ -80,4 +85,100 @@ public interface CheckConsistencyRequestOrBuilder * @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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java index 760ffe58d0..aa27ddf035 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,70 +30,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyResponse} */ -public final class CheckConsistencyResponse extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use CheckConsistencyResponse.newBuilder() to construct. - private CheckConsistencyResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CheckConsistencyResponse() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CheckConsistencyResponse(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CheckConsistencyResponse"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use CheckConsistencyResponse.newBuilder() to construct. + private CheckConsistencyResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private CheckConsistencyResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - consistent_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private CheckConsistencyResponse() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto @@ -99,7 +60,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_fieldAccessorTable @@ -109,7 +70,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CONSISTENT_FIELD_NUMBER = 1; - private boolean consistent_; + private boolean consistent_ = false; + /** * * @@ -144,7 +106,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (consistent_ != false) { output.writeBool(1, consistent_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -156,7 +118,7 @@ public int getSerializedSize() { if (consistent_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, consistent_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -173,7 +135,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.CheckConsistencyResponse) obj; if (getConsistent() != other.getConsistent()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -186,7 +148,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONSISTENT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getConsistent()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -228,38 +190,38 @@ public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( public static com.google.bigtable.admin.v2.CheckConsistencyResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -283,10 +245,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -297,7 +260,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CheckConsistencyResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -307,7 +270,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_fieldAccessorTable @@ -317,24 +280,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.CheckConsistencyResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; consistent_ = false; - return this; } @@ -362,42 +318,18 @@ public com.google.bigtable.admin.v2.CheckConsistencyResponse build() { public com.google.bigtable.admin.v2.CheckConsistencyResponse buildPartial() { com.google.bigtable.admin.v2.CheckConsistencyResponse result = new com.google.bigtable.admin.v2.CheckConsistencyResponse(this); - result.consistent_ = consistent_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -416,7 +348,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CheckConsistencyResponse o if (other.getConsistent() != false) { setConsistent(other.getConsistent()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -431,22 +363,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CheckConsistencyResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CheckConsistencyResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private boolean consistent_; + /** * * @@ -463,6 +417,7 @@ public Builder mergeFrom( public boolean getConsistent() { return consistent_; } + /** * * @@ -479,9 +434,11 @@ public boolean getConsistent() { public Builder setConsistent(boolean value) { consistent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -495,23 +452,12 @@ public Builder setConsistent(boolean value) { * @return This builder for chaining. */ public Builder clearConsistent() { - + bitField0_ = (bitField0_ & ~0x00000001); consistent_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CheckConsistencyResponse) } @@ -533,7 +479,18 @@ public CheckConsistencyResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CheckConsistencyResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java index a7caf4943a..c3c94a6805 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CheckConsistencyResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java index 906d9b80d2..a82c231f2d 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -29,13 +31,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.Cluster} */ -public final class Cluster extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Cluster(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,114 +57,17 @@ private Cluster() { name_ = ""; location_ = ""; state_ = 0; + nodeScalingFactor_ = 0; defaultStorageType_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Cluster(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Cluster( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - location_ = s; - break; - } - case 24: - { - int rawValue = input.readEnum(); - - state_ = rawValue; - break; - } - case 32: - { - serveNodes_ = input.readInt32(); - break; - } - case 40: - { - int rawValue = input.readEnum(); - - defaultStorageType_ = rawValue; - break; - } - case 50: - { - com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder subBuilder = null; - if (encryptionConfig_ != null) { - subBuilder = encryptionConfig_.toBuilder(); - } - encryptionConfig_ = - input.readMessage( - com.google.bigtable.admin.v2.Cluster.EncryptionConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(encryptionConfig_); - encryptionConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_Cluster_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable @@ -229,6 +146,16 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + /** * * @@ -239,6 +166,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * STATE_NOT_KNOWN = 0; */ public static final int STATE_NOT_KNOWN_VALUE = 0; + /** * * @@ -249,6 +177,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * READY = 1; */ public static final int READY_VALUE = 1; + /** * * @@ -261,6 +190,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * CREATING = 2; */ public static final int CREATING_VALUE = 2; + /** * * @@ -275,6 +205,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * RESIZING = 3; */ public static final int RESIZING_VALUE = 3; + /** * * @@ -349,7 +280,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Cluster.getDescriptor().getEnumTypes().get(0); } @@ -374,205 +305,440 @@ private State(int value) { // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Cluster.State) } - public interface EncryptionConfigOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster.EncryptionConfig) - com.google.protobuf.MessageOrBuilder { - + /** + * + * + *
    +   * 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 { /** * * *
    -     * 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.
    -     * 3) All clusters within an instance must use the same CMEK key.
    +     * No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
          * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } - * - * @return The kmsKeyName. + * NODE_SCALING_FACTOR_UNSPECIFIED = 0; */ - java.lang.String getKmsKeyName(); + NODE_SCALING_FACTOR_UNSPECIFIED(0), /** * * *
    -     * 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.
    -     * 3) All clusters within an instance must use the same CMEK key.
    +     * The cluster is running with a scaling factor of 1.
          * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * NODE_SCALING_FACTOR_1X = 1; + */ + NODE_SCALING_FACTOR_1X(1), + /** * - * @return The bytes for kmsKeyName. + * + *
    +     * 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; */ - 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.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Cluster.EncryptionConfig) - EncryptionConfigOrBuilder { - private static final long serialVersionUID = 0L; - // Use EncryptionConfig.newBuilder() to construct. - private EncryptionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } + NODE_SCALING_FACTOR_2X(2), + UNRECOGNIZED(-1), + ; - private EncryptionConfig() { - kmsKeyName_ = ""; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "NodeScalingFactor"); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new EncryptionConfig(); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + /** + * @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); } - private EncryptionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + /** + * @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; } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); + } - kmsKeyName_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; + 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); } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + }; + + public 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 static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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 com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Cluster.getDescriptor().getEnumTypes().get(1); } - public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object kmsKeyName_; + 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 { + /** * * *
    -     * 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.
    -     * 3) All clusters within an instance must use the same CMEK key.
    +     * Required. Autoscaling limits for this cluster.
          * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * * - * @return The kmsKeyName. + * @return Whether the autoscalingLimits field is set. */ - @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; - } - } + boolean hasAutoscalingLimits(); + /** * * *
    -     * 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.
    -     * 3) All clusters within an instance must use the same CMEK key.
    +     * Required. Autoscaling limits for this cluster.
          * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * * - * @return The bytes for kmsKeyName. + * @return The autoscalingLimits. */ - @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; - } + 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; @@ -589,10 +755,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getKmsKeyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getAutoscalingLimits()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getAutoscalingTargets()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -601,10 +770,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getKmsKeyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAutoscalingLimits()); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000002) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAutoscalingTargets()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -614,14 +787,21 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.bigtable.admin.v2.Cluster.EncryptionConfig)) { + if (!(obj instanceof com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig)) { return super.equals(obj); } - com.google.bigtable.admin.v2.Cluster.EncryptionConfig other = - (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) obj; + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig other = + (com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) obj; - if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + 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; } @@ -632,82 +812,88 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; - hash = (53 * hash) + getKmsKeyName().hashCode(); - hash = (29 * hash) + unknownFields.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.EncryptionConfig parseFrom( + 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.EncryptionConfig parseFrom( + 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.EncryptionConfig parseFrom( + 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.EncryptionConfig parseFrom( + 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.EncryptionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { + 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.EncryptionConfig parseFrom( + 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.EncryptionConfig parseFrom( + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } - public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseDelimitedFrom( + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } - public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseDelimitedFrom( + 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.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } - public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + public static com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } - public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -721,7 +907,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.bigtable.admin.v2.Cluster.EncryptionConfig prototype) { + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -731,77 +917,88 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.
    +     * Autoscaling config for a cluster.
          * 
    * - * Protobuf type {@code google.bigtable.admin.v2.Cluster.EncryptionConfig} + * Protobuf type {@code google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { + // @@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_EncryptionConfig_descriptor; + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.bigtable.admin.v2.Cluster.EncryptionConfig.class, - com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder.class); + 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.EncryptionConfig.newBuilder() + // Construct using com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAutoscalingLimitsFieldBuilder(); + internalGetAutoscalingTargetsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - kmsKeyName_ = ""; - + 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_EncryptionConfig_descriptor; + .internal_static_google_bigtable_admin_v2_Cluster_ClusterAutoscalingConfig_descriptor; } @java.lang.Override - public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance(); + 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.EncryptionConfig build() { - com.google.bigtable.admin.v2.Cluster.EncryptionConfig result = buildPartial(); + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig build() { + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -809,67 +1006,59 @@ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig build() { } @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); - result.kmsKeyName_ = kmsKeyName_; + 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; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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.EncryptionConfig) { - return mergeFrom((com.google.bigtable.admin.v2.Cluster.EncryptionConfig) 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.EncryptionConfig other) { - if (other == com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance()) + 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.getKmsKeyName().isEmpty()) { - kmsKeyName_ = other.kmsKeyName_; - onChanged(); + if (other.hasAutoscalingLimits()) { + mergeAutoscalingLimits(other.getAutoscalingLimits()); } - this.mergeUnknownFields(other.unknownFields); + if (other.hasAutoscalingTargets()) { + mergeAutoscalingTargets(other.getAutoscalingTargets()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -884,249 +1073,2075 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.Cluster.EncryptionConfig parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } - private java.lang.Object kmsKeyName_ = ""; + 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_; + /** * * *
    -       * 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.
    -       * 3) All clusters within an instance must use the same CMEK key.
    +       * Required. Autoscaling limits for this cluster.
            * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * * - * @return The kmsKeyName. + * @return Whether the autoscalingLimits field is set. */ - 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; - } + public boolean hasAutoscalingLimits() { + return ((bitField0_ & 0x00000001) != 0); } + /** * * *
    -       * 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.
    -       * 3) All clusters within an instance must use the same CMEK key.
    +       * Required. Autoscaling limits for this cluster.
            * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * * - * @return The bytes for kmsKeyName. + * @return The autoscalingLimits. */ - 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; + public com.google.bigtable.admin.v2.AutoscalingLimits getAutoscalingLimits() { + if (autoscalingLimitsBuilder_ == null) { + return autoscalingLimits_ == null + ? com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance() + : autoscalingLimits_; } else { - return (com.google.protobuf.ByteString) ref; + return autoscalingLimitsBuilder_.getMessage(); } } + /** * * *
    -       * 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.
    -       * 3) All clusters within an instance must use the same CMEK key.
    +       * Required. Autoscaling limits for this cluster.
            * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .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; + } + + /** * - * @param value The kmsKeyName to set. - * @return This builder for chaining. + * + *
    +       * Required. Autoscaling limits for this cluster.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ - public Builder setKmsKeyName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + 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; + } - kmsKeyName_ = value; + /** + * + * + *
    +       * 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; } + /** * * *
    -       * 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.
    -       * 3) All clusters within an instance must use the same CMEK key.
    +       * Required. Autoscaling limits for this cluster.
            * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .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(); + } + + /** * - * @return This builder for chaining. + * + *
    +       * Required. Autoscaling limits for this cluster.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AutoscalingLimits autoscaling_limits = 1 [(.google.api.field_behavior) = REQUIRED]; + * */ - public Builder clearKmsKeyName() { + 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_; + } + } - kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + /** + * + * + *
    +       * 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; } + /** * * *
    -       * 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.
    -       * 3) All clusters within an instance must use the same CMEK key.
    +       * Required. Autoscaling targets for this cluster.
            * 
    * - * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * .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; + } + + /** * - * @param value The bytes for kmsKeyName to set. - * @return This builder for chaining. + * + *
    +       * Required. Autoscaling targets for this cluster.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AutoscalingTargets autoscaling_targets = 2 [(.google.api.field_behavior) = REQUIRED]; + * */ - public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + 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); } - checkByteStringIsUtf8(value); + if (autoscalingTargets_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } - kmsKeyName_ = value; + /** + * + * + *
    +       * 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; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + /** + * + * + *
    +       * 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(); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +       * 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_; + } } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster.EncryptionConfig) + /** + * + * + *
    +       * 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.EncryptionConfig) - private static final com.google.bigtable.admin.v2.Cluster.EncryptionConfig DEFAULT_INSTANCE; + // @@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.EncryptionConfig(); + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig(); } - public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstance() { + 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() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public EncryptionConfig parsePartialFrom( + public ClusterAutoscalingConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new EncryptionConfig(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstanceForType() { + public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + 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(); + } + /** * * *
    -   * The unique name of the cluster. Values are of the form
    -   * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
    +   * Configuration for a cluster.
        * 
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * @return The name. + * Protobuf type {@code google.bigtable.admin.v2.Cluster.ClusterConfig} */ - @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; + 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 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -1144,19 +3159,23 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int LOCATION_FIELD_NUMBER = 2; - private volatile java.lang.Object location_; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** * * *
    -   * (`CreationOnly`)
    -   * The location where this cluster's nodes and storage reside. For best
    -   * performance, clients should be located as close as possible to 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.resource_reference) = { ... } + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * * * @return The location. */ @@ -1172,18 +3191,20 @@ public java.lang.String getLocation() { return s; } } + /** * * *
    -   * (`CreationOnly`)
    -   * The location where this cluster's nodes and storage reside. For best
    -   * performance, clients should be located as close as possible to 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.resource_reference) = { ... } + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * * * @return The bytes for location. */ @@ -1201,12 +3222,13 @@ public com.google.protobuf.ByteString getLocationBytes() { } public static final int STATE_FIELD_NUMBER = 3; - private int state_; + private int state_ = 0; + /** * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -1219,11 +3241,12 @@ public com.google.protobuf.ByteString getLocationBytes() { public int getStateValue() { return state_; } + /** * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -1234,23 +3257,24 @@ public int getStateValue() { */ @java.lang.Override public com.google.bigtable.admin.v2.Cluster.State getState() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Cluster.State result = - com.google.bigtable.admin.v2.Cluster.State.valueOf(state_); + 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_; + private int serveNodes_ = 0; + /** * * *
    -   * Required. The number of nodes allocated to this cluster. More nodes enable
    -   * higher throughput and more consistent performance.
    +   * 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 [(.google.api.field_behavior) = REQUIRED]; + * int32 serve_nodes = 4; * * @return The serveNodes. */ @@ -1259,18 +3283,117 @@ 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_; + private int defaultStorageType_ = 0; + /** * * *
    -   * (`CreationOnly`)
    -   * The type of storage used by this cluster to serve its
    +   * 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.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return The enum numeric value on the wire for defaultStorageType. */ @@ -1278,29 +3401,31 @@ public int getServeNodes() { public int getDefaultStorageTypeValue() { return defaultStorageType_; } + /** * * *
    -   * (`CreationOnly`)
    -   * The type of storage used by this cluster to serve its
    +   * 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.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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.StorageType result = - com.google.bigtable.admin.v2.StorageType.valueOf(defaultStorageType_); + 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_; + /** * * @@ -1316,8 +3441,9 @@ public com.google.bigtable.admin.v2.StorageType getDefaultStorageType() { */ @java.lang.Override public boolean hasEncryptionConfig() { - return encryptionConfig_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -1337,6 +3463,7 @@ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() : encryptionConfig_; } + /** * * @@ -1351,7 +3478,9 @@ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig @java.lang.Override public com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder() { - return getEncryptionConfig(); + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; } private byte memoizedIsInitialized = -1; @@ -1368,11 +3497,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!getLocationBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, location_); + 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_); @@ -1384,10 +3513,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(5, defaultStorageType_); } - if (encryptionConfig_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(6, getEncryptionConfig()); } - unknownFields.writeTo(output); + 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 @@ -1396,11 +3533,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!getLocationBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, location_); + 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_); @@ -1412,10 +3549,20 @@ public int getSerializedSize() { != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, defaultStorageType_); } - if (encryptionConfig_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEncryptionConfig()); } - size += unknownFields.getSerializedSize(); + 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; } @@ -1434,12 +3581,21 @@ public boolean equals(final java.lang.Object obj) { 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 (!unknownFields.equals(other.unknownFields)) 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; } @@ -1458,13 +3614,23 @@ public int hashCode() { 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(); } - hash = (29 * hash) + unknownFields.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; } @@ -1505,38 +3671,38 @@ public static com.google.bigtable.admin.v2.Cluster parseFrom( public static com.google.bigtable.admin.v2.Cluster parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1559,10 +3725,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1574,7 +3741,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.Cluster} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1584,7 +3751,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable @@ -1598,34 +3765,37 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + 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; - - if (encryptionConfigBuilder_ == null) { - encryptionConfig_ = null; - } else { - encryptionConfig_ = null; + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); encryptionConfigBuilder_ = null; } + configCase_ = 0; + config_ = null; return this; } @@ -1652,518 +3822,966 @@ public com.google.bigtable.admin.v2.Cluster build() { @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); - result.name_ = name_; - result.location_ = location_; - result.state_ = state_; - result.serveNodes_ = serveNodes_; - result.defaultStorageType_ = defaultStorageType_; - if (encryptionConfigBuilder_ == null) { - result.encryptionConfig_ = encryptionConfig_; + 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 { - result.encryptionConfig_ = encryptionConfigBuilder_.build(); + return (java.lang.String) ref; } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
    +     * 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; + } } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } + 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 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 int getStateValue() { + return state_; } - 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_; - onChanged(); - } - if (!other.getLocation().isEmpty()) { - location_ = other.location_; - onChanged(); - } - if (other.state_ != 0) { - setStateValue(other.getStateValue()); - } - if (other.getServeNodes() != 0) { - setServeNodes(other.getServeNodes()); - } - if (other.defaultStorageType_ != 0) { - setDefaultStorageTypeValue(other.getDefaultStorageTypeValue()); - } - if (other.hasEncryptionConfig()) { - mergeEncryptionConfig(other.getEncryptionConfig()); - } - this.mergeUnknownFields(other.unknownFields); + /** + * + * + *
    +     * 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 final boolean isInitialized() { - return true; + 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; } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.admin.v2.Cluster parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.bigtable.admin.v2.Cluster) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } + /** + * + * + *
    +     * 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; } - 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]*`.
    +     * Output only. The current state of the cluster.
          * 
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @return The name. + * @return This builder for chaining. */ - 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; - } + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; } + + private int serveNodes_; + /** * * *
    -     * The unique name of the cluster. Values are of the form
    -     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
    +     * 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.
          * 
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 serve_nodes = 4; * - * @return The bytes for name. + * @return The serveNodes. */ - 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; - } + @java.lang.Override + public int getServeNodes() { + return serveNodes_; } + /** * * *
    -     * The unique name of the cluster. Values are of the form
    -     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
    +     * 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.
          * 
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 serve_nodes = 4; * - * @param value The name to set. + * @param value The serveNodes to set. * @return This builder for chaining. */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder setServeNodes(int value) { - name_ = value; + serveNodes_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * *
    -     * The unique name of the cluster. Values are of the form
    -     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
    +     * 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.
          * 
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * int32 serve_nodes = 4; * * @return This builder for chaining. */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); + public Builder clearServeNodes() { + bitField0_ = (bitField0_ & ~0x00000008); + serveNodes_ = 0; onChanged(); return this; } + + private int nodeScalingFactor_ = 0; + /** * * *
    -     * The unique name of the cluster. Values are of the form
    -     * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`.
    +     * Immutable. The node scaling factor of this cluster.
          * 
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @param value The bytes for name to set. - * @return This builder for chaining. + * @return The enum numeric value on the wire for nodeScalingFactor. */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; + @java.lang.Override + public int getNodeScalingFactorValue() { + return nodeScalingFactor_; } - private java.lang.Object location_ = ""; /** * * *
    -     * (`CreationOnly`)
    -     * 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}`.
    +     * Immutable. The node scaling factor of this cluster.
          * 
    * - * string location = 2 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @return The location. + * @param value The enum numeric value on the wire for nodeScalingFactor to set. + * @return This builder for chaining. */ - 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; - } + public Builder setNodeScalingFactorValue(int value) { + nodeScalingFactor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * 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}`.
    +     * Immutable. The node scaling factor of this cluster.
          * 
    * - * string location = 2 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @return The bytes for location. + * @return The nodeScalingFactor. */ - 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; - } + @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; } + /** * * *
    -     * (`CreationOnly`)
    -     * 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}`.
    +     * Immutable. The node scaling factor of this cluster.
          * 
    * - * string location = 2 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @param value The location to set. + * @param value The nodeScalingFactor to set. * @return This builder for chaining. */ - public Builder setLocation(java.lang.String value) { + public Builder setNodeScalingFactor( + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor value) { if (value == null) { throw new NullPointerException(); } - - location_ = value; + bitField0_ |= 0x00000010; + nodeScalingFactor_ = value.getNumber(); onChanged(); return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * 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}`.
    +     * Immutable. The node scaling factor of this cluster.
          * 
    * - * string location = 2 [(.google.api.resource_reference) = { ... } + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return This builder for chaining. */ - public Builder clearLocation() { - - location_ = getDefaultInstance().getLocation(); + 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_; + /** * * *
    -     * (`CreationOnly`)
    -     * 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}`.
    +     * Configuration for this cluster.
          * 
    * - * string location = 2 [(.google.api.resource_reference) = { ... } + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; * - * @param value The bytes for location to set. - * @return This builder for chaining. + * @return Whether the clusterConfig field is set. */ - public Builder setLocationBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - location_ = value; - onChanged(); - return this; + @java.lang.Override + public boolean hasClusterConfig() { + return configCase_ == 7; } - private int state_ = 0; /** * * *
    -     * The current state of the cluster.
    +     * Configuration for this cluster.
          * 
    * - * - * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; * - * @return The enum numeric value on the wire for state. + * @return The clusterConfig. */ @java.lang.Override - public int getStateValue() { - return state_; + 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(); + } } + /** * * *
    -     * The current state of the cluster.
    +     * Configuration for this 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. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - public Builder setStateValue(int value) { - - state_ = value; - onChanged(); + 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; } + /** * * *
    -     * The current state of the cluster.
    +     * Configuration for this cluster.
          * 
    * - * - * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The state. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - @java.lang.Override - public com.google.bigtable.admin.v2.Cluster.State getState() { - @SuppressWarnings("deprecation") - com.google.bigtable.admin.v2.Cluster.State result = - com.google.bigtable.admin.v2.Cluster.State.valueOf(state_); - return result == null ? com.google.bigtable.admin.v2.Cluster.State.UNRECOGNIZED : result; + 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; } + /** * * *
    -     * The current state of the cluster.
    +     * Configuration for this 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. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - public Builder setState(com.google.bigtable.admin.v2.Cluster.State value) { - if (value == null) { - throw new NullPointerException(); + 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); + } } - - state_ = value.getNumber(); - onChanged(); + configCase_ = 7; return this; } + /** * * *
    -     * The current state of the cluster.
    +     * Configuration for this cluster.
          * 
    * - * - * .google.bigtable.admin.v2.Cluster.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - public Builder clearState() { - - state_ = 0; - onChanged(); + 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; } - private int serveNodes_; /** * * *
    -     * Required. The number of nodes allocated to this cluster. More nodes enable
    -     * higher throughput and more consistent performance.
    +     * Configuration for this cluster.
          * 
    * - * int32 serve_nodes = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The serveNodes. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - @java.lang.Override - public int getServeNodes() { - return serveNodes_; + public com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder getClusterConfigBuilder() { + return internalGetClusterConfigFieldBuilder().getBuilder(); } + /** * * *
    -     * Required. The number of nodes allocated to this cluster. More nodes enable
    -     * higher throughput and more consistent performance.
    +     * Configuration for this cluster.
          * 
    * - * int32 serve_nodes = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The serveNodes to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - public Builder setServeNodes(int value) { - - serveNodes_ = value; - onChanged(); - return this; + @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(); + } } + /** * * *
    -     * Required. The number of nodes allocated to this cluster. More nodes enable
    -     * higher throughput and more consistent performance.
    +     * Configuration for this cluster.
          * 
    * - * int32 serve_nodes = 4 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. + * .google.bigtable.admin.v2.Cluster.ClusterConfig cluster_config = 7; */ - public Builder clearServeNodes() { - - serveNodes_ = 0; + 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 this; + return clusterConfigBuilder_; } private int defaultStorageType_ = 0; + /** * * *
    -     * (`CreationOnly`)
    -     * The type of storage used by this cluster to serve its
    +     * 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.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return The enum numeric value on the wire for defaultStorageType. */ @@ -2171,56 +4789,61 @@ public Builder clearServeNodes() { public int getDefaultStorageTypeValue() { return defaultStorageType_; } + /** * * *
    -     * (`CreationOnly`)
    -     * The type of storage used by this cluster to serve its
    +     * 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.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; } + /** * * *
    -     * (`CreationOnly`)
    -     * The type of storage used by this cluster to serve its
    +     * 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.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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.StorageType result = - com.google.bigtable.admin.v2.StorageType.valueOf(defaultStorageType_); + com.google.bigtable.admin.v2.StorageType.forNumber(defaultStorageType_); return result == null ? com.google.bigtable.admin.v2.StorageType.UNRECOGNIZED : result; } + /** * * *
    -     * (`CreationOnly`)
    -     * The type of storage used by this cluster to serve its
    +     * 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.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @param value The defaultStorageType to set. * @return This builder for chaining. @@ -2229,37 +4852,40 @@ public Builder setDefaultStorageType(com.google.bigtable.admin.v2.StorageType va if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000040; defaultStorageType_ = value.getNumber(); onChanged(); return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * The type of storage used by this cluster to serve its
    +     * 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.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.SingleFieldBuilderV3< + 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_; + /** * * @@ -2274,8 +4900,9 @@ public Builder clearDefaultStorageType() { * @return Whether the encryptionConfig field is set. */ public boolean hasEncryptionConfig() { - return encryptionConfigBuilder_ != null || encryptionConfig_ != null; + return ((bitField0_ & 0x00000080) != 0); } + /** * * @@ -2298,6 +4925,7 @@ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig return encryptionConfigBuilder_.getMessage(); } } + /** * * @@ -2316,13 +4944,14 @@ public Builder setEncryptionConfig( throw new NullPointerException(); } encryptionConfig_ = value; - onChanged(); } else { encryptionConfigBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2338,13 +4967,14 @@ public Builder setEncryptionConfig( com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder builderForValue) { if (encryptionConfigBuilder_ == null) { encryptionConfig_ = builderForValue.build(); - onChanged(); } else { encryptionConfigBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } + /** * * @@ -2359,21 +4989,24 @@ public Builder setEncryptionConfig( public Builder mergeEncryptionConfig( com.google.bigtable.admin.v2.Cluster.EncryptionConfig value) { if (encryptionConfigBuilder_ == null) { - if (encryptionConfig_ != null) { - encryptionConfig_ = - com.google.bigtable.admin.v2.Cluster.EncryptionConfig.newBuilder(encryptionConfig_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000080) != 0) + && encryptionConfig_ != null + && encryptionConfig_ + != com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance()) { + getEncryptionConfigBuilder().mergeFrom(value); } else { encryptionConfig_ = value; } - onChanged(); } else { encryptionConfigBuilder_.mergeFrom(value); } - + if (encryptionConfig_ != null) { + bitField0_ |= 0x00000080; + onChanged(); + } return this; } + /** * * @@ -2386,16 +5019,16 @@ public Builder mergeEncryptionConfig( *
    */ public Builder clearEncryptionConfig() { - if (encryptionConfigBuilder_ == null) { - encryptionConfig_ = null; - onChanged(); - } else { - encryptionConfig_ = null; + bitField0_ = (bitField0_ & ~0x00000080); + encryptionConfig_ = null; + if (encryptionConfigBuilder_ != null) { + encryptionConfigBuilder_.dispose(); encryptionConfigBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -2409,10 +5042,11 @@ public Builder clearEncryptionConfig() { */ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder getEncryptionConfigBuilder() { - + bitField0_ |= 0x00000080; onChanged(); - return getEncryptionConfigFieldBuilder().getBuilder(); + return internalGetEncryptionConfigFieldBuilder().getBuilder(); } + /** * * @@ -2434,6 +5068,7 @@ public Builder clearEncryptionConfig() { : encryptionConfig_; } } + /** * * @@ -2445,14 +5080,14 @@ public Builder clearEncryptionConfig() { * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; *
    */ - private com.google.protobuf.SingleFieldBuilderV3< + 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> - getEncryptionConfigFieldBuilder() { + internalGetEncryptionConfigFieldBuilder() { if (encryptionConfigBuilder_ == null) { encryptionConfigBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + 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>( @@ -2462,17 +5097,6 @@ public Builder clearEncryptionConfig() { return encryptionConfigBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster) } @@ -2494,7 +5118,18 @@ public Cluster parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Cluster(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java index cb1ad093ba..52f98c06f4 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { ClusterName that = ((ClusterName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) @@ -211,9 +211,9 @@ public Builder setCluster(String cluster) { } private Builder(ClusterName clusterName) { - project = clusterName.project; - instance = clusterName.instance; - cluster = clusterName.cluster; + this.project = clusterName.project; + this.instance = clusterName.instance; + this.cluster = clusterName.cluster; } public ClusterName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java index d234c3f06e..627d2af276 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -31,11 +34,12 @@ public interface ClusterOrBuilder * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. *
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ java.lang.String getName(); + /** * * @@ -44,7 +48,7 @@ public interface ClusterOrBuilder * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. *
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -54,30 +58,33 @@ public interface ClusterOrBuilder * * *
    -   * (`CreationOnly`)
    -   * The location where this cluster's nodes and storage reside. For best
    -   * performance, clients should be located as close as possible to 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.resource_reference) = { ... } + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * * * @return The location. */ java.lang.String getLocation(); + /** * * *
    -   * (`CreationOnly`)
    -   * The location where this cluster's nodes and storage reside. For best
    -   * performance, clients should be located as close as possible to 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.resource_reference) = { ... } + * + * string location = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * * * @return The bytes for location. */ @@ -87,7 +94,7 @@ public interface ClusterOrBuilder * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -97,11 +104,12 @@ public interface ClusterOrBuilder * @return The enum numeric value on the wire for state. */ int getStateValue(); + /** * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -116,11 +124,12 @@ public interface ClusterOrBuilder * * *
    -   * Required. The number of nodes allocated to this cluster. More nodes enable
    -   * higher throughput and more consistent performance.
    +   * 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 [(.google.api.field_behavior) = REQUIRED]; + * int32 serve_nodes = 4; * * @return The serveNodes. */ @@ -130,26 +139,96 @@ public interface ClusterOrBuilder * * *
    -   * (`CreationOnly`)
    -   * The type of storage used by this cluster to serve its
    +   * 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.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(); + /** * * *
    -   * (`CreationOnly`)
    -   * The type of storage used by this cluster to serve its
    +   * 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.bigtable.admin.v2.StorageType default_storage_type = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return The defaultStorageType. */ @@ -169,6 +248,7 @@ public interface ClusterOrBuilder * @return Whether the encryptionConfig field is set. */ boolean hasEncryptionConfig(); + /** * * @@ -183,6 +263,7 @@ public interface ClusterOrBuilder * @return The encryptionConfig. */ com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig(); + /** * * @@ -195,4 +276,6 @@ public interface ClusterOrBuilder *
    */ com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); + + com.google.bigtable.admin.v2.Cluster.ConfigCase getConfigCase(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java index 9a9570e87d..370ad98c49 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamily.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,81 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.ColumnFamily} */ -public final class ColumnFamily extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use ColumnFamily.newBuilder() to construct. - private ColumnFamily(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ColumnFamily() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ColumnFamily(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ColumnFamily"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use ColumnFamily.newBuilder() to construct. + private ColumnFamily(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private ColumnFamily( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.GcRule.Builder subBuilder = null; - if (gcRule_ != null) { - subBuilder = gcRule_.toBuilder(); - } - gcRule_ = - input.readMessage( - com.google.bigtable.admin.v2.GcRule.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(gcRule_); - gcRule_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private ColumnFamily() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto @@ -109,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable @@ -118,14 +68,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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.
    @@ -137,14 +90,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        */
       @java.lang.Override
       public boolean hasGcRule() {
    -    return gcRule_ != null;
    +    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.
    @@ -158,12 +113,14 @@ public boolean hasGcRule() {
       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.
    @@ -173,7 +130,83 @@ public com.google.bigtable.admin.v2.GcRule getGcRule() {
        */
       @java.lang.Override
       public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() {
    -    return getGcRule();
    +    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; @@ -190,10 +223,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (gcRule_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getGcRule()); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getValueType()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -202,10 +238,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (gcRule_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGcRule()); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getValueType()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -225,7 +264,11 @@ public boolean equals(final java.lang.Object obj) { if (hasGcRule()) { if (!getGcRule().equals(other.getGcRule())) return false; } - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -240,7 +283,11 @@ public int hashCode() { hash = (37 * hash) + GC_RULE_FIELD_NUMBER; hash = (53 * hash) + getGcRule().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + if (hasValueType()) { + hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getValueType().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -282,38 +329,38 @@ public static com.google.bigtable.admin.v2.ColumnFamily parseFrom( public static com.google.bigtable.admin.v2.ColumnFamily parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -336,10 +383,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -349,7 +397,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.ColumnFamily} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -359,7 +407,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable @@ -373,24 +421,32 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetGcRuleFieldBuilder(); + internalGetValueTypeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (gcRuleBuilder_ == null) { - gcRule_ = null; - } else { - gcRule_ = null; + bitField0_ = 0; + gcRule_ = null; + if (gcRuleBuilder_ != null) { + gcRuleBuilder_.dispose(); gcRuleBuilder_ = null; } + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } return this; } @@ -418,46 +474,25 @@ public com.google.bigtable.admin.v2.ColumnFamily build() { public com.google.bigtable.admin.v2.ColumnFamily buildPartial() { com.google.bigtable.admin.v2.ColumnFamily result = new com.google.bigtable.admin.v2.ColumnFamily(this); - if (gcRuleBuilder_ == null) { - result.gcRule_ = gcRule_; - } else { - result.gcRule_ = gcRuleBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -475,7 +510,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ColumnFamily other) { if (other.hasGcRule()) { mergeGcRule(other.getGcRule()); } - this.mergeUnknownFields(other.unknownFields); + if (other.hasValueType()) { + mergeValueType(other.getValueType()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -490,32 +528,63 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ColumnFamily parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.ColumnFamily) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.GcRule gcRule_; - private com.google.protobuf.SingleFieldBuilderV3< + 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.
    @@ -526,14 +595,16 @@ public Builder mergeFrom(
          * @return Whether the gcRule field is set.
          */
         public boolean hasGcRule() {
    -      return gcRuleBuilder_ != null || gcRule_ != null;
    +      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.
    @@ -550,12 +621,14 @@ public com.google.bigtable.admin.v2.GcRule getGcRule() {
             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.
    @@ -569,19 +642,21 @@ public Builder setGcRule(com.google.bigtable.admin.v2.GcRule value) {
               throw new NullPointerException();
             }
             gcRule_ = value;
    -        onChanged();
           } 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.
    @@ -592,19 +667,21 @@ public Builder setGcRule(com.google.bigtable.admin.v2.GcRule value) {
         public Builder setGcRule(com.google.bigtable.admin.v2.GcRule.Builder builderForValue) {
           if (gcRuleBuilder_ == null) {
             gcRule_ = builderForValue.build();
    -        onChanged();
           } 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.
    @@ -614,27 +691,30 @@ public Builder setGcRule(com.google.bigtable.admin.v2.GcRule.Builder builderForV
          */
         public Builder mergeGcRule(com.google.bigtable.admin.v2.GcRule value) {
           if (gcRuleBuilder_ == null) {
    -        if (gcRule_ != null) {
    -          gcRule_ =
    -              com.google.bigtable.admin.v2.GcRule.newBuilder(gcRule_)
    -                  .mergeFrom(value)
    -                  .buildPartial();
    +        if (((bitField0_ & 0x00000001) != 0)
    +            && gcRule_ != null
    +            && gcRule_ != com.google.bigtable.admin.v2.GcRule.getDefaultInstance()) {
    +          getGcRuleBuilder().mergeFrom(value);
             } else {
               gcRule_ = value;
             }
    -        onChanged();
           } 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.
    @@ -643,22 +723,23 @@ public Builder mergeGcRule(com.google.bigtable.admin.v2.GcRule value) {
          * .google.bigtable.admin.v2.GcRule gc_rule = 1;
          */
         public Builder clearGcRule() {
    -      if (gcRuleBuilder_ == null) {
    -        gcRule_ = null;
    -        onChanged();
    -      } else {
    -        gcRule_ = null;
    +      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.
    @@ -667,16 +748,18 @@ public Builder clearGcRule() {
          * .google.bigtable.admin.v2.GcRule gc_rule = 1;
          */
         public com.google.bigtable.admin.v2.GcRule.Builder getGcRuleBuilder() {
    -
    +      bitField0_ |= 0x00000001;
           onChanged();
    -      return getGcRuleFieldBuilder().getBuilder();
    +      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.
    @@ -691,12 +774,14 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() {
             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.
    @@ -704,14 +789,14 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() {
          *
          * .google.bigtable.admin.v2.GcRule gc_rule = 1;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.bigtable.admin.v2.GcRule,
                 com.google.bigtable.admin.v2.GcRule.Builder,
                 com.google.bigtable.admin.v2.GcRuleOrBuilder>
    -        getGcRuleFieldBuilder() {
    +        internalGetGcRuleFieldBuilder() {
           if (gcRuleBuilder_ == null) {
             gcRuleBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.bigtable.admin.v2.GcRule,
                     com.google.bigtable.admin.v2.GcRule.Builder,
                     com.google.bigtable.admin.v2.GcRuleOrBuilder>(
    @@ -721,15 +806,279 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() {
           return gcRuleBuilder_;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    +    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); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -753,7 +1102,18 @@ public ColumnFamily parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ColumnFamily(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java index 73a9995428..27e90d41e5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ColumnFamilyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -29,6 +32,7 @@ public interface ColumnFamilyOrBuilder *
        * 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.
    @@ -39,12 +43,14 @@ public interface ColumnFamilyOrBuilder
        * @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.
    @@ -55,12 +61,14 @@ public interface ColumnFamilyOrBuilder
        * @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.
    @@ -69,4 +77,68 @@ public interface ColumnFamilyOrBuilder
        * .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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java index e51426737e..72e6d4f67e 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CommonProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class CommonProto { +@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) { @@ -29,7 +42,7 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_OperationProgress_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -40,20 +53,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n%google/bigtable/admin/v2/common.proto\022" - + "\030google.bigtable.admin.v2\032\037google/protob" - + "uf/timestamp.proto\"\213\001\n\021OperationProgress" - + "\022\030\n\020progress_percent\030\001 \001(\005\022.\n\nstart_time" - + "\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n\010en" - + "d_time\030\003 \001(\0132\032.google.protobuf.Timestamp" - + "*=\n\013StorageType\022\034\n\030STORAGE_TYPE_UNSPECIF" - + "IED\020\000\022\007\n\003SSD\020\001\022\007\n\003HDD\020\002B\323\001\n\034com.google.b" - + "igtable.admin.v2B\013CommonProtoP\001Z=google." - + "golang.org/genproto/googleapis/bigtable/" - + "admin/v2;admin\252\002\036Google.Cloud.Bigtable.A" - + "dmin.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2" - + "\352\002\"Google::Cloud::Bigtable::Admin::V2b\006p" - + "roto3" + "\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( @@ -62,13 +77,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_bigtable_admin_v2_OperationProgress_descriptor = - getDescriptor().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadata.java new file mode 100644 index 0000000000..9f79121053 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadataOrBuilder.java new file mode 100644 index 0000000000..c0b21ff131 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequest.java new file mode 100644 index 0000000000..318635e846 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequestOrBuilder.java new file mode 100644 index 0000000000..489d954fae --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java index 298de40aa0..afd6f44364 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateAppProfileRequest} */ -public final class CreateAppProfileRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CreateAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,96 +56,13 @@ private CreateAppProfileRequest() { appProfileId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateAppProfileRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateAppProfileRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - appProfileId_ = s; - break; - } - case 26: - { - com.google.bigtable.admin.v2.AppProfile.Builder subBuilder = null; - if (appProfile_ != null) { - subBuilder = appProfile_.toBuilder(); - } - appProfile_ = - input.readMessage( - com.google.bigtable.admin.v2.AppProfile.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(appProfile_); - appProfile_ = subBuilder.buildPartial(); - } - - break; - } - case 32: - { - ignoreWarnings_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable @@ -140,15 +71,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.CreateAppProfileRequest.Builder.class); } + private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @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}`.
    +   * Required. The unique name of the instance in which to create the new app
    +   * profile. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -169,13 +103,13 @@ public java.lang.String getParent() { 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}`.
    +   * Required. The unique name of the instance in which to create the new app
    +   * profile. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -198,13 +132,16 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int APP_PROFILE_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object appProfileId_; + + @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
    +   * 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`.
        * 
    * @@ -224,12 +161,13 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * *
    -   * Required. The ID to be used when referring to the new app profile within its
    -   * instance, e.g., just `myprofile` rather than
    +   * 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`.
        * 
    * @@ -252,6 +190,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { public static final int APP_PROFILE_FIELD_NUMBER = 3; private com.google.bigtable.admin.v2.AppProfile appProfile_; + /** * * @@ -268,8 +207,9 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { */ @java.lang.Override public boolean hasAppProfile() { - return appProfile_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -290,6 +230,7 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile() { ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() : appProfile_; } + /** * * @@ -304,11 +245,14 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile() { */ @java.lang.Override public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() { - return getAppProfile(); + return appProfile_ == null + ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() + : appProfile_; } public static final int IGNORE_WARNINGS_FIELD_NUMBER = 4; - private boolean ignoreWarnings_; + private boolean ignoreWarnings_ = false; + /** * * @@ -339,19 +283,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, appProfileId_); } - if (appProfile_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getAppProfile()); } if (ignoreWarnings_ != false) { output.writeBool(4, ignoreWarnings_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -360,19 +304,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, appProfileId_); } - if (appProfile_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAppProfile()); } if (ignoreWarnings_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, ignoreWarnings_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -395,7 +339,7 @@ public boolean equals(final java.lang.Object obj) { if (!getAppProfile().equals(other.getAppProfile())) return false; } if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -416,7 +360,7 @@ public int hashCode() { } hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -458,38 +402,38 @@ public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( public static com.google.bigtable.admin.v2.CreateAppProfileRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -512,10 +456,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -525,7 +470,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateAppProfileRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -535,7 +480,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateAppProfileRequest_fieldAccessorTable @@ -549,30 +494,29 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAppProfileFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - appProfileId_ = ""; - - if (appProfileBuilder_ == null) { - appProfile_ = null; - } else { - appProfile_ = null; + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); appProfileBuilder_ = null; } ignoreWarnings_ = false; - return this; } @@ -600,49 +544,30 @@ public com.google.bigtable.admin.v2.CreateAppProfileRequest build() { public com.google.bigtable.admin.v2.CreateAppProfileRequest buildPartial() { com.google.bigtable.admin.v2.CreateAppProfileRequest result = new com.google.bigtable.admin.v2.CreateAppProfileRequest(this); - result.parent_ = parent_; - result.appProfileId_ = appProfileId_; - if (appProfileBuilder_ == null) { - result.appProfile_ = appProfile_; - } else { - result.appProfile_ = appProfileBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.ignoreWarnings_ = ignoreWarnings_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -660,10 +585,12 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAppProfileRequest ot 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()) { @@ -672,7 +599,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateAppProfileRequest ot if (other.getIgnoreWarnings() != false) { setIgnoreWarnings(other.getIgnoreWarnings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -687,29 +614,69 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateAppProfileRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateAppProfileRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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}`.
    +     * Required. The unique name of the instance in which to create the new app
    +     * profile. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -729,13 +696,13 @@ public java.lang.String getParent() { 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}`.
    +     * Required. The unique name of the instance in which to create the new app
    +     * profile. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -755,13 +722,13 @@ public com.google.protobuf.ByteString getParentBytes() { 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}`.
    +     * Required. The unique name of the instance in which to create the new app
    +     * profile. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -775,18 +742,18 @@ 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}`.
    +     * Required. The unique name of the instance in which to create the new app
    +     * profile. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -796,18 +763,18 @@ public Builder setParent(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the instance in which to create the new app
    +     * profile. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -822,19 +789,20 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { 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
    +     * 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`.
          * 
    * @@ -853,12 +821,13 @@ public java.lang.String getAppProfileId() { 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
    +     * 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`.
          * 
    * @@ -877,12 +846,13 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { 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
    +     * 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`.
          * 
    * @@ -895,17 +865,18 @@ 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
    +     * 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`.
          * 
    * @@ -914,17 +885,18 @@ public Builder setAppProfileId(java.lang.String value) { * @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
    +     * 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`.
          * 
    * @@ -938,18 +910,19 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.bigtable.admin.v2.AppProfile appProfile_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -965,8 +938,9 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * @return Whether the appProfile field is set. */ public boolean hasAppProfile() { - return appProfileBuilder_ != null || appProfile_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -990,6 +964,7 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile() { return appProfileBuilder_.getMessage(); } } + /** * * @@ -1008,13 +983,14 @@ public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile value) { throw new NullPointerException(); } appProfile_ = value; - onChanged(); } else { appProfileBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1030,13 +1006,14 @@ public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile value) { public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { if (appProfileBuilder_ == null) { appProfile_ = builderForValue.build(); - onChanged(); } else { appProfileBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1051,21 +1028,23 @@ public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile.Builder bui */ public Builder mergeAppProfile(com.google.bigtable.admin.v2.AppProfile value) { if (appProfileBuilder_ == null) { - if (appProfile_ != null) { - appProfile_ = - com.google.bigtable.admin.v2.AppProfile.newBuilder(appProfile_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && appProfile_ != null + && appProfile_ != com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()) { + getAppProfileBuilder().mergeFrom(value); } else { appProfile_ = value; } - onChanged(); } else { appProfileBuilder_.mergeFrom(value); } - + if (appProfile_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1079,16 +1058,16 @@ public Builder mergeAppProfile(com.google.bigtable.admin.v2.AppProfile value) { *
    */ public Builder clearAppProfile() { - if (appProfileBuilder_ == null) { - appProfile_ = null; - onChanged(); - } else { - appProfile_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); appProfileBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1102,10 +1081,11 @@ public Builder clearAppProfile() { *
    */ public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfileBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getAppProfileFieldBuilder().getBuilder(); + return internalGetAppProfileFieldBuilder().getBuilder(); } + /** * * @@ -1127,6 +1107,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() : appProfile_; } } + /** * * @@ -1139,14 +1120,14 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() * .google.bigtable.admin.v2.AppProfile app_profile = 3 [(.google.api.field_behavior) = REQUIRED]; *
    */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder> - getAppProfileFieldBuilder() { + internalGetAppProfileFieldBuilder() { if (appProfileBuilder_ == null) { appProfileBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder>( @@ -1157,6 +1138,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() } private boolean ignoreWarnings_; + /** * * @@ -1172,6 +1154,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() public boolean getIgnoreWarnings() { return ignoreWarnings_; } + /** * * @@ -1187,9 +1170,11 @@ public boolean getIgnoreWarnings() { public Builder setIgnoreWarnings(boolean value) { ignoreWarnings_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1202,23 +1187,12 @@ public Builder setIgnoreWarnings(boolean value) { * @return This builder for chaining. */ public Builder clearIgnoreWarnings() { - + bitField0_ = (bitField0_ & ~0x00000008); ignoreWarnings_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateAppProfileRequest) } @@ -1240,7 +1214,18 @@ public CreateAppProfileRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateAppProfileRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java index 65d15a68b3..575ca88380 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAppProfileRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,9 +30,8 @@ public interface CreateAppProfileRequestOrBuilder * * *
    -   * Required. The unique name of the instance in which to create the new app profile.
    -   * Values are of the form
    -   * `projects/{project}/instances/{instance}`.
    +   * Required. The unique name of the instance in which to create the new app
    +   * profile. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -39,13 +41,13 @@ public interface CreateAppProfileRequestOrBuilder * @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}`.
    +   * Required. The unique name of the instance in which to create the new app
    +   * profile. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -60,8 +62,8 @@ public interface CreateAppProfileRequestOrBuilder * * *
    -   * Required. The ID to be used when referring to the new app profile within its
    -   * instance, e.g., just `myprofile` rather than
    +   * 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`.
        * 
    * @@ -70,12 +72,13 @@ public interface CreateAppProfileRequestOrBuilder * @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
    +   * 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`.
        * 
    * @@ -100,6 +103,7 @@ public interface CreateAppProfileRequestOrBuilder * @return Whether the appProfile field is set. */ boolean hasAppProfile(); + /** * * @@ -115,6 +119,7 @@ public interface CreateAppProfileRequestOrBuilder * @return The appProfile. */ com.google.bigtable.admin.v2.AppProfile getAppProfile(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadata.java new file mode 100644 index 0000000000..baca5f4496 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadataOrBuilder.java new file mode 100644 index 0000000000..5d8425dac5 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequest.java new file mode 100644 index 0000000000..28b9f673a2 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequestOrBuilder.java new file mode 100644 index 0000000000..873ef940b3 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java index 5270f2e383..bae564abc0 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateBackupMetadata} */ -public final class CreateBackupMetadata extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CreateBackupMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,105 +57,13 @@ private CreateBackupMetadata() { sourceTable_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateBackupMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateBackupMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - sourceTable_ = s; - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_fieldAccessorTable @@ -150,8 +72,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.CreateBackupMetadata.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -175,6 +101,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -200,7 +127,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int SOURCE_TABLE_FIELD_NUMBER = 2; - private volatile java.lang.Object sourceTable_; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceTable_ = ""; + /** * * @@ -224,6 +154,7 @@ public java.lang.String getSourceTable() { return s; } } + /** * * @@ -250,6 +181,7 @@ public com.google.protobuf.ByteString getSourceTableBytes() { public static final int START_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp startTime_; + /** * * @@ -263,8 +195,9 @@ public com.google.protobuf.ByteString getSourceTableBytes() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -280,6 +213,7 @@ public boolean hasStartTime() { public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } + /** * * @@ -291,11 +225,12 @@ public com.google.protobuf.Timestamp getStartTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 4; private com.google.protobuf.Timestamp endTime_; + /** * * @@ -309,8 +244,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -326,6 +262,7 @@ public boolean hasEndTime() { public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } + /** * * @@ -337,7 +274,7 @@ public com.google.protobuf.Timestamp getEndTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } private byte memoizedIsInitialized = -1; @@ -354,19 +291,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!getSourceTableBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceTable_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, sourceTable_); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(4, getEndTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -375,19 +312,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!getSourceTableBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceTable_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceTable_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sourceTable_); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEndTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -413,7 +350,7 @@ public boolean equals(final java.lang.Object obj) { if (hasEndTime()) { if (!getEndTime().equals(other.getEndTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -436,7 +373,7 @@ public int hashCode() { hash = (37 * hash) + END_TIME_FIELD_NUMBER; hash = (53 * hash) + getEndTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -478,38 +415,38 @@ public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( public static com.google.bigtable.admin.v2.CreateBackupMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -532,10 +469,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -546,7 +484,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateBackupMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -556,7 +494,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateBackupMetadata_fieldAccessorTable @@ -570,32 +508,32 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - sourceTable_ = ""; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } return this; @@ -625,53 +563,31 @@ public com.google.bigtable.admin.v2.CreateBackupMetadata build() { public com.google.bigtable.admin.v2.CreateBackupMetadata buildPartial() { com.google.bigtable.admin.v2.CreateBackupMetadata result = new com.google.bigtable.admin.v2.CreateBackupMetadata(this); - result.name_ = name_; - result.sourceTable_ = sourceTable_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -689,10 +605,12 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateBackupMetadata other 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()) { @@ -701,7 +619,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateBackupMetadata other if (other.hasEndTime()) { mergeEndTime(other.getEndTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -716,22 +634,63 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateBackupMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateBackupMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -754,6 +713,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -776,6 +736,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -792,11 +753,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -809,11 +771,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -831,13 +794,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object sourceTable_ = ""; + /** * * @@ -860,6 +824,7 @@ public java.lang.String getSourceTable() { return (java.lang.String) ref; } } + /** * * @@ -882,6 +847,7 @@ public com.google.protobuf.ByteString getSourceTableBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -898,11 +864,12 @@ public Builder setSourceTable(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceTable_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -915,11 +882,12 @@ public Builder setSourceTable(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSourceTable() { - sourceTable_ = getDefaultInstance().getSourceTable(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -937,18 +905,19 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sourceTable_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** * * @@ -961,8 +930,9 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { * @return Whether the startTime field is set. */ public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -981,6 +951,7 @@ public com.google.protobuf.Timestamp getStartTime() { return startTimeBuilder_.getMessage(); } } + /** * * @@ -996,13 +967,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1015,13 +987,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); - onChanged(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1033,19 +1006,23 @@ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } - onChanged(); } else { startTimeBuilder_.mergeFrom(value); } - + if (startTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1056,16 +1033,16 @@ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp start_time = 3; */ public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1076,10 +1053,11 @@ public Builder clearStartTime() { * .google.protobuf.Timestamp start_time = 3; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getStartTimeFieldBuilder().getBuilder(); + return internalGetStartTimeFieldBuilder().getBuilder(); } + /** * * @@ -1096,6 +1074,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } + /** * * @@ -1105,14 +1084,14 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * * .google.protobuf.Timestamp start_time = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { + internalGetStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1123,11 +1102,12 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { } private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** * * @@ -1140,8 +1120,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * @return Whether the endTime field is set. */ public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1160,6 +1141,7 @@ public com.google.protobuf.Timestamp getEndTime() { return endTimeBuilder_.getMessage(); } } + /** * * @@ -1175,13 +1157,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1194,13 +1177,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); - onChanged(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1212,19 +1196,23 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } - onChanged(); } else { endTimeBuilder_.mergeFrom(value); } - + if (endTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1235,16 +1223,16 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp end_time = 4; */ public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1255,10 +1243,11 @@ public Builder clearEndTime() { * .google.protobuf.Timestamp end_time = 4; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getEndTimeFieldBuilder().getBuilder(); + return internalGetEndTimeFieldBuilder().getBuilder(); } + /** * * @@ -1275,6 +1264,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } + /** * * @@ -1284,14 +1274,14 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { * * .google.protobuf.Timestamp end_time = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { + internalGetEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1301,17 +1291,6 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTimeBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateBackupMetadata) } @@ -1333,7 +1312,18 @@ public CreateBackupMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateBackupMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java index 6742786b2a..f18184b8e1 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface CreateBackupMetadataOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,6 +64,7 @@ public interface CreateBackupMetadataOrBuilder * @return The sourceTable. */ java.lang.String getSourceTable(); + /** * * @@ -85,6 +90,7 @@ public interface CreateBackupMetadataOrBuilder * @return Whether the startTime field is set. */ boolean hasStartTime(); + /** * * @@ -97,6 +103,7 @@ public interface CreateBackupMetadataOrBuilder * @return The startTime. */ com.google.protobuf.Timestamp getStartTime(); + /** * * @@ -120,6 +127,7 @@ public interface CreateBackupMetadataOrBuilder * @return Whether the endTime field is set. */ boolean hasEndTime(); + /** * * @@ -132,6 +140,7 @@ public interface CreateBackupMetadataOrBuilder * @return The endTime. */ com.google.protobuf.Timestamp getEndTime(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java index 708a5ba1ba..d051bfb93c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -22,18 +24,31 @@ * * *
    - * The request for [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
    + * The request for
    + * [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
      * 
    * * Protobuf type {@code google.bigtable.admin.v2.CreateBackupRequest} */ -public final class CreateBackupRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CreateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,91 +57,13 @@ private CreateBackupRequest() { backupId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateBackupRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateBackupRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - backupId_ = s; - break; - } - case 26: - { - com.google.bigtable.admin.v2.Backup.Builder subBuilder = null; - if (backup_ != null) { - subBuilder = backup_.toBuilder(); - } - backup_ = - input.readMessage( - com.google.bigtable.admin.v2.Backup.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(backup_); - backup_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateBackupRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateBackupRequest_fieldAccessorTable @@ -135,8 +72,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.CreateBackupRequest.Builder.class); } + private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * @@ -164,6 +105,7 @@ public java.lang.String getParent() { return s; } } + /** * * @@ -193,7 +135,10 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int BACKUP_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object backupId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object backupId_ = ""; + /** * * @@ -222,6 +167,7 @@ public java.lang.String getBackupId() { return s; } } + /** * * @@ -253,6 +199,7 @@ public com.google.protobuf.ByteString getBackupIdBytes() { public static final int BACKUP_FIELD_NUMBER = 3; private com.google.bigtable.admin.v2.Backup backup_; + /** * * @@ -267,8 +214,9 @@ public com.google.protobuf.ByteString getBackupIdBytes() { */ @java.lang.Override public boolean hasBackup() { - return backup_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -285,6 +233,7 @@ public boolean hasBackup() { public com.google.bigtable.admin.v2.Backup getBackup() { return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; } + /** * * @@ -297,7 +246,7 @@ public com.google.bigtable.admin.v2.Backup getBackup() { */ @java.lang.Override public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { - return getBackup(); + return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; } private byte memoizedIsInitialized = -1; @@ -314,16 +263,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getBackupIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, backupId_); } - if (backup_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getBackup()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -332,16 +281,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getBackupIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, backupId_); } - if (backup_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackup()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -363,7 +312,7 @@ public boolean equals(final java.lang.Object obj) { if (hasBackup()) { if (!getBackup().equals(other.getBackup())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -382,7 +331,7 @@ public int hashCode() { hash = (37 * hash) + BACKUP_FIELD_NUMBER; hash = (53 * hash) + getBackup().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -424,38 +373,38 @@ public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( public static com.google.bigtable.admin.v2.CreateBackupRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -478,20 +427,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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].
    +   * 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.GeneratedMessageV3.Builder + 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 { @@ -501,7 +452,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateBackupRequest_fieldAccessorTable @@ -515,26 +466,26 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - backupId_ = ""; - - if (backupBuilder_ == null) { - backup_ = null; - } else { - backup_ = null; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); backupBuilder_ = null; } return this; @@ -564,48 +515,27 @@ public com.google.bigtable.admin.v2.CreateBackupRequest build() { public com.google.bigtable.admin.v2.CreateBackupRequest buildPartial() { com.google.bigtable.admin.v2.CreateBackupRequest result = new com.google.bigtable.admin.v2.CreateBackupRequest(this); - result.parent_ = parent_; - result.backupId_ = backupId_; - if (backupBuilder_ == null) { - result.backup_ = backup_; - } else { - result.backup_ = backupBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -623,16 +553,18 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateBackupRequest other) 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -647,21 +579,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateBackupRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.CreateBackupRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * @@ -688,6 +655,7 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * @@ -714,6 +682,7 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -734,11 +703,12 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -755,11 +725,12 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -781,13 +752,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object backupId_ = ""; + /** * * @@ -815,6 +787,7 @@ public java.lang.String getBackupId() { return (java.lang.String) ref; } } + /** * * @@ -842,6 +815,7 @@ public com.google.protobuf.ByteString getBackupIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -863,11 +837,12 @@ public Builder setBackupId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - backupId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -885,11 +860,12 @@ public Builder setBackupId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearBackupId() { - backupId_ = getDefaultInstance().getBackupId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -912,18 +888,19 @@ public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - backupId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.bigtable.admin.v2.Backup backup_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -937,8 +914,9 @@ public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { * @return Whether the backup field is set. */ public boolean hasBackup() { - return backupBuilder_ != null || backup_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -958,6 +936,7 @@ public com.google.bigtable.admin.v2.Backup getBackup() { return backupBuilder_.getMessage(); } } + /** * * @@ -974,13 +953,14 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { throw new NullPointerException(); } backup_ = value; - onChanged(); } else { backupBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -994,13 +974,14 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForValue) { if (backupBuilder_ == null) { backup_ = builderForValue.build(); - onChanged(); } else { backupBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1013,21 +994,23 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForV */ public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { if (backupBuilder_ == null) { - if (backup_ != null) { - backup_ = - com.google.bigtable.admin.v2.Backup.newBuilder(backup_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && backup_ != null + && backup_ != com.google.bigtable.admin.v2.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); } else { backup_ = value; } - onChanged(); } else { backupBuilder_.mergeFrom(value); } - + if (backup_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1039,16 +1022,16 @@ public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { *
    */ public Builder clearBackup() { - if (backupBuilder_ == null) { - backup_ = null; - onChanged(); - } else { - backup_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); backupBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1060,10 +1043,11 @@ public Builder clearBackup() { *
    */ public com.google.bigtable.admin.v2.Backup.Builder getBackupBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getBackupFieldBuilder().getBuilder(); + return internalGetBackupFieldBuilder().getBuilder(); } + /** * * @@ -1081,6 +1065,7 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; } } + /** * * @@ -1091,14 +1076,14 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { * .google.bigtable.admin.v2.Backup backup = 3 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder> - getBackupFieldBuilder() { + internalGetBackupFieldBuilder() { if (backupBuilder_ == null) { backupBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder>( @@ -1108,17 +1093,6 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { return backupBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateBackupRequest) } @@ -1140,7 +1114,18 @@ public CreateBackupRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateBackupRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java index 0f6ef2b786..14c62ca752 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateBackupRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -39,6 +42,7 @@ public interface CreateBackupRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * @@ -73,6 +77,7 @@ public interface CreateBackupRequestOrBuilder * @return The backupId. */ java.lang.String getBackupId(); + /** * * @@ -104,6 +109,7 @@ public interface CreateBackupRequestOrBuilder * @return Whether the backup field is set. */ boolean hasBackup(); + /** * * @@ -117,6 +123,7 @@ public interface CreateBackupRequestOrBuilder * @return The backup. */ com.google.bigtable.admin.v2.Backup getBackup(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java index 33fa55fa22..3d5740ef22 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,130 +29,1031 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateClusterMetadata} */ -public final class CreateClusterMetadata extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + 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 - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateClusterMetadata(); + 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 - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + 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); } - private CreateClusterMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { + 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: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.CreateClusterRequest.Builder subBuilder = null; - if (originalRequest_ != null) { - subBuilder = originalRequest_.toBuilder(); - } - originalRequest_ = - input.readMessage( - com.google.bigtable.admin.v2.CreateClusterRequest.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(originalRequest_); - originalRequest_ = subBuilder.buildPartial(); - } + return STATE_UNSPECIFIED; + case 1: + return PENDING; + case 2: + return COPYING; + case 3: + return COMPLETED; + case 4: + return CANCELLED; + default: + return null; + } + } - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (requestTime_ != null) { - subBuilder = requestTime_.toBuilder(); - } - requestTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(requestTime_); - requestTime_ = subBuilder.buildPartial(); - } + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } - break; + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (finishTime_ != null) { - subBuilder = finishTime_.toBuilder(); - } - finishTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(finishTime_); - finishTime_ = subBuilder.buildPartial(); - } + }; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + 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; - } + 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; } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.bigtable.admin.v2.BigtableInstanceAdminProto - .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor; - } + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + private static final com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + DEFAULT_INSTANCE; - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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); + 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_; + /** * * @@ -164,8 +1067,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -183,6 +1087,7 @@ public com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest() { ? com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance() : originalRequest_; } + /** * * @@ -194,11 +1099,14 @@ public com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest() { */ @java.lang.Override public com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder getOriginalRequestOrBuilder() { - return getOriginalRequest(); + 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_; + /** * * @@ -212,8 +1120,9 @@ public com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder getOriginalReq */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -229,6 +1138,7 @@ public boolean hasRequestTime() { public com.google.protobuf.Timestamp getRequestTime() { return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } + /** * * @@ -240,11 +1150,12 @@ public com.google.protobuf.Timestamp getRequestTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { - return getRequestTime(); + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } public static final int FINISH_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp finishTime_; + /** * * @@ -258,8 +1169,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -272,21 +1184,185 @@ public boolean hasFinishTime() { * @return The finishTime. */ @java.lang.Override - public com.google.protobuf.Timestamp getFinishTime() { - return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; + 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; } + /** * * *
    -   * The time at which the operation failed or was completed successfully.
    +   * 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.
        * 
    * - * .google.protobuf.Timestamp finish_time = 3; + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * */ @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { - return getFinishTime(); + 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; @@ -303,16 +1379,18 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(3, getFinishTime()); } - unknownFields.writeTo(output); + com.google.protobuf.GeneratedMessage.serializeStringMapTo( + output, internalGetTables(), TablesDefaultEntryHolder.defaultEntry, 4); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -321,16 +1399,29 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); } - size += unknownFields.getSerializedSize(); + 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; } @@ -358,7 +1449,8 @@ public boolean equals(final java.lang.Object obj) { if (hasFinishTime()) { if (!getFinishTime().equals(other.getFinishTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!internalGetTables().equals(other.internalGetTables())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -381,7 +1473,11 @@ public int hashCode() { hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; hash = (53 * hash) + getFinishTime().hashCode(); } - hash = (29 * hash) + unknownFields.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; } @@ -423,38 +1519,38 @@ public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( public static com.google.bigtable.admin.v2.CreateClusterMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -477,10 +1573,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -490,7 +1587,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateClusterMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -499,8 +1596,30 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_fieldAccessorTable @@ -514,36 +1633,39 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - } else { - originalRequest_ = null; + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - if (requestTimeBuilder_ == null) { - requestTime_ = null; - } else { - requestTime_ = null; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - if (finishTimeBuilder_ == null) { - finishTime_ = null; - } else { - finishTime_ = null; + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } + internalGetMutableTables().clear(); return this; } @@ -571,56 +1693,34 @@ public com.google.bigtable.admin.v2.CreateClusterMetadata build() { public com.google.bigtable.admin.v2.CreateClusterMetadata buildPartial() { com.google.bigtable.admin.v2.CreateClusterMetadata result = new com.google.bigtable.admin.v2.CreateClusterMetadata(this); - if (originalRequestBuilder_ == null) { - result.originalRequest_ = originalRequest_; - } else { - result.originalRequest_ = originalRequestBuilder_.build(); - } - if (requestTimeBuilder_ == null) { - result.requestTime_ = requestTime_; - } else { - result.requestTime_ = requestTimeBuilder_.build(); - } - if (finishTimeBuilder_ == null) { - result.finishTime_ = finishTime_; - } else { - result.finishTime_ = finishTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -645,7 +1745,9 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateClusterMetadata othe if (other.hasFinishTime()) { mergeFinishTime(other.getFinishTime()); } - this.mergeUnknownFields(other.unknownFields); + internalGetMutableTables().mergeFrom(other.internalGetTables()); + bitField0_ |= 0x00000008; + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -660,27 +1762,79 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateClusterMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateClusterMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.CreateClusterRequest originalRequest_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -693,8 +1847,9 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -715,6 +1870,7 @@ public com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest() { return originalRequestBuilder_.getMessage(); } } + /** * * @@ -730,13 +1886,14 @@ public Builder setOriginalRequest(com.google.bigtable.admin.v2.CreateClusterRequ throw new NullPointerException(); } originalRequest_ = value; - onChanged(); } else { originalRequestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -750,13 +1907,14 @@ public Builder setOriginalRequest( com.google.bigtable.admin.v2.CreateClusterRequest.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); - onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -768,21 +1926,24 @@ public Builder setOriginalRequest( */ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.CreateClusterRequest value) { if (originalRequestBuilder_ == null) { - if (originalRequest_ != null) { - originalRequest_ = - com.google.bigtable.admin.v2.CreateClusterRequest.newBuilder(originalRequest_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateClusterRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); } else { originalRequest_ = value; } - onChanged(); } else { originalRequestBuilder_.mergeFrom(value); } - + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -793,16 +1954,16 @@ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.CreateClusterRe * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; */ public Builder clearOriginalRequest() { - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - onChanged(); - } else { - originalRequest_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -813,10 +1974,11 @@ public Builder clearOriginalRequest() { * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; */ public com.google.bigtable.admin.v2.CreateClusterRequest.Builder getOriginalRequestBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getOriginalRequestFieldBuilder().getBuilder(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); } + /** * * @@ -836,6 +1998,7 @@ public com.google.bigtable.admin.v2.CreateClusterRequest.Builder getOriginalRequ : originalRequest_; } } + /** * * @@ -845,14 +2008,14 @@ public com.google.bigtable.admin.v2.CreateClusterRequest.Builder getOriginalRequ * * .google.bigtable.admin.v2.CreateClusterRequest original_request = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.CreateClusterRequest, com.google.bigtable.admin.v2.CreateClusterRequest.Builder, com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder> - getOriginalRequestFieldBuilder() { + internalGetOriginalRequestFieldBuilder() { if (originalRequestBuilder_ == null) { originalRequestBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.CreateClusterRequest, com.google.bigtable.admin.v2.CreateClusterRequest.Builder, com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder>( @@ -863,11 +2026,12 @@ public com.google.bigtable.admin.v2.CreateClusterRequest.Builder getOriginalRequ } private com.google.protobuf.Timestamp requestTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> requestTimeBuilder_; + /** * * @@ -880,8 +2044,9 @@ public com.google.bigtable.admin.v2.CreateClusterRequest.Builder getOriginalRequ * @return Whether the requestTime field is set. */ public boolean hasRequestTime() { - return requestTimeBuilder_ != null || requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -902,6 +2067,7 @@ public com.google.protobuf.Timestamp getRequestTime() { return requestTimeBuilder_.getMessage(); } } + /** * * @@ -917,13 +2083,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -936,13 +2103,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (requestTimeBuilder_ == null) { requestTime_ = builderForValue.build(); - onChanged(); } else { requestTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -954,21 +2122,23 @@ public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForVa */ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { if (requestTimeBuilder_ == null) { - if (requestTime_ != null) { - requestTime_ = - com.google.protobuf.Timestamp.newBuilder(requestTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); } else { requestTime_ = value; } - onChanged(); } else { requestTimeBuilder_.mergeFrom(value); } - + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -979,16 +2149,16 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp request_time = 2; */ public Builder clearRequestTime() { - if (requestTimeBuilder_ == null) { - requestTime_ = null; - onChanged(); - } else { - requestTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -999,10 +2169,11 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getRequestTimeFieldBuilder().getBuilder(); + return internalGetRequestTimeFieldBuilder().getBuilder(); } + /** * * @@ -1021,6 +2192,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { : requestTime_; } } + /** * * @@ -1030,14 +2202,14 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * * .google.protobuf.Timestamp request_time = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getRequestTimeFieldBuilder() { + internalGetRequestTimeFieldBuilder() { if (requestTimeBuilder_ == null) { requestTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1048,11 +2220,12 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { } private com.google.protobuf.Timestamp finishTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> finishTimeBuilder_; + /** * * @@ -1065,8 +2238,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * @return Whether the finishTime field is set. */ public boolean hasFinishTime() { - return finishTimeBuilder_ != null || finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1087,6 +2261,7 @@ public com.google.protobuf.Timestamp getFinishTime() { return finishTimeBuilder_.getMessage(); } } + /** * * @@ -1102,13 +2277,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1121,13 +2297,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (finishTimeBuilder_ == null) { finishTime_ = builderForValue.build(); - onChanged(); } else { finishTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1139,19 +2316,23 @@ public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { if (finishTimeBuilder_ == null) { - if (finishTime_ != null) { - finishTime_ = - com.google.protobuf.Timestamp.newBuilder(finishTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); } else { finishTime_ = value; } - onChanged(); } else { finishTimeBuilder_.mergeFrom(value); } - + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1162,16 +2343,16 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp finish_time = 3; */ public Builder clearFinishTime() { - if (finishTimeBuilder_ == null) { - finishTime_ = null; - onChanged(); - } else { - finishTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1182,10 +2363,11 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getFinishTimeFieldBuilder().getBuilder(); + return internalGetFinishTimeFieldBuilder().getBuilder(); } + /** * * @@ -1204,6 +2386,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { : finishTime_; } } + /** * * @@ -1213,14 +2396,14 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { * * .google.protobuf.Timestamp finish_time = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getFinishTimeFieldBuilder() { + internalGetFinishTimeFieldBuilder() { if (finishTimeBuilder_ == null) { finishTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1230,15 +2413,340 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { 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 final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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 final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + 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) @@ -1262,7 +2770,18 @@ public CreateClusterMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateClusterMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java index 8a7b5f1a75..4f2690fc12 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface CreateClusterMetadataOrBuilder * @return Whether the originalRequest field is set. */ boolean hasOriginalRequest(); + /** * * @@ -47,6 +51,7 @@ public interface CreateClusterMetadataOrBuilder * @return The originalRequest. */ com.google.bigtable.admin.v2.CreateClusterRequest getOriginalRequest(); + /** * * @@ -70,6 +75,7 @@ public interface CreateClusterMetadataOrBuilder * @return Whether the requestTime field is set. */ boolean hasRequestTime(); + /** * * @@ -82,6 +88,7 @@ public interface CreateClusterMetadataOrBuilder * @return The requestTime. */ com.google.protobuf.Timestamp getRequestTime(); + /** * * @@ -105,6 +112,7 @@ public interface CreateClusterMetadataOrBuilder * @return Whether the finishTime field is set. */ boolean hasFinishTime(); + /** * * @@ -117,6 +125,7 @@ public interface CreateClusterMetadataOrBuilder * @return The finishTime. */ com.google.protobuf.Timestamp getFinishTime(); + /** * * @@ -127,4 +136,115 @@ public interface CreateClusterMetadataOrBuilder * .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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java index 7576c4739e..0faa4debd0 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateClusterRequest} */ -public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CreateClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,91 +56,13 @@ private CreateClusterRequest() { clusterId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateClusterRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateClusterRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - clusterId_ = s; - break; - } - case 26: - { - com.google.bigtable.admin.v2.Cluster.Builder subBuilder = null; - if (cluster_ != null) { - subBuilder = cluster_.toBuilder(); - } - cluster_ = - input.readMessage( - com.google.bigtable.admin.v2.Cluster.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(cluster_); - cluster_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateClusterRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable @@ -135,15 +71,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.CreateClusterRequest.Builder.class); } + private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @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}`.
    +   * Required. The unique name of the instance in which to create the new
    +   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -164,13 +103,13 @@ public java.lang.String getParent() { 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}`.
    +   * Required. The unique name of the instance in which to create the new
    +   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -193,13 +132,16 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int CLUSTER_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object clusterId_; + + @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
    +   * 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`.
        * 
    * @@ -219,12 +161,13 @@ public java.lang.String getClusterId() { return s; } } + /** * * *
    -   * Required. The ID to be used when referring to the new cluster within its instance,
    -   * e.g., just `mycluster` rather than
    +   * 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`.
        * 
    * @@ -247,6 +190,7 @@ public com.google.protobuf.ByteString getClusterIdBytes() { public static final int CLUSTER_FIELD_NUMBER = 3; private com.google.bigtable.admin.v2.Cluster cluster_; + /** * * @@ -262,8 +206,9 @@ public com.google.protobuf.ByteString getClusterIdBytes() { */ @java.lang.Override public boolean hasCluster() { - return cluster_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -281,6 +226,7 @@ public boolean hasCluster() { public com.google.bigtable.admin.v2.Cluster getCluster() { return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; } + /** * * @@ -294,7 +240,7 @@ public com.google.bigtable.admin.v2.Cluster getCluster() { */ @java.lang.Override public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { - return getCluster(); + return cluster_ == null ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : cluster_; } private byte memoizedIsInitialized = -1; @@ -311,16 +257,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getClusterIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, clusterId_); } - if (cluster_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getCluster()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -329,16 +275,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getClusterIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, clusterId_); } - if (cluster_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCluster()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -360,7 +306,7 @@ public boolean equals(final java.lang.Object obj) { if (hasCluster()) { if (!getCluster().equals(other.getCluster())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -379,7 +325,7 @@ public int hashCode() { hash = (37 * hash) + CLUSTER_FIELD_NUMBER; hash = (53 * hash) + getCluster().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -421,38 +367,38 @@ public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( public static com.google.bigtable.admin.v2.CreateClusterRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -475,10 +421,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -488,7 +435,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateClusterRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -498,7 +445,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateClusterRequest_fieldAccessorTable @@ -512,26 +459,26 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetClusterFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - clusterId_ = ""; - - if (clusterBuilder_ == null) { - cluster_ = null; - } else { - cluster_ = null; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); clusterBuilder_ = null; } return this; @@ -561,48 +508,27 @@ public com.google.bigtable.admin.v2.CreateClusterRequest build() { public com.google.bigtable.admin.v2.CreateClusterRequest buildPartial() { com.google.bigtable.admin.v2.CreateClusterRequest result = new com.google.bigtable.admin.v2.CreateClusterRequest(this); - result.parent_ = parent_; - result.clusterId_ = clusterId_; - if (clusterBuilder_ == null) { - result.cluster_ = cluster_; - } else { - result.cluster_ = clusterBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -620,16 +546,18 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateClusterRequest other 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -644,29 +572,62 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateClusterRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateClusterRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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}`.
    +     * Required. The unique name of the instance in which to create the new
    +     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -686,13 +647,13 @@ public java.lang.String getParent() { 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}`.
    +     * Required. The unique name of the instance in which to create the new
    +     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -712,13 +673,13 @@ public com.google.protobuf.ByteString getParentBytes() { 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}`.
    +     * Required. The unique name of the instance in which to create the new
    +     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -732,18 +693,18 @@ 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}`.
    +     * Required. The unique name of the instance in which to create the new
    +     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -753,18 +714,18 @@ public Builder setParent(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the instance in which to create the new
    +     * cluster. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -779,19 +740,20 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { 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
    +     * 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`.
          * 
    * @@ -810,12 +772,13 @@ public java.lang.String getClusterId() { 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
    +     * 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`.
          * 
    * @@ -834,12 +797,13 @@ public com.google.protobuf.ByteString getClusterIdBytes() { 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
    +     * 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`.
          * 
    * @@ -852,17 +816,18 @@ 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
    +     * 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`.
          * 
    * @@ -871,17 +836,18 @@ public Builder setClusterId(java.lang.String value) { * @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
    +     * 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`.
          * 
    * @@ -895,18 +861,19 @@ public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - clusterId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.bigtable.admin.v2.Cluster cluster_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -922,8 +889,9 @@ public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { * @return Whether the cluster field is set. */ public boolean hasCluster() { - return clusterBuilder_ != null || cluster_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -947,6 +915,7 @@ public com.google.bigtable.admin.v2.Cluster getCluster() { return clusterBuilder_.getMessage(); } } + /** * * @@ -965,13 +934,14 @@ public Builder setCluster(com.google.bigtable.admin.v2.Cluster value) { throw new NullPointerException(); } cluster_ = value; - onChanged(); } else { clusterBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -987,13 +957,14 @@ public Builder setCluster(com.google.bigtable.admin.v2.Cluster value) { public Builder setCluster(com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { if (clusterBuilder_ == null) { cluster_ = builderForValue.build(); - onChanged(); } else { clusterBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1008,21 +979,23 @@ public Builder setCluster(com.google.bigtable.admin.v2.Cluster.Builder builderFo */ public Builder mergeCluster(com.google.bigtable.admin.v2.Cluster value) { if (clusterBuilder_ == null) { - if (cluster_ != null) { - cluster_ = - com.google.bigtable.admin.v2.Cluster.newBuilder(cluster_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); } else { cluster_ = value; } - onChanged(); } else { clusterBuilder_.mergeFrom(value); } - + if (cluster_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1036,16 +1009,16 @@ public Builder mergeCluster(com.google.bigtable.admin.v2.Cluster value) { *
    */ public Builder clearCluster() { - if (clusterBuilder_ == null) { - cluster_ = null; - onChanged(); - } else { - cluster_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); clusterBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1059,10 +1032,11 @@ public Builder clearCluster() { *
    */ public com.google.bigtable.admin.v2.Cluster.Builder getClusterBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getClusterFieldBuilder().getBuilder(); + return internalGetClusterFieldBuilder().getBuilder(); } + /** * * @@ -1084,6 +1058,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { : cluster_; } } + /** * * @@ -1096,14 +1071,14 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { * .google.bigtable.admin.v2.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; *
    */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder> - getClusterFieldBuilder() { + internalGetClusterFieldBuilder() { if (clusterBuilder_ == null) { clusterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder>( @@ -1113,17 +1088,6 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { return clusterBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateClusterRequest) } @@ -1145,7 +1109,18 @@ public CreateClusterRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateClusterRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java index 35c9ee104a..c41839ef31 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateClusterRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,9 +30,8 @@ public interface CreateClusterRequestOrBuilder * * *
    -   * Required. The unique name of the instance in which to create the new cluster.
    -   * Values are of the form
    -   * `projects/{project}/instances/{instance}`.
    +   * Required. The unique name of the instance in which to create the new
    +   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -39,13 +41,13 @@ public interface CreateClusterRequestOrBuilder * @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}`.
    +   * Required. The unique name of the instance in which to create the new
    +   * cluster. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -60,8 +62,8 @@ public interface CreateClusterRequestOrBuilder * * *
    -   * Required. The ID to be used when referring to the new cluster within its instance,
    -   * e.g., just `mycluster` rather than
    +   * 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`.
        * 
    * @@ -70,12 +72,13 @@ public interface CreateClusterRequestOrBuilder * @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
    +   * 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`.
        * 
    * @@ -99,6 +102,7 @@ public interface CreateClusterRequestOrBuilder * @return Whether the cluster field is set. */ boolean hasCluster(); + /** * * @@ -113,6 +117,7 @@ public interface CreateClusterRequestOrBuilder * @return The cluster. */ com.google.bigtable.admin.v2.Cluster getCluster(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java index c8283c7912..d3bd2e3bb5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,112 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceMetadata} */ -public final class CreateInstanceMetadata extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use CreateInstanceMetadata.newBuilder() to construct. - private CreateInstanceMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateInstanceMetadata() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateInstanceMetadata(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CreateInstanceMetadata"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use CreateInstanceMetadata.newBuilder() to construct. + private CreateInstanceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private CreateInstanceMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.CreateInstanceRequest.Builder subBuilder = null; - if (originalRequest_ != null) { - subBuilder = originalRequest_.toBuilder(); - } - originalRequest_ = - input.readMessage( - com.google.bigtable.admin.v2.CreateInstanceRequest.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(originalRequest_); - originalRequest_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (requestTime_ != null) { - subBuilder = requestTime_.toBuilder(); - } - requestTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(requestTime_); - requestTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (finishTime_ != null) { - subBuilder = finishTime_.toBuilder(); - } - finishTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(finishTime_); - finishTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private CreateInstanceMetadata() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto @@ -140,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable @@ -149,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -164,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -183,6 +105,7 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest() { ? com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance() : originalRequest_; } + /** * * @@ -194,11 +117,14 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest() { */ @java.lang.Override public com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder getOriginalRequestOrBuilder() { - return getOriginalRequest(); + 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_; + /** * * @@ -212,8 +138,9 @@ public com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder getOriginalRe */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -229,6 +156,7 @@ public boolean hasRequestTime() { public com.google.protobuf.Timestamp getRequestTime() { return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } + /** * * @@ -240,11 +168,12 @@ public com.google.protobuf.Timestamp getRequestTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { - return getRequestTime(); + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } public static final int FINISH_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp finishTime_; + /** * * @@ -258,8 +187,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -275,6 +205,7 @@ public boolean hasFinishTime() { public com.google.protobuf.Timestamp getFinishTime() { return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; } + /** * * @@ -286,7 +217,7 @@ public com.google.protobuf.Timestamp getFinishTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { - return getFinishTime(); + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; } private byte memoizedIsInitialized = -1; @@ -303,16 +234,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(3, getFinishTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -321,16 +252,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -358,7 +289,7 @@ public boolean equals(final java.lang.Object obj) { if (hasFinishTime()) { if (!getFinishTime().equals(other.getFinishTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -381,7 +312,7 @@ public int hashCode() { hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; hash = (53 * hash) + getFinishTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -423,38 +354,38 @@ public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( public static com.google.bigtable.admin.v2.CreateInstanceMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -477,10 +408,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -490,7 +422,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -500,7 +432,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_fieldAccessorTable @@ -514,34 +446,36 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - } else { - originalRequest_ = null; + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - if (requestTimeBuilder_ == null) { - requestTime_ = null; - } else { - requestTime_ = null; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - if (finishTimeBuilder_ == null) { - finishTime_ = null; - } else { - finishTime_ = null; + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } return this; @@ -571,56 +505,31 @@ public com.google.bigtable.admin.v2.CreateInstanceMetadata build() { public com.google.bigtable.admin.v2.CreateInstanceMetadata buildPartial() { com.google.bigtable.admin.v2.CreateInstanceMetadata result = new com.google.bigtable.admin.v2.CreateInstanceMetadata(this); - if (originalRequestBuilder_ == null) { - result.originalRequest_ = originalRequest_; - } else { - result.originalRequest_ = originalRequestBuilder_.build(); - } - if (requestTimeBuilder_ == null) { - result.requestTime_ = requestTime_; - } else { - result.requestTime_ = requestTimeBuilder_.build(); - } - if (finishTimeBuilder_ == null) { - result.finishTime_ = finishTime_; - } else { - result.finishTime_ = finishTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -645,7 +554,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateInstanceMetadata oth if (other.hasFinishTime()) { mergeFinishTime(other.getFinishTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -660,27 +569,64 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateInstanceMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateInstanceMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.CreateInstanceRequest originalRequest_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -693,8 +639,9 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -715,6 +662,7 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest() { return originalRequestBuilder_.getMessage(); } } + /** * * @@ -730,13 +678,14 @@ public Builder setOriginalRequest(com.google.bigtable.admin.v2.CreateInstanceReq throw new NullPointerException(); } originalRequest_ = value; - onChanged(); } else { originalRequestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -750,13 +699,14 @@ public Builder setOriginalRequest( com.google.bigtable.admin.v2.CreateInstanceRequest.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); - onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -768,21 +718,24 @@ public Builder setOriginalRequest( */ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.CreateInstanceRequest value) { if (originalRequestBuilder_ == null) { - if (originalRequest_ != null) { - originalRequest_ = - com.google.bigtable.admin.v2.CreateInstanceRequest.newBuilder(originalRequest_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.CreateInstanceRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); } else { originalRequest_ = value; } - onChanged(); } else { originalRequestBuilder_.mergeFrom(value); } - + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -793,16 +746,16 @@ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.CreateInstanceR * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; */ public Builder clearOriginalRequest() { - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - onChanged(); - } else { - originalRequest_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -813,10 +766,11 @@ public Builder clearOriginalRequest() { * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; */ public com.google.bigtable.admin.v2.CreateInstanceRequest.Builder getOriginalRequestBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getOriginalRequestFieldBuilder().getBuilder(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); } + /** * * @@ -836,6 +790,7 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest.Builder getOriginalReq : originalRequest_; } } + /** * * @@ -845,14 +800,14 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest.Builder getOriginalReq * * .google.bigtable.admin.v2.CreateInstanceRequest original_request = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.CreateInstanceRequest, com.google.bigtable.admin.v2.CreateInstanceRequest.Builder, com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder> - getOriginalRequestFieldBuilder() { + internalGetOriginalRequestFieldBuilder() { if (originalRequestBuilder_ == null) { originalRequestBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.CreateInstanceRequest, com.google.bigtable.admin.v2.CreateInstanceRequest.Builder, com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder>( @@ -863,11 +818,12 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest.Builder getOriginalReq } private com.google.protobuf.Timestamp requestTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> requestTimeBuilder_; + /** * * @@ -880,8 +836,9 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest.Builder getOriginalReq * @return Whether the requestTime field is set. */ public boolean hasRequestTime() { - return requestTimeBuilder_ != null || requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -902,6 +859,7 @@ public com.google.protobuf.Timestamp getRequestTime() { return requestTimeBuilder_.getMessage(); } } + /** * * @@ -917,13 +875,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -936,13 +895,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (requestTimeBuilder_ == null) { requestTime_ = builderForValue.build(); - onChanged(); } else { requestTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -954,21 +914,23 @@ public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForVa */ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { if (requestTimeBuilder_ == null) { - if (requestTime_ != null) { - requestTime_ = - com.google.protobuf.Timestamp.newBuilder(requestTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); } else { requestTime_ = value; } - onChanged(); } else { requestTimeBuilder_.mergeFrom(value); } - + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -979,16 +941,16 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp request_time = 2; */ public Builder clearRequestTime() { - if (requestTimeBuilder_ == null) { - requestTime_ = null; - onChanged(); - } else { - requestTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -999,10 +961,11 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getRequestTimeFieldBuilder().getBuilder(); + return internalGetRequestTimeFieldBuilder().getBuilder(); } + /** * * @@ -1021,6 +984,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { : requestTime_; } } + /** * * @@ -1030,14 +994,14 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * * .google.protobuf.Timestamp request_time = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getRequestTimeFieldBuilder() { + internalGetRequestTimeFieldBuilder() { if (requestTimeBuilder_ == null) { requestTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1048,11 +1012,12 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { } private com.google.protobuf.Timestamp finishTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> finishTimeBuilder_; + /** * * @@ -1065,8 +1030,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * @return Whether the finishTime field is set. */ public boolean hasFinishTime() { - return finishTimeBuilder_ != null || finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1087,6 +1053,7 @@ public com.google.protobuf.Timestamp getFinishTime() { return finishTimeBuilder_.getMessage(); } } + /** * * @@ -1102,13 +1069,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1121,13 +1089,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (finishTimeBuilder_ == null) { finishTime_ = builderForValue.build(); - onChanged(); } else { finishTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1139,19 +1108,23 @@ public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { if (finishTimeBuilder_ == null) { - if (finishTime_ != null) { - finishTime_ = - com.google.protobuf.Timestamp.newBuilder(finishTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); } else { finishTime_ = value; } - onChanged(); } else { finishTimeBuilder_.mergeFrom(value); } - + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1162,16 +1135,16 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp finish_time = 3; */ public Builder clearFinishTime() { - if (finishTimeBuilder_ == null) { - finishTime_ = null; - onChanged(); - } else { - finishTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1182,10 +1155,11 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getFinishTimeFieldBuilder().getBuilder(); + return internalGetFinishTimeFieldBuilder().getBuilder(); } + /** * * @@ -1204,6 +1178,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { : finishTime_; } } + /** * * @@ -1213,14 +1188,14 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { * * .google.protobuf.Timestamp finish_time = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getFinishTimeFieldBuilder() { + internalGetFinishTimeFieldBuilder() { if (finishTimeBuilder_ == null) { finishTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1230,17 +1205,6 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { return finishTimeBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateInstanceMetadata) } @@ -1262,7 +1226,18 @@ public CreateInstanceMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateInstanceMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java index c12b184f4f..8672010679 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface CreateInstanceMetadataOrBuilder * @return Whether the originalRequest field is set. */ boolean hasOriginalRequest(); + /** * * @@ -47,6 +51,7 @@ public interface CreateInstanceMetadataOrBuilder * @return The originalRequest. */ com.google.bigtable.admin.v2.CreateInstanceRequest getOriginalRequest(); + /** * * @@ -70,6 +75,7 @@ public interface CreateInstanceMetadataOrBuilder * @return Whether the requestTime field is set. */ boolean hasRequestTime(); + /** * * @@ -82,6 +88,7 @@ public interface CreateInstanceMetadataOrBuilder * @return The requestTime. */ com.google.protobuf.Timestamp getRequestTime(); + /** * * @@ -105,6 +112,7 @@ public interface CreateInstanceMetadataOrBuilder * @return Whether the finishTime field is set. */ boolean hasFinishTime(); + /** * * @@ -117,6 +125,7 @@ public interface CreateInstanceMetadataOrBuilder * @return The finishTime. */ com.google.protobuf.Timestamp getFinishTime(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java index d7c9cf806f..eceb4ce312 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceRequest} */ -public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CreateInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,101 +56,6 @@ private CreateInstanceRequest() { instanceId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateInstanceRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateInstanceRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - instanceId_ = s; - break; - } - case 26: - { - com.google.bigtable.admin.v2.Instance.Builder subBuilder = null; - if (instance_ != null) { - subBuilder = instance_.toBuilder(); - } - instance_ = - input.readMessage( - com.google.bigtable.admin.v2.Instance.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(instance_); - instance_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - clusters_ = - com.google.protobuf.MapField.newMapField( - ClustersDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry - clusters__ = - input.readMessage( - ClustersDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - clusters_.getMutableMap().put(clusters__.getKey(), clusters__.getValue()); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_descriptor; @@ -144,7 +63,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 4: return internalGetClusters(); @@ -154,7 +74,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable @@ -163,14 +83,18 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { com.google.bigtable.admin.v2.CreateInstanceRequest.Builder.class); } + private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @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}`.
    +   * Required. The unique name of the project in which to create the new
    +   * instance. Values are of the form `projects/{project}`.
        * 
    * * @@ -191,12 +115,13 @@ public java.lang.String getParent() { return s; } } + /** * * *
    -   * Required. The unique name of the project in which to create the new instance.
    -   * Values are of the form `projects/{project}`.
    +   * Required. The unique name of the project in which to create the new
    +   * instance. Values are of the form `projects/{project}`.
        * 
    * * @@ -219,13 +144,16 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int INSTANCE_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object instanceId_; + + @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
    +   * 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`.
        * 
    * @@ -245,12 +173,13 @@ public java.lang.String getInstanceId() { return s; } } + /** * * *
    -   * Required. The ID to be used when referring to the new instance within its project,
    -   * e.g., just `myinstance` rather than
    +   * 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`.
        * 
    * @@ -273,6 +202,7 @@ public com.google.protobuf.ByteString getInstanceIdBytes() { public static final int INSTANCE_FIELD_NUMBER = 3; private com.google.bigtable.admin.v2.Instance instance_; + /** * * @@ -289,8 +219,9 @@ public com.google.protobuf.ByteString getInstanceIdBytes() { */ @java.lang.Override public boolean hasInstance() { - return instance_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -311,6 +242,7 @@ public com.google.bigtable.admin.v2.Instance getInstance() { ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() : instance_; } + /** * * @@ -325,7 +257,9 @@ public com.google.bigtable.admin.v2.Instance getInstance() { */ @java.lang.Override public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { - return getInstance(); + return instance_ == null + ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() + : instance_; } public static final int CLUSTERS_FIELD_NUMBER = 4; @@ -344,6 +278,7 @@ private static final class ClustersDefaultEntryHolder { com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); } + @SuppressWarnings("serial") private com.google.protobuf.MapField clusters_; @@ -358,6 +293,7 @@ private static final class ClustersDefaultEntryHolder { public int getClustersCount() { return internalGetClusters().getMap().size(); } + /** * * @@ -366,7 +302,6 @@ public int getClustersCount() { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -376,16 +311,18 @@ public int getClustersCount() { @java.lang.Override public boolean containsClusters(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + 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(); } + /** * * @@ -394,7 +331,6 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -405,6 +341,7 @@ public java.util.Map get public java.util.Map getClustersMap() { return internalGetClusters().getMap(); } + /** * * @@ -413,7 +350,6 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -421,15 +357,18 @@ public java.util.Map get * */ @java.lang.Override - public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( - java.lang.String key, com.google.bigtable.admin.v2.Cluster defaultValue) { + 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 java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetClusters().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -438,7 +377,6 @@ public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -448,7 +386,7 @@ public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( @java.lang.Override public com.google.bigtable.admin.v2.Cluster getClustersOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetClusters().getMap(); @@ -472,18 +410,18 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getInstanceIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, instanceId_); } - if (instance_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getInstance()); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetClusters(), ClustersDefaultEntryHolder.defaultEntry, 4); - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -492,13 +430,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getInstanceIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(instanceId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, instanceId_); } - if (instance_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); } for (java.util.Map.Entry entry : @@ -512,7 +450,7 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, clusters__); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -535,7 +473,7 @@ public boolean equals(final java.lang.Object obj) { if (!getInstance().equals(other.getInstance())) return false; } if (!internalGetClusters().equals(other.internalGetClusters())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -558,7 +496,7 @@ public int hashCode() { hash = (37 * hash) + CLUSTERS_FIELD_NUMBER; hash = (53 * hash) + internalGetClusters().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -600,38 +538,38 @@ public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( public static com.google.bigtable.admin.v2.CreateInstanceRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -654,10 +592,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -667,7 +606,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateInstanceRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -677,7 +616,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 4: return internalGetClusters(); @@ -687,7 +627,8 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { switch (number) { case 4: return internalGetMutableClusters(); @@ -697,7 +638,7 @@ protected com.google.protobuf.MapField internalGetMutableMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateInstanceRequest_fieldAccessorTable @@ -711,26 +652,26 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInstanceFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - instanceId_ = ""; - - if (instanceBuilder_ == null) { - instance_ = null; - } else { - instance_ = null; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); instanceBuilder_ = null; } internalGetMutableClusters().clear(); @@ -761,51 +702,30 @@ public com.google.bigtable.admin.v2.CreateInstanceRequest build() { public com.google.bigtable.admin.v2.CreateInstanceRequest buildPartial() { com.google.bigtable.admin.v2.CreateInstanceRequest result = new com.google.bigtable.admin.v2.CreateInstanceRequest(this); - int from_bitField0_ = bitField0_; - result.parent_ = parent_; - result.instanceId_ = instanceId_; - if (instanceBuilder_ == null) { - result.instance_ = instance_; - } else { - result.instance_ = instanceBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.clusters_ = internalGetClusters(); - result.clusters_.makeImmutable(); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -823,17 +743,20 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateInstanceRequest othe 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()); - this.mergeUnknownFields(other.unknownFields); + bitField0_ |= 0x00000008; + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -848,30 +771,76 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateInstanceRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateInstanceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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}`.
    +     * Required. The unique name of the project in which to create the new
    +     * instance. Values are of the form `projects/{project}`.
          * 
    * * @@ -891,12 +860,13 @@ public java.lang.String getParent() { 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}`.
    +     * Required. The unique name of the project in which to create the new
    +     * instance. Values are of the form `projects/{project}`.
          * 
    * * @@ -916,12 +886,13 @@ public com.google.protobuf.ByteString getParentBytes() { 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}`.
    +     * Required. The unique name of the project in which to create the new
    +     * instance. Values are of the form `projects/{project}`.
          * 
    * * @@ -935,17 +906,18 @@ 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}`.
    +     * Required. The unique name of the project in which to create the new
    +     * instance. Values are of the form `projects/{project}`.
          * 
    * * @@ -955,17 +927,18 @@ public Builder setParent(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the project in which to create the new
    +     * instance. Values are of the form `projects/{project}`.
          * 
    * * @@ -980,19 +953,20 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { 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
    +     * 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`.
          * 
    * @@ -1011,12 +985,13 @@ public java.lang.String getInstanceId() { 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
    +     * 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`.
          * 
    * @@ -1035,12 +1010,13 @@ public com.google.protobuf.ByteString getInstanceIdBytes() { 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
    +     * 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`.
          * 
    * @@ -1053,17 +1029,18 @@ 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
    +     * 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`.
          * 
    * @@ -1072,17 +1049,18 @@ public Builder setInstanceId(java.lang.String value) { * @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
    +     * 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`.
          * 
    * @@ -1096,18 +1074,19 @@ public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - instanceId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.bigtable.admin.v2.Instance instance_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -1123,8 +1102,9 @@ public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { * @return Whether the instance field is set. */ public boolean hasInstance() { - return instanceBuilder_ != null || instance_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1148,6 +1128,7 @@ public com.google.bigtable.admin.v2.Instance getInstance() { return instanceBuilder_.getMessage(); } } + /** * * @@ -1166,13 +1147,14 @@ public Builder setInstance(com.google.bigtable.admin.v2.Instance value) { throw new NullPointerException(); } instance_ = value; - onChanged(); } else { instanceBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1188,13 +1170,14 @@ public Builder setInstance(com.google.bigtable.admin.v2.Instance value) { public Builder setInstance(com.google.bigtable.admin.v2.Instance.Builder builderForValue) { if (instanceBuilder_ == null) { instance_ = builderForValue.build(); - onChanged(); } else { instanceBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1209,21 +1192,23 @@ public Builder setInstance(com.google.bigtable.admin.v2.Instance.Builder builder */ public Builder mergeInstance(com.google.bigtable.admin.v2.Instance value) { if (instanceBuilder_ == null) { - if (instance_ != null) { - instance_ = - com.google.bigtable.admin.v2.Instance.newBuilder(instance_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.bigtable.admin.v2.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); } else { instance_ = value; } - onChanged(); } else { instanceBuilder_.mergeFrom(value); } - + if (instance_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1237,16 +1222,16 @@ public Builder mergeInstance(com.google.bigtable.admin.v2.Instance value) { *
    */ public Builder clearInstance() { - if (instanceBuilder_ == null) { - instance_ = null; - onChanged(); - } else { - instance_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); instanceBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1260,10 +1245,11 @@ public Builder clearInstance() { *
    */ public com.google.bigtable.admin.v2.Instance.Builder getInstanceBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getInstanceFieldBuilder().getBuilder(); + return internalGetInstanceFieldBuilder().getBuilder(); } + /** * * @@ -1285,6 +1271,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { : instance_; } } + /** * * @@ -1297,14 +1284,14 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { * .google.bigtable.admin.v2.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; *
    */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder> - getInstanceFieldBuilder() { + internalGetInstanceFieldBuilder() { if (instanceBuilder_ == null) { instanceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder>( @@ -1314,34 +1301,67 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { return instanceBuilder_; } - private com.google.protobuf.MapField + 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.MapField + 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 com.google.protobuf.MapField.emptyMapField(ClustersDefaultEntryHolder.defaultEntry); + return new com.google.protobuf.MapFieldBuilder<>(clustersConverter); } return clusters_; } - private com.google.protobuf.MapField + 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() { - onChanged(); - ; if (clusters_ == null) { - clusters_ = - com.google.protobuf.MapField.newMapField(ClustersDefaultEntryHolder.defaultEntry); - } - if (!clusters_.isMutable()) { - clusters_ = clusters_.copy(); + clusters_ = new com.google.protobuf.MapFieldBuilder<>(clustersConverter); } + bitField0_ |= 0x00000008; + onChanged(); return clusters_; } public int getClustersCount() { - return internalGetClusters().getMap().size(); + return internalGetClusters().ensureBuilderMap().size(); } + /** * * @@ -1350,7 +1370,6 @@ public int getClustersCount() { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1360,16 +1379,18 @@ public int getClustersCount() { @java.lang.Override public boolean containsClusters(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } - return internalGetClusters().getMap().containsKey(key); + return internalGetClusters().ensureBuilderMap().containsKey(key); } + /** Use {@link #getClustersMap()} instead. */ @java.lang.Override @java.lang.Deprecated public java.util.Map getClusters() { return getClustersMap(); } + /** * * @@ -1378,7 +1399,6 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1387,8 +1407,9 @@ public java.util.Map get */ @java.lang.Override public java.util.Map getClustersMap() { - return internalGetClusters().getMap(); + return internalGetClusters().getImmutableMap(); } + /** * * @@ -1397,7 +1418,6 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1405,15 +1425,18 @@ public java.util.Map get * */ @java.lang.Override - public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( - java.lang.String key, com.google.bigtable.admin.v2.Cluster defaultValue) { + 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 java.lang.NullPointerException(); + throw new NullPointerException("map key"); } - java.util.Map map = - internalGetClusters().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + java.util.Map map = + internalGetMutableClusters().ensureBuilderMap(); + return map.containsKey(key) ? clustersConverter.build(map.get(key)) : defaultValue; } + /** * * @@ -1422,7 +1445,6 @@ public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1432,20 +1454,22 @@ public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( @java.lang.Override public com.google.bigtable.admin.v2.Cluster getClustersOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } - java.util.Map map = - internalGetClusters().getMap(); + java.util.Map map = + internalGetMutableClusters().ensureBuilderMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } - return map.get(key); + return clustersConverter.build(map.get(key)); } public Builder clearClusters() { - internalGetMutableClusters().getMutableMap().clear(); + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableClusters().clear(); return this; } + /** * * @@ -1454,7 +1478,6 @@ public Builder clearClusters() { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1463,17 +1486,20 @@ public Builder clearClusters() { */ public Builder removeClusters(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } - internalGetMutableClusters().getMutableMap().remove(key); + internalGetMutableClusters().ensureBuilderMap().remove(key); return this; } + /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableClusters() { - return internalGetMutableClusters().getMutableMap(); + bitField0_ |= 0x00000008; + return internalGetMutableClusters().ensureMessageMap(); } + /** * * @@ -1482,7 +1508,6 @@ public Builder removeClusters(java.lang.String key) { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1491,14 +1516,16 @@ public Builder removeClusters(java.lang.String key) { */ public Builder putClusters(java.lang.String key, com.google.bigtable.admin.v2.Cluster value) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } if (value == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map value"); } - internalGetMutableClusters().getMutableMap().put(key, value); + internalGetMutableClusters().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000008; return this; } + /** * * @@ -1507,7 +1534,6 @@ public Builder putClusters(java.lang.String key, com.google.bigtable.admin.v2.Cl * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -1516,19 +1542,45 @@ public Builder putClusters(java.lang.String key, com.google.bigtable.admin.v2.Cl */ public Builder putAllClusters( java.util.Map values) { - internalGetMutableClusters().getMutableMap().putAll(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; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -1552,7 +1604,18 @@ public CreateInstanceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateInstanceRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java index 8417fff128..24b2fe6ea2 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,8 +30,8 @@ public interface CreateInstanceRequestOrBuilder * * *
    -   * Required. The unique name of the project in which to create the new instance.
    -   * Values are of the form `projects/{project}`.
    +   * Required. The unique name of the project in which to create the new
    +   * instance. Values are of the form `projects/{project}`.
        * 
    * * @@ -38,12 +41,13 @@ public interface CreateInstanceRequestOrBuilder * @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}`.
    +   * Required. The unique name of the project in which to create the new
    +   * instance. Values are of the form `projects/{project}`.
        * 
    * * @@ -58,8 +62,8 @@ public interface CreateInstanceRequestOrBuilder * * *
    -   * Required. The ID to be used when referring to the new instance within its project,
    -   * e.g., just `myinstance` rather than
    +   * 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`.
        * 
    * @@ -68,12 +72,13 @@ public interface CreateInstanceRequestOrBuilder * @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
    +   * 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`.
        * 
    * @@ -98,6 +103,7 @@ public interface CreateInstanceRequestOrBuilder * @return Whether the instance field is set. */ boolean hasInstance(); + /** * * @@ -113,6 +119,7 @@ public interface CreateInstanceRequestOrBuilder * @return The instance. */ com.google.bigtable.admin.v2.Instance getInstance(); + /** * * @@ -135,7 +142,6 @@ public interface CreateInstanceRequestOrBuilder * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -143,6 +149,7 @@ public interface CreateInstanceRequestOrBuilder * */ int getClustersCount(); + /** * * @@ -151,7 +158,6 @@ public interface CreateInstanceRequestOrBuilder * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -159,9 +165,11 @@ public interface CreateInstanceRequestOrBuilder * */ boolean containsClusters(java.lang.String key); + /** Use {@link #getClustersMap()} instead. */ @java.lang.Deprecated java.util.Map getClusters(); + /** * * @@ -170,7 +178,6 @@ public interface CreateInstanceRequestOrBuilder * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * @@ -178,6 +185,7 @@ public interface CreateInstanceRequestOrBuilder * */ java.util.Map getClustersMap(); + /** * * @@ -186,15 +194,18 @@ public interface CreateInstanceRequestOrBuilder * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. *
    * * * 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, com.google.bigtable.admin.v2.Cluster defaultValue); + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Cluster defaultValue); + /** * * @@ -203,7 +214,6 @@ com.google.bigtable.admin.v2.Cluster getClustersOrDefault( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. * * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadata.java new file mode 100644 index 0000000000..c969095d51 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewMetadataOrBuilder.java new file mode 100644 index 0000000000..ac35bb89f1 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequest.java new file mode 100644 index 0000000000..7c2b721dbd --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateLogicalViewRequestOrBuilder.java new file mode 100644 index 0000000000..0598ae6553 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadata.java new file mode 100644 index 0000000000..bc3c2755a2 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewMetadataOrBuilder.java new file mode 100644 index 0000000000..a3eb4ef1f6 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequest.java new file mode 100644 index 0000000000..a2edab382b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateMaterializedViewRequestOrBuilder.java new file mode 100644 index 0000000000..5de546a88e --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadata.java new file mode 100644 index 0000000000..761e5dbc72 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleMetadataOrBuilder.java new file mode 100644 index 0000000000..1e4212e34a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequest.java new file mode 100644 index 0000000000..7e6ec60c69 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateSchemaBundleRequestOrBuilder.java new file mode 100644 index 0000000000..e8d1d6efe8 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java index 1416886906..34d2b9d5c5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -23,6 +25,7 @@ * *
      * 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
    @@ -31,113 +34,29 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotMetadata}
      */
    -public final class CreateTableFromSnapshotMetadata extends com.google.protobuf.GeneratedMessageV3
    +@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;
    -  // Use CreateTableFromSnapshotMetadata.newBuilder() to construct.
    -  private CreateTableFromSnapshotMetadata(
    -      com.google.protobuf.GeneratedMessageV3.Builder builder) {
    -    super(builder);
    -  }
    -
    -  private CreateTableFromSnapshotMetadata() {}
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new CreateTableFromSnapshotMetadata();
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +        /* major= */ 4,
    +        /* minor= */ 33,
    +        /* patch= */ 2,
    +        /* suffix= */ "",
    +        "CreateTableFromSnapshotMetadata");
       }
     
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    +  // Use CreateTableFromSnapshotMetadata.newBuilder() to construct.
    +  private CreateTableFromSnapshotMetadata(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
       }
     
    -  private CreateTableFromSnapshotMetadata(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder subBuilder = null;
    -              if (originalRequest_ != null) {
    -                subBuilder = originalRequest_.toBuilder();
    -              }
    -              originalRequest_ =
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.parser(),
    -                      extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(originalRequest_);
    -                originalRequest_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 18:
    -            {
    -              com.google.protobuf.Timestamp.Builder subBuilder = null;
    -              if (requestTime_ != null) {
    -                subBuilder = requestTime_.toBuilder();
    -              }
    -              requestTime_ =
    -                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(requestTime_);
    -                requestTime_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 26:
    -            {
    -              com.google.protobuf.Timestamp.Builder subBuilder = null;
    -              if (finishTime_ != null) {
    -                subBuilder = finishTime_.toBuilder();
    -              }
    -              finishTime_ =
    -                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(finishTime_);
    -                finishTime_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    +  private CreateTableFromSnapshotMetadata() {}
     
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
    @@ -145,7 +64,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_fieldAccessorTable
    @@ -154,8 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                 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_;
    +
       /**
        *
        *
    @@ -170,8 +91,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        */
       @java.lang.Override
       public boolean hasOriginalRequest() {
    -    return originalRequest_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
    +
       /**
        *
        *
    @@ -190,6 +112,7 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRe
             ? com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.getDefaultInstance()
             : originalRequest_;
       }
    +
       /**
        *
        *
    @@ -203,11 +126,14 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRe
       @java.lang.Override
       public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder
           getOriginalRequestOrBuilder() {
    -    return getOriginalRequest();
    +    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_;
    +
       /**
        *
        *
    @@ -221,8 +147,9 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRe
        */
       @java.lang.Override
       public boolean hasRequestTime() {
    -    return requestTime_ != null;
    +    return ((bitField0_ & 0x00000002) != 0);
       }
    +
       /**
        *
        *
    @@ -238,6 +165,7 @@ public boolean hasRequestTime() {
       public com.google.protobuf.Timestamp getRequestTime() {
         return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_;
       }
    +
       /**
        *
        *
    @@ -249,11 +177,12 @@ public com.google.protobuf.Timestamp getRequestTime() {
        */
       @java.lang.Override
       public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
    -    return getRequestTime();
    +    return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_;
       }
     
       public static final int FINISH_TIME_FIELD_NUMBER = 3;
       private com.google.protobuf.Timestamp finishTime_;
    +
       /**
        *
        *
    @@ -267,8 +196,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
        */
       @java.lang.Override
       public boolean hasFinishTime() {
    -    return finishTime_ != null;
    +    return ((bitField0_ & 0x00000004) != 0);
       }
    +
       /**
        *
        *
    @@ -284,6 +214,7 @@ public boolean hasFinishTime() {
       public com.google.protobuf.Timestamp getFinishTime() {
         return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_;
       }
    +
       /**
        *
        *
    @@ -295,7 +226,7 @@ public com.google.protobuf.Timestamp getFinishTime() {
        */
       @java.lang.Override
       public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
    -    return getFinishTime();
    +    return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_;
       }
     
       private byte memoizedIsInitialized = -1;
    @@ -312,16 +243,16 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (originalRequest_ != null) {
    +    if (((bitField0_ & 0x00000001) != 0)) {
           output.writeMessage(1, getOriginalRequest());
         }
    -    if (requestTime_ != null) {
    +    if (((bitField0_ & 0x00000002) != 0)) {
           output.writeMessage(2, getRequestTime());
         }
    -    if (finishTime_ != null) {
    +    if (((bitField0_ & 0x00000004) != 0)) {
           output.writeMessage(3, getFinishTime());
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -330,16 +261,16 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (originalRequest_ != null) {
    +    if (((bitField0_ & 0x00000001) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest());
         }
    -    if (requestTime_ != null) {
    +    if (((bitField0_ & 0x00000002) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime());
         }
    -    if (finishTime_ != null) {
    +    if (((bitField0_ & 0x00000004) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime());
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -367,7 +298,7 @@ public boolean equals(final java.lang.Object obj) {
         if (hasFinishTime()) {
           if (!getFinishTime().equals(other.getFinishTime())) return false;
         }
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -390,7 +321,7 @@ public int hashCode() {
           hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER;
           hash = (53 * hash) + getFinishTime().hashCode();
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -432,38 +363,38 @@ public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parse
     
       public static com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -487,15 +418,17 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  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
    @@ -504,7 +437,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotMetadata}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -514,7 +447,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_fieldAccessorTable
    @@ -528,34 +461,36 @@ private Builder() {
           maybeForceBuilderInitialization();
         }
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
           maybeForceBuilderInitialization();
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
    +        internalGetOriginalRequestFieldBuilder();
    +        internalGetRequestTimeFieldBuilder();
    +        internalGetFinishTimeFieldBuilder();
    +      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    -      if (originalRequestBuilder_ == null) {
    -        originalRequest_ = null;
    -      } else {
    -        originalRequest_ = null;
    +      bitField0_ = 0;
    +      originalRequest_ = null;
    +      if (originalRequestBuilder_ != null) {
    +        originalRequestBuilder_.dispose();
             originalRequestBuilder_ = null;
           }
    -      if (requestTimeBuilder_ == null) {
    -        requestTime_ = null;
    -      } else {
    -        requestTime_ = null;
    +      requestTime_ = null;
    +      if (requestTimeBuilder_ != null) {
    +        requestTimeBuilder_.dispose();
             requestTimeBuilder_ = null;
           }
    -      if (finishTimeBuilder_ == null) {
    -        finishTime_ = null;
    -      } else {
    -        finishTime_ = null;
    +      finishTime_ = null;
    +      if (finishTimeBuilder_ != null) {
    +        finishTimeBuilder_.dispose();
             finishTimeBuilder_ = null;
           }
           return this;
    @@ -586,56 +521,32 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata build() {
         public com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata buildPartial() {
           com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata result =
               new com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata(this);
    -      if (originalRequestBuilder_ == null) {
    -        result.originalRequest_ = originalRequest_;
    -      } else {
    -        result.originalRequest_ = originalRequestBuilder_.build();
    -      }
    -      if (requestTimeBuilder_ == null) {
    -        result.requestTime_ = requestTime_;
    -      } else {
    -        result.requestTime_ = requestTimeBuilder_.build();
    -      }
    -      if (finishTimeBuilder_ == null) {
    -        result.finishTime_ = finishTime_;
    -      } else {
    -        result.finishTime_ = finishTimeBuilder_.build();
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -661,7 +572,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableFromSnapshotMet
           if (other.hasFinishTime()) {
             mergeFinishTime(other.getFinishTime());
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -676,27 +587,64 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest originalRequest_;
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    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_;
    +
         /**
          *
          *
    @@ -710,8 +658,9 @@ public Builder mergeFrom(
          * @return Whether the originalRequest field is set.
          */
         public boolean hasOriginalRequest() {
    -      return originalRequestBuilder_ != null || originalRequest_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
    +
         /**
          *
          *
    @@ -733,6 +682,7 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRe
             return originalRequestBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -750,13 +700,14 @@ public Builder setOriginalRequest(
               throw new NullPointerException();
             }
             originalRequest_ = value;
    -        onChanged();
           } else {
             originalRequestBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000001;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -771,13 +722,14 @@ public Builder setOriginalRequest(
             com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder builderForValue) {
           if (originalRequestBuilder_ == null) {
             originalRequest_ = builderForValue.build();
    -        onChanged();
           } else {
             originalRequestBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000001;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -791,22 +743,25 @@ public Builder setOriginalRequest(
         public Builder mergeOriginalRequest(
             com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest value) {
           if (originalRequestBuilder_ == null) {
    -        if (originalRequest_ != null) {
    -          originalRequest_ =
    -              com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.newBuilder(
    -                      originalRequest_)
    -                  .mergeFrom(value)
    -                  .buildPartial();
    +        if (((bitField0_ & 0x00000001) != 0)
    +            && originalRequest_ != null
    +            && originalRequest_
    +                != com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest
    +                    .getDefaultInstance()) {
    +          getOriginalRequestBuilder().mergeFrom(value);
             } else {
               originalRequest_ = value;
             }
    -        onChanged();
           } else {
             originalRequestBuilder_.mergeFrom(value);
           }
    -
    +      if (originalRequest_ != null) {
    +        bitField0_ |= 0x00000001;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -818,16 +773,16 @@ public Builder mergeOriginalRequest(
          * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1;
          */
         public Builder clearOriginalRequest() {
    -      if (originalRequestBuilder_ == null) {
    -        originalRequest_ = null;
    -        onChanged();
    -      } else {
    -        originalRequest_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      originalRequest_ = null;
    +      if (originalRequestBuilder_ != null) {
    +        originalRequestBuilder_.dispose();
             originalRequestBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -840,10 +795,11 @@ public Builder clearOriginalRequest() {
          */
         public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder
             getOriginalRequestBuilder() {
    -
    +      bitField0_ |= 0x00000001;
           onChanged();
    -      return getOriginalRequestFieldBuilder().getBuilder();
    +      return internalGetOriginalRequestFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -864,6 +820,7 @@ public Builder clearOriginalRequest() {
                 : originalRequest_;
           }
         }
    +
         /**
          *
          *
    @@ -874,14 +831,14 @@ public Builder clearOriginalRequest() {
          *
          * .google.bigtable.admin.v2.CreateTableFromSnapshotRequest original_request = 1;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,
                 com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder,
                 com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder>
    -        getOriginalRequestFieldBuilder() {
    +        internalGetOriginalRequestFieldBuilder() {
           if (originalRequestBuilder_ == null) {
             originalRequestBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,
                     com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder,
                     com.google.bigtable.admin.v2.CreateTableFromSnapshotRequestOrBuilder>(
    @@ -892,11 +849,12 @@ public Builder clearOriginalRequest() {
         }
     
         private com.google.protobuf.Timestamp requestTime_;
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
             requestTimeBuilder_;
    +
         /**
          *
          *
    @@ -909,8 +867,9 @@ public Builder clearOriginalRequest() {
          * @return Whether the requestTime field is set.
          */
         public boolean hasRequestTime() {
    -      return requestTimeBuilder_ != null || requestTime_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
    +
         /**
          *
          *
    @@ -931,6 +890,7 @@ public com.google.protobuf.Timestamp getRequestTime() {
             return requestTimeBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -946,13 +906,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             requestTime_ = value;
    -        onChanged();
           } else {
             requestTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -965,13 +926,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) {
         public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) {
           if (requestTimeBuilder_ == null) {
             requestTime_ = builderForValue.build();
    -        onChanged();
           } else {
             requestTimeBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -983,21 +945,23 @@ public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForVa
          */
         public Builder mergeRequestTime(com.google.protobuf.Timestamp value) {
           if (requestTimeBuilder_ == null) {
    -        if (requestTime_ != null) {
    -          requestTime_ =
    -              com.google.protobuf.Timestamp.newBuilder(requestTime_)
    -                  .mergeFrom(value)
    -                  .buildPartial();
    +        if (((bitField0_ & 0x00000002) != 0)
    +            && requestTime_ != null
    +            && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
    +          getRequestTimeBuilder().mergeFrom(value);
             } else {
               requestTime_ = value;
             }
    -        onChanged();
           } else {
             requestTimeBuilder_.mergeFrom(value);
           }
    -
    +      if (requestTime_ != null) {
    +        bitField0_ |= 0x00000002;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -1008,16 +972,16 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) {
          * .google.protobuf.Timestamp request_time = 2;
          */
         public Builder clearRequestTime() {
    -      if (requestTimeBuilder_ == null) {
    -        requestTime_ = null;
    -        onChanged();
    -      } else {
    -        requestTime_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      requestTime_ = null;
    +      if (requestTimeBuilder_ != null) {
    +        requestTimeBuilder_.dispose();
             requestTimeBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1028,10 +992,11 @@ public Builder clearRequestTime() {
          * .google.protobuf.Timestamp request_time = 2;
          */
         public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() {
    -
    +      bitField0_ |= 0x00000002;
           onChanged();
    -      return getRequestTimeFieldBuilder().getBuilder();
    +      return internalGetRequestTimeFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -1050,6 +1015,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
                 : requestTime_;
           }
         }
    +
         /**
          *
          *
    @@ -1059,14 +1025,14 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
          *
          * .google.protobuf.Timestamp request_time = 2;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
    -        getRequestTimeFieldBuilder() {
    +        internalGetRequestTimeFieldBuilder() {
           if (requestTimeBuilder_ == null) {
             requestTimeBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Timestamp,
                     com.google.protobuf.Timestamp.Builder,
                     com.google.protobuf.TimestampOrBuilder>(
    @@ -1077,11 +1043,12 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
         }
     
         private com.google.protobuf.Timestamp finishTime_;
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
             finishTimeBuilder_;
    +
         /**
          *
          *
    @@ -1094,8 +1061,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
          * @return Whether the finishTime field is set.
          */
         public boolean hasFinishTime() {
    -      return finishTimeBuilder_ != null || finishTime_ != null;
    +      return ((bitField0_ & 0x00000004) != 0);
         }
    +
         /**
          *
          *
    @@ -1116,6 +1084,7 @@ public com.google.protobuf.Timestamp getFinishTime() {
             return finishTimeBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -1131,13 +1100,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             finishTime_ = value;
    -        onChanged();
           } else {
             finishTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000004;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1150,13 +1120,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) {
         public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) {
           if (finishTimeBuilder_ == null) {
             finishTime_ = builderForValue.build();
    -        onChanged();
           } else {
             finishTimeBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000004;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1168,19 +1139,23 @@ public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForVal
          */
         public Builder mergeFinishTime(com.google.protobuf.Timestamp value) {
           if (finishTimeBuilder_ == null) {
    -        if (finishTime_ != null) {
    -          finishTime_ =
    -              com.google.protobuf.Timestamp.newBuilder(finishTime_).mergeFrom(value).buildPartial();
    +        if (((bitField0_ & 0x00000004) != 0)
    +            && finishTime_ != null
    +            && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
    +          getFinishTimeBuilder().mergeFrom(value);
             } else {
               finishTime_ = value;
             }
    -        onChanged();
           } else {
             finishTimeBuilder_.mergeFrom(value);
           }
    -
    +      if (finishTime_ != null) {
    +        bitField0_ |= 0x00000004;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -1191,16 +1166,16 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) {
          * .google.protobuf.Timestamp finish_time = 3;
          */
         public Builder clearFinishTime() {
    -      if (finishTimeBuilder_ == null) {
    -        finishTime_ = null;
    -        onChanged();
    -      } else {
    -        finishTime_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      finishTime_ = null;
    +      if (finishTimeBuilder_ != null) {
    +        finishTimeBuilder_.dispose();
             finishTimeBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1211,10 +1186,11 @@ public Builder clearFinishTime() {
          * .google.protobuf.Timestamp finish_time = 3;
          */
         public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() {
    -
    +      bitField0_ |= 0x00000004;
           onChanged();
    -      return getFinishTimeFieldBuilder().getBuilder();
    +      return internalGetFinishTimeFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -1233,6 +1209,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
                 : finishTime_;
           }
         }
    +
         /**
          *
          *
    @@ -1242,14 +1219,14 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
          *
          * .google.protobuf.Timestamp finish_time = 3;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
    -        getFinishTimeFieldBuilder() {
    +        internalGetFinishTimeFieldBuilder() {
           if (finishTimeBuilder_ == null) {
             finishTimeBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Timestamp,
                     com.google.protobuf.Timestamp.Builder,
                     com.google.protobuf.TimestampOrBuilder>(
    @@ -1259,17 +1236,6 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
           return finishTimeBuilder_;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableFromSnapshotMetadata)
       }
     
    @@ -1292,7 +1258,18 @@ public CreateTableFromSnapshotMetadata parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new CreateTableFromSnapshotMetadata(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java
    index ef8e7ecae3..e8cbf1448f 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotMetadataOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -36,6 +39,7 @@ public interface CreateTableFromSnapshotMetadataOrBuilder
        * @return Whether the originalRequest field is set.
        */
       boolean hasOriginalRequest();
    +
       /**
        *
        *
    @@ -49,6 +53,7 @@ public interface CreateTableFromSnapshotMetadataOrBuilder
        * @return The originalRequest.
        */
       com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRequest();
    +
       /**
        *
        *
    @@ -74,6 +79,7 @@ public interface CreateTableFromSnapshotMetadataOrBuilder
        * @return Whether the requestTime field is set.
        */
       boolean hasRequestTime();
    +
       /**
        *
        *
    @@ -86,6 +92,7 @@ public interface CreateTableFromSnapshotMetadataOrBuilder
        * @return The requestTime.
        */
       com.google.protobuf.Timestamp getRequestTime();
    +
       /**
        *
        *
    @@ -109,6 +116,7 @@ public interface CreateTableFromSnapshotMetadataOrBuilder
        * @return Whether the finishTime field is set.
        */
       boolean hasFinishTime();
    +
       /**
        *
        *
    @@ -121,6 +129,7 @@ public interface CreateTableFromSnapshotMetadataOrBuilder
        * @return The finishTime.
        */
       com.google.protobuf.Timestamp getFinishTime();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java
    index 0db14a052a..9dd2cb8598 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -24,6 +26,7 @@
      * 
      * 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
    @@ -32,14 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotRequest}
      */
    -public final class CreateTableFromSnapshotRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private CreateTableFromSnapshotRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -49,82 +63,13 @@ private CreateTableFromSnapshotRequest() {
         sourceSnapshot_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new CreateTableFromSnapshotRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private CreateTableFromSnapshotRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              parent_ = s;
    -              break;
    -            }
    -          case 18:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              tableId_ = s;
    -              break;
    -            }
    -          case 26:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              sourceSnapshot_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_fieldAccessorTable
    @@ -134,7 +79,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int PARENT_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object parent_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object parent_ = "";
    +
       /**
        *
        *
    @@ -161,6 +109,7 @@ public java.lang.String getParent() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -189,13 +138,16 @@ public com.google.protobuf.ByteString getParentBytes() {
       }
     
       public static final int TABLE_ID_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object tableId_;
    +
    +  @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`.
    +   * 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]; @@ -214,12 +166,13 @@ public java.lang.String getTableId() { 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`.
    +   * 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]; @@ -240,14 +193,17 @@ public com.google.protobuf.ByteString getTableIdBytes() { } public static final int SOURCE_SNAPSHOT_FIELD_NUMBER = 3; - private volatile java.lang.Object sourceSnapshot_; + + @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
    +   * 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}`.
        * 
    * @@ -269,13 +225,14 @@ public java.lang.String getSourceSnapshot() { 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
    +   * 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}`.
        * 
    * @@ -312,16 +269,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getTableIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableId_); } - if (!getSourceSnapshotBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceSnapshot_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceSnapshot_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, sourceSnapshot_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -330,16 +287,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getTableIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableId_); } - if (!getSourceSnapshotBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceSnapshot_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(sourceSnapshot_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, sourceSnapshot_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -358,7 +315,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (!getTableId().equals(other.getTableId())) return false; if (!getSourceSnapshot().equals(other.getSourceSnapshot())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -375,7 +332,7 @@ public int hashCode() { hash = (53 * hash) + getTableId().hashCode(); hash = (37 * hash) + SOURCE_SNAPSHOT_FIELD_NUMBER; hash = (53 * hash) + getSourceSnapshot().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -417,38 +374,38 @@ public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseF public static com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -472,16 +429,18 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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
    @@ -490,7 +449,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.CreateTableFromSnapshotRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -500,7 +459,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotRequest_fieldAccessorTable
    @@ -510,28 +469,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           parent_ = "";
    -
           tableId_ = "";
    -
           sourceSnapshot_ = "";
    -
           return this;
         }
     
    @@ -559,44 +509,24 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest build() {
         public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest buildPartial() {
           com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest result =
               new com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest(this);
    -      result.parent_ = parent_;
    -      result.tableId_ = tableId_;
    -      result.sourceSnapshot_ = sourceSnapshot_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -614,17 +544,20 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableFromSnapshotReq
             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.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -639,22 +572,56 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object parent_ = "";
    +
         /**
          *
          *
    @@ -680,6 +647,7 @@ public java.lang.String getParent() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -705,6 +673,7 @@ public com.google.protobuf.ByteString getParentBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -724,11 +693,12 @@ public Builder setParent(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -744,11 +714,12 @@ public Builder setParent(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearParent() {
    -
           parent_ = getDefaultInstance().getParent();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -769,19 +740,20 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
             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`.
    +     * 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]; @@ -799,12 +771,13 @@ public java.lang.String getTableId() { 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`.
    +     * 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]; @@ -822,12 +795,13 @@ public com.google.protobuf.ByteString getTableIdBytes() { 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`.
    +     * 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]; @@ -839,17 +813,18 @@ 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`.
    +     * 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]; @@ -857,17 +832,18 @@ public Builder setTableId(java.lang.String value) { * @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`.
    +     * 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]; @@ -880,20 +856,21 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { 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
    +     * 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}`.
          * 
    * @@ -914,13 +891,14 @@ public java.lang.String getSourceSnapshot() { 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
    +     * 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}`.
          * 
    * @@ -941,13 +919,14 @@ public com.google.protobuf.ByteString getSourceSnapshotBytes() { 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
    +     * 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}`.
          * 
    * @@ -962,18 +941,19 @@ 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
    +     * 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}`.
          * 
    * @@ -984,18 +964,19 @@ public Builder setSourceSnapshot(java.lang.String value) { * @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
    +     * 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}`.
          * 
    * @@ -1011,23 +992,12 @@ public Builder setSourceSnapshotBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sourceSnapshot_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableFromSnapshotRequest) } @@ -1049,7 +1019,18 @@ public CreateTableFromSnapshotRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateTableFromSnapshotRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java index f3a5b86e8f..eace6ad477 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -38,6 +41,7 @@ public interface CreateTableFromSnapshotRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * @@ -58,8 +62,8 @@ public interface CreateTableFromSnapshotRequestOrBuilder * * *
    -   * Required. The name by which the new table should be referred to within the parent
    -   * instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
    +   * 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]; @@ -67,12 +71,13 @@ public interface CreateTableFromSnapshotRequestOrBuilder * @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`.
    +   * 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]; @@ -85,9 +90,9 @@ public interface CreateTableFromSnapshotRequestOrBuilder * * *
    -   * 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
    +   * 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}`.
        * 
    * @@ -98,13 +103,14 @@ public interface CreateTableFromSnapshotRequestOrBuilder * @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
    +   * 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}`.
        * 
    * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java index 644b5c35b1..4b94f3f406 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest} */ -public final class CreateTableRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private CreateTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,108 +58,13 @@ private CreateTableRequest() { initialSplits_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CreateTableRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CreateTableRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableId_ = s; - break; - } - case 26: - { - com.google.bigtable.admin.v2.Table.Builder subBuilder = null; - if (table_ != null) { - subBuilder = table_.toBuilder(); - } - table_ = - input.readMessage(com.google.bigtable.admin.v2.Table.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(table_); - table_ = subBuilder.buildPartial(); - } - - break; - } - case 34: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - initialSplits_ = - new java.util.ArrayList< - com.google.bigtable.admin.v2.CreateTableRequest.Split>(); - mutable_bitField0_ |= 0x00000001; - } - initialSplits_.add( - input.readMessage( - com.google.bigtable.admin.v2.CreateTableRequest.Split.parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - initialSplits_ = java.util.Collections.unmodifiableList(initialSplits_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateTableRequest_fieldAccessorTable @@ -172,6 +91,7 @@ public interface SplitOrBuilder */ com.google.protobuf.ByteString getKey(); } + /** * * @@ -181,13 +101,24 @@ public interface SplitOrBuilder * * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest.Split} */ - public static final class Split extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private Split(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -195,66 +126,13 @@ private Split() { key_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Split(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Split( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - key_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_fieldAccessorTable @@ -264,7 +142,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int KEY_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString key_; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -298,7 +177,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!key_.isEmpty()) { output.writeBytes(1, key_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -310,7 +189,7 @@ public int getSerializedSize() { if (!key_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, key_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -327,7 +206,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.CreateTableRequest.Split) obj; if (!getKey().equals(other.getKey())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -340,7 +219,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -382,38 +261,38 @@ public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( public static com.google.bigtable.admin.v2.CreateTableRequest.Split parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -437,11 +316,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -451,8 +330,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest.Split} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -462,7 +340,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateTableRequest_Split_fieldAccessorTable @@ -472,24 +350,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.CreateTableRequest.Split.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; key_ = com.google.protobuf.ByteString.EMPTY; - return this; } @@ -517,44 +388,18 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split build() { 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); - result.key_ = key_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -570,10 +415,10 @@ public Builder mergeFrom(com.google.protobuf.Message other) { 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() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getKey().isEmpty()) { setKey(other.getKey()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -588,22 +433,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateTableRequest.Split parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.CreateTableRequest.Split) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -619,6 +486,7 @@ public Builder mergeFrom( public com.google.protobuf.ByteString getKey() { return key_; } + /** * * @@ -635,11 +503,12 @@ public Builder setKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -652,24 +521,12 @@ public Builder setKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearKey() { - + bitField0_ = (bitField0_ & ~0x00000001); key_ = getDefaultInstance().getKey(); onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableRequest.Split) } @@ -691,7 +548,19 @@ public Split parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Split(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -710,8 +579,12 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split getDefaultInstanceF } } + private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * @@ -738,6 +611,7 @@ public java.lang.String getParent() { return s; } } + /** * * @@ -766,13 +640,16 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int TABLE_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object tableId_; + + @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`.
    +   * 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.
        * 
    * @@ -792,12 +669,13 @@ public java.lang.String getTableId() { 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`.
    +   * 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.
        * 
    * @@ -820,6 +698,7 @@ public com.google.protobuf.ByteString getTableIdBytes() { public static final int TABLE_FIELD_NUMBER = 3; private com.google.bigtable.admin.v2.Table table_; + /** * * @@ -834,8 +713,9 @@ public com.google.protobuf.ByteString getTableIdBytes() { */ @java.lang.Override public boolean hasTable() { - return table_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -852,6 +732,7 @@ public boolean hasTable() { public com.google.bigtable.admin.v2.Table getTable() { return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; } + /** * * @@ -864,11 +745,14 @@ public com.google.bigtable.admin.v2.Table getTable() { */ @java.lang.Override public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { - return getTable(); + 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_; + /** * * @@ -877,16 +761,18 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { * 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"]` + * `"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"}.` + * - 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; @@ -896,6 +782,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { getInitialSplitsList() { return initialSplits_; } + /** * * @@ -904,16 +791,18 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { * 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"]` + * `"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"}.` + * - 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; @@ -923,6 +812,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { getInitialSplitsOrBuilderList() { return initialSplits_; } + /** * * @@ -931,16 +821,18 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { * 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"]` + * `"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"}.` + * - 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; @@ -949,6 +841,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { public int getInitialSplitsCount() { return initialSplits_.size(); } + /** * * @@ -957,16 +850,18 @@ public int getInitialSplitsCount() { * 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"]` + * `"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"}.` + * - 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; @@ -975,6 +870,7 @@ public int getInitialSplitsCount() { public com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(int index) { return initialSplits_.get(index); } + /** * * @@ -983,16 +879,18 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(in * 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"]` + * `"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"}.` + * - 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; @@ -1017,19 +915,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getTableIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableId_); } - if (table_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getTable()); } for (int i = 0; i < initialSplits_.size(); i++) { output.writeMessage(4, initialSplits_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1038,19 +936,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getTableIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableId_); } - if (table_ != null) { + 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 += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1073,7 +971,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTable().equals(other.getTable())) return false; } if (!getInitialSplitsList().equals(other.getInitialSplitsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1096,7 +994,7 @@ public int hashCode() { hash = (37 * hash) + INITIAL_SPLITS_FIELD_NUMBER; hash = (53 * hash) + getInitialSplitsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1138,38 +1036,38 @@ public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom( public static com.google.bigtable.admin.v2.CreateTableRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1192,10 +1090,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1206,7 +1105,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.CreateTableRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1216,7 +1115,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CreateTableRequest_fieldAccessorTable @@ -1230,36 +1129,36 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getInitialSplitsFieldBuilder(); + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetTableFieldBuilder(); + internalGetInitialSplitsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - tableId_ = ""; - - if (tableBuilder_ == null) { - table_ = null; - } else { - table_ = null; + table_ = null; + if (tableBuilder_ != null) { + tableBuilder_.dispose(); tableBuilder_ = null; } if (initialSplitsBuilder_ == null) { initialSplits_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + initialSplits_ = null; initialSplitsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -1287,58 +1186,41 @@ public com.google.bigtable.admin.v2.CreateTableRequest build() { public com.google.bigtable.admin.v2.CreateTableRequest buildPartial() { com.google.bigtable.admin.v2.CreateTableRequest result = new com.google.bigtable.admin.v2.CreateTableRequest(this); - int from_bitField0_ = bitField0_; - result.parent_ = parent_; - result.tableId_ = tableId_; - if (tableBuilder_ == null) { - result.table_ = table_; - } else { - result.table_ = tableBuilder_.build(); + 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_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { initialSplits_ = java.util.Collections.unmodifiableList(initialSplits_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); } result.initialSplits_ = initialSplits_; } else { result.initialSplits_ = initialSplitsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -1356,10 +1238,12 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest other) 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()) { @@ -1369,7 +1253,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest other) if (!other.initialSplits_.isEmpty()) { if (initialSplits_.isEmpty()) { initialSplits_ = other.initialSplits_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureInitialSplitsIsMutable(); initialSplits_.addAll(other.initialSplits_); @@ -1382,17 +1266,17 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest other) initialSplitsBuilder_.dispose(); initialSplitsBuilder_ = null; initialSplits_ = other.initialSplits_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); initialSplitsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getInitialSplitsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetInitialSplitsFieldBuilder() : null; } else { initialSplitsBuilder_.addAllMessages(other.initialSplits_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1407,23 +1291,70 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.CreateTableRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.CreateTableRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object parent_ = ""; + /** * * @@ -1449,6 +1380,7 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * @@ -1474,6 +1406,7 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1493,11 +1426,12 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1513,11 +1447,12 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1538,19 +1473,20 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { 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`.
    +     * 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.
          * 
    * @@ -1569,12 +1505,13 @@ public java.lang.String getTableId() { 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`.
    +     * 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.
          * 
    * @@ -1593,12 +1530,13 @@ public com.google.protobuf.ByteString getTableIdBytes() { 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`.
    +     * 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.
          * 
    * @@ -1611,17 +1549,18 @@ 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`.
    +     * 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.
          * 
    * @@ -1630,17 +1569,18 @@ public Builder setTableId(java.lang.String value) { * @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`.
    +     * 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.
          * 
    * @@ -1654,18 +1594,19 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private com.google.bigtable.admin.v2.Table table_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -1679,8 +1620,9 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { * @return Whether the table field is set. */ public boolean hasTable() { - return tableBuilder_ != null || table_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1700,6 +1642,7 @@ public com.google.bigtable.admin.v2.Table getTable() { return tableBuilder_.getMessage(); } } + /** * * @@ -1716,13 +1659,14 @@ public Builder setTable(com.google.bigtable.admin.v2.Table value) { throw new NullPointerException(); } table_ = value; - onChanged(); } else { tableBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1736,13 +1680,14 @@ public Builder setTable(com.google.bigtable.admin.v2.Table value) { public Builder setTable(com.google.bigtable.admin.v2.Table.Builder builderForValue) { if (tableBuilder_ == null) { table_ = builderForValue.build(); - onChanged(); } else { tableBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1755,19 +1700,23 @@ public Builder setTable(com.google.bigtable.admin.v2.Table.Builder builderForVal */ public Builder mergeTable(com.google.bigtable.admin.v2.Table value) { if (tableBuilder_ == null) { - if (table_ != null) { - table_ = - com.google.bigtable.admin.v2.Table.newBuilder(table_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && table_ != null + && table_ != com.google.bigtable.admin.v2.Table.getDefaultInstance()) { + getTableBuilder().mergeFrom(value); } else { table_ = value; } - onChanged(); } else { tableBuilder_.mergeFrom(value); } - + if (table_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1779,16 +1728,16 @@ public Builder mergeTable(com.google.bigtable.admin.v2.Table value) { *
    */ public Builder clearTable() { - if (tableBuilder_ == null) { - table_ = null; - onChanged(); - } else { - table_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + table_ = null; + if (tableBuilder_ != null) { + tableBuilder_.dispose(); tableBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1800,10 +1749,11 @@ public Builder clearTable() { *
    */ public com.google.bigtable.admin.v2.Table.Builder getTableBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getTableFieldBuilder().getBuilder(); + return internalGetTableFieldBuilder().getBuilder(); } + /** * * @@ -1821,6 +1771,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { return table_ == null ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : table_; } } + /** * * @@ -1831,14 +1782,14 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { * .google.bigtable.admin.v2.Table table = 3 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Table, com.google.bigtable.admin.v2.Table.Builder, com.google.bigtable.admin.v2.TableOrBuilder> - getTableFieldBuilder() { + internalGetTableFieldBuilder() { if (tableBuilder_ == null) { tableBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Table, com.google.bigtable.admin.v2.Table.Builder, com.google.bigtable.admin.v2.TableOrBuilder>( @@ -1852,15 +1803,15 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTableOrBuilder() { java.util.Collections.emptyList(); private void ensureInitialSplitsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { initialSplits_ = new java.util.ArrayList( initialSplits_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + 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> @@ -1874,16 +1825,18 @@ private void ensureInitialSplitsIsMutable() { * 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"]` + * `"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"}.` + * - 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; @@ -1896,6 +1849,7 @@ private void ensureInitialSplitsIsMutable() { return initialSplitsBuilder_.getMessageList(); } } + /** * * @@ -1904,16 +1858,18 @@ private void ensureInitialSplitsIsMutable() { * 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"]` + * `"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"}.` + * - 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; @@ -1925,6 +1881,7 @@ public int getInitialSplitsCount() { return initialSplitsBuilder_.getCount(); } } + /** * * @@ -1933,16 +1890,18 @@ public int getInitialSplitsCount() { * 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"]` + * `"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"}.` + * - 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; @@ -1954,6 +1913,7 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(in return initialSplitsBuilder_.getMessage(index); } } + /** * * @@ -1962,16 +1922,18 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split getInitialSplits(in * 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"]` + * `"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"}.` + * - 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; @@ -1990,6 +1952,7 @@ public Builder setInitialSplits( } return this; } + /** * * @@ -1998,16 +1961,18 @@ public Builder setInitialSplits( * 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"]` + * `"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"}.` + * - 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; @@ -2023,6 +1988,7 @@ public Builder setInitialSplits( } return this; } + /** * * @@ -2031,16 +1997,18 @@ public Builder setInitialSplits( * 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"]` + * `"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"}.` + * - 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; @@ -2058,6 +2026,7 @@ public Builder addInitialSplits(com.google.bigtable.admin.v2.CreateTableRequest. } return this; } + /** * * @@ -2066,16 +2035,18 @@ public Builder addInitialSplits(com.google.bigtable.admin.v2.CreateTableRequest. * 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"]` + * `"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"}.` + * - 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; @@ -2094,6 +2065,7 @@ public Builder addInitialSplits( } return this; } + /** * * @@ -2102,16 +2074,18 @@ public Builder addInitialSplits( * 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"]` + * `"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"}.` + * - 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; @@ -2127,6 +2101,7 @@ public Builder addInitialSplits( } return this; } + /** * * @@ -2135,16 +2110,18 @@ public Builder addInitialSplits( * 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"]` + * `"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"}.` + * - 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; @@ -2160,6 +2137,7 @@ public Builder addInitialSplits( } return this; } + /** * * @@ -2168,16 +2146,18 @@ public Builder addInitialSplits( * 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"]` + * `"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"}.` + * - 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; @@ -2194,6 +2174,7 @@ public Builder addAllInitialSplits( } return this; } + /** * * @@ -2202,16 +2183,18 @@ public Builder addAllInitialSplits( * 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"]` + * `"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"}.` + * - 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; @@ -2219,13 +2202,14 @@ public Builder addAllInitialSplits( public Builder clearInitialSplits() { if (initialSplitsBuilder_ == null) { initialSplits_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { initialSplitsBuilder_.clear(); } return this; } + /** * * @@ -2234,16 +2218,18 @@ public Builder clearInitialSplits() { * 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"]` + * `"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"}.` + * - 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; @@ -2258,6 +2244,7 @@ public Builder removeInitialSplits(int index) { } return this; } + /** * * @@ -2266,24 +2253,27 @@ public Builder removeInitialSplits(int index) { * 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"]` + * `"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"}.` + * - 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 getInitialSplitsFieldBuilder().getBuilder(index); + return internalGetInitialSplitsFieldBuilder().getBuilder(index); } + /** * * @@ -2292,16 +2282,18 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder getInitialS * 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"]` + * `"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"}.` + * - 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; @@ -2314,6 +2306,7 @@ public com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitial return initialSplitsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2322,16 +2315,18 @@ public com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitial * 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"]` + * `"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"}.` + * - 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; @@ -2344,6 +2339,7 @@ public com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitial return java.util.Collections.unmodifiableList(initialSplits_); } } + /** * * @@ -2352,24 +2348,27 @@ public com.google.bigtable.admin.v2.CreateTableRequest.SplitOrBuilder getInitial * 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"]` + * `"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"}.` + * - 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 getInitialSplitsFieldBuilder() + return internalGetInitialSplitsFieldBuilder() .addBuilder(com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()); } + /** * * @@ -2378,26 +2377,29 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder addInitialS * 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"]` + * `"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"}.` + * - 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 getInitialSplitsFieldBuilder() + return internalGetInitialSplitsFieldBuilder() .addBuilder( index, com.google.bigtable.admin.v2.CreateTableRequest.Split.getDefaultInstance()); } + /** * * @@ -2406,38 +2408,40 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder addInitialS * 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"]` + * `"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"}.` + * - 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 getInitialSplitsFieldBuilder().getBuilderList(); + return internalGetInitialSplitsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + 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> - getInitialSplitsFieldBuilder() { + internalGetInitialSplitsFieldBuilder() { if (initialSplitsBuilder_ == null) { initialSplitsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + 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_ & 0x00000001) != 0), + ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); initialSplits_ = null; @@ -2445,17 +2449,6 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder addInitialS return initialSplitsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.CreateTableRequest) } @@ -2477,7 +2470,18 @@ public CreateTableRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateTableRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java index c456476e3f..2f7c55ecf5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -38,6 +41,7 @@ public interface CreateTableRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * @@ -58,8 +62,8 @@ public interface CreateTableRequestOrBuilder * * *
    -   * Required. The name by which the new table should be referred to within the parent
    -   * instance, e.g., `foobar` rather than `{parent}/tables/foobar`.
    +   * 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.
        * 
    * @@ -68,12 +72,13 @@ public interface CreateTableRequestOrBuilder * @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`.
    +   * 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.
        * 
    * @@ -96,6 +101,7 @@ public interface CreateTableRequestOrBuilder * @return Whether the table field is set. */ boolean hasTable(); + /** * * @@ -109,6 +115,7 @@ public interface CreateTableRequestOrBuilder * @return The table. */ com.google.bigtable.admin.v2.Table getTable(); + /** * * @@ -129,21 +136,24 @@ public interface CreateTableRequestOrBuilder * 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"]` + * `"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"}.` + * - 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(); + /** * * @@ -152,21 +162,24 @@ public interface CreateTableRequestOrBuilder * 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"]` + * `"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"}.` + * - 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); + /** * * @@ -175,21 +188,24 @@ public interface CreateTableRequestOrBuilder * 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"]` + * `"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"}.` + * - 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(); + /** * * @@ -198,22 +214,25 @@ public interface CreateTableRequestOrBuilder * 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"]` + * `"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"}.` + * - 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(); + /** * * @@ -222,16 +241,18 @@ public interface CreateTableRequestOrBuilder * 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"]` + * `"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"}.` + * - 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; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java deleted file mode 100644 index 51f9cb3848..0000000000 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * 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.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 CryptoKeyName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_KEY_RING_CRYPTO_KEY = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String keyRing; - private final String cryptoKey; - - @Deprecated - protected CryptoKeyName() { - project = null; - location = null; - keyRing = null; - cryptoKey = null; - } - - private CryptoKeyName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - keyRing = Preconditions.checkNotNull(builder.getKeyRing()); - cryptoKey = Preconditions.checkNotNull(builder.getCryptoKey()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getKeyRing() { - return keyRing; - } - - public String getCryptoKey() { - return cryptoKey; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static CryptoKeyName of( - String project, String location, String keyRing, String cryptoKey) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setKeyRing(keyRing) - .setCryptoKey(cryptoKey) - .build(); - } - - public static String format(String project, String location, String keyRing, String cryptoKey) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setKeyRing(keyRing) - .setCryptoKey(cryptoKey) - .build() - .toString(); - } - - public static CryptoKeyName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.validatedMatch( - formattedString, "CryptoKeyName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("location"), - matchMap.get("key_ring"), - matchMap.get("crypto_key")); - } - - 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 (CryptoKeyName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.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); - } - if (keyRing != null) { - fieldMapBuilder.put("key_ring", keyRing); - } - if (cryptoKey != null) { - fieldMapBuilder.put("crypto_key", cryptoKey); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.instantiate( - "project", project, "location", location, "key_ring", keyRing, "crypto_key", cryptoKey); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - CryptoKeyName that = ((CryptoKeyName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.keyRing, that.keyRing) - && Objects.equals(this.cryptoKey, that.cryptoKey); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(keyRing); - h *= 1000003; - h ^= Objects.hashCode(cryptoKey); - return h; - } - - /** - * Builder for - * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. - */ - public static class Builder { - private String project; - private String location; - private String keyRing; - private String cryptoKey; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getKeyRing() { - return keyRing; - } - - public String getCryptoKey() { - return cryptoKey; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setKeyRing(String keyRing) { - this.keyRing = keyRing; - return this; - } - - public Builder setCryptoKey(String cryptoKey) { - this.cryptoKey = cryptoKey; - return this; - } - - private Builder(CryptoKeyName cryptoKeyName) { - project = cryptoKeyName.project; - location = cryptoKeyName.location; - keyRing = cryptoKeyName.keyRing; - cryptoKey = cryptoKeyName.cryptoKey; - } - - public CryptoKeyName build() { - return new CryptoKeyName(this); - } - } -} diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java deleted file mode 100644 index c93c34e88a..0000000000 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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.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 CryptoKeyVersionName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String keyRing; - private final String cryptoKey; - private final String cryptoKeyVersion; - - @Deprecated - protected CryptoKeyVersionName() { - project = null; - location = null; - keyRing = null; - cryptoKey = null; - cryptoKeyVersion = null; - } - - private CryptoKeyVersionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - keyRing = Preconditions.checkNotNull(builder.getKeyRing()); - cryptoKey = Preconditions.checkNotNull(builder.getCryptoKey()); - cryptoKeyVersion = Preconditions.checkNotNull(builder.getCryptoKeyVersion()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getKeyRing() { - return keyRing; - } - - public String getCryptoKey() { - return cryptoKey; - } - - public String getCryptoKeyVersion() { - return cryptoKeyVersion; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static CryptoKeyVersionName of( - String project, String location, String keyRing, String cryptoKey, String cryptoKeyVersion) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setKeyRing(keyRing) - .setCryptoKey(cryptoKey) - .setCryptoKeyVersion(cryptoKeyVersion) - .build(); - } - - public static String format( - String project, String location, String keyRing, String cryptoKey, String cryptoKeyVersion) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setKeyRing(keyRing) - .setCryptoKey(cryptoKey) - .setCryptoKeyVersion(cryptoKeyVersion) - .build() - .toString(); - } - - public static CryptoKeyVersionName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION.validatedMatch( - formattedString, "CryptoKeyVersionName.parse: formattedString not in valid format"); - return of( - matchMap.get("project"), - matchMap.get("location"), - matchMap.get("key_ring"), - matchMap.get("crypto_key"), - matchMap.get("crypto_key_version")); - } - - 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 (CryptoKeyVersionName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION.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); - } - if (keyRing != null) { - fieldMapBuilder.put("key_ring", keyRing); - } - if (cryptoKey != null) { - fieldMapBuilder.put("crypto_key", cryptoKey); - } - if (cryptoKeyVersion != null) { - fieldMapBuilder.put("crypto_key_version", cryptoKeyVersion); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION.instantiate( - "project", - project, - "location", - location, - "key_ring", - keyRing, - "crypto_key", - cryptoKey, - "crypto_key_version", - cryptoKeyVersion); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - CryptoKeyVersionName that = ((CryptoKeyVersionName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.keyRing, that.keyRing) - && Objects.equals(this.cryptoKey, that.cryptoKey) - && Objects.equals(this.cryptoKeyVersion, that.cryptoKeyVersion); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(keyRing); - h *= 1000003; - h ^= Objects.hashCode(cryptoKey); - h *= 1000003; - h ^= Objects.hashCode(cryptoKeyVersion); - return h; - } - - /** - * Builder for - * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}. - */ - public static class Builder { - private String project; - private String location; - private String keyRing; - private String cryptoKey; - private String cryptoKeyVersion; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getKeyRing() { - return keyRing; - } - - public String getCryptoKey() { - return cryptoKey; - } - - public String getCryptoKeyVersion() { - return cryptoKeyVersion; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setKeyRing(String keyRing) { - this.keyRing = keyRing; - return this; - } - - public Builder setCryptoKey(String cryptoKey) { - this.cryptoKey = cryptoKey; - return this; - } - - public Builder setCryptoKeyVersion(String cryptoKeyVersion) { - this.cryptoKeyVersion = cryptoKeyVersion; - return this; - } - - private Builder(CryptoKeyVersionName cryptoKeyVersionName) { - project = cryptoKeyVersionName.project; - location = cryptoKeyVersionName.location; - keyRing = cryptoKeyVersionName.keyRing; - cryptoKey = cryptoKeyVersionName.cryptoKey; - cryptoKeyVersion = cryptoKeyVersionName.cryptoKeyVersion; - } - - public CryptoKeyVersionName build() { - return new CryptoKeyVersionName(this); - } - } -} diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWrites.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWrites.java new file mode 100644 index 0000000000..77e24428e6 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWritesOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWritesOrBuilder.java new file mode 100644 index 0000000000..5fca3d815d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java index d4b0e4e310..2c21eeab55 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.DeleteAppProfileRequest} */ -public final class DeleteAppProfileRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private DeleteAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,73 +55,13 @@ private DeleteAppProfileRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteAppProfileRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteAppProfileRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - ignoreWarnings_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable @@ -117,12 +71,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * *
    -   * Required. The unique name of the app profile to be deleted. Values are of the form
    +   * Required. The unique name of the app profile to be deleted. Values are of
    +   * the form
        * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * @@ -144,11 +102,13 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Required. The unique name of the app profile to be deleted. Values are of the form
    +   * Required. The unique name of the app profile to be deleted. Values are of
    +   * the form
        * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * @@ -172,7 +132,8 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int IGNORE_WARNINGS_FIELD_NUMBER = 2; - private boolean ignoreWarnings_; + private boolean ignoreWarnings_ = false; + /** * * @@ -203,13 +164,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } if (ignoreWarnings_ != false) { output.writeBool(2, ignoreWarnings_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -218,13 +179,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + 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 += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -242,7 +203,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -257,7 +218,7 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -299,38 +260,38 @@ public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( public static com.google.bigtable.admin.v2.DeleteAppProfileRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -353,10 +314,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -366,7 +328,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.DeleteAppProfileRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -376,7 +338,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteAppProfileRequest_fieldAccessorTable @@ -386,26 +348,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.DeleteAppProfileRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - ignoreWarnings_ = false; - return this; } @@ -433,43 +387,21 @@ public com.google.bigtable.admin.v2.DeleteAppProfileRequest build() { public com.google.bigtable.admin.v2.DeleteAppProfileRequest buildPartial() { com.google.bigtable.admin.v2.DeleteAppProfileRequest result = new com.google.bigtable.admin.v2.DeleteAppProfileRequest(this); - result.name_ = name_; - result.ignoreWarnings_ = ignoreWarnings_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -487,12 +419,13 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteAppProfileRequest ot return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (other.getIgnoreWarnings() != false) { setIgnoreWarnings(other.getIgnoreWarnings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -507,27 +440,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.DeleteAppProfileRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.DeleteAppProfileRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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
    +     * Required. The unique name of the app profile to be deleted. Values are of
    +     * the form
          * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * @@ -548,11 +510,13 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the app profile to be deleted. Values are of the form
    +     * Required. The unique name of the app profile to be deleted. Values are of
    +     * the form
          * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * @@ -573,11 +537,13 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the app profile to be deleted. Values are of the form
    +     * Required. The unique name of the app profile to be deleted. Values are of
    +     * the form
          * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * @@ -592,16 +558,18 @@ 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
    +     * Required. The unique name of the app profile to be deleted. Values are of
    +     * the form
          * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * @@ -612,16 +580,18 @@ public Builder setName(java.lang.String value) { * @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
    +     * Required. The unique name of the app profile to be deleted. Values are of
    +     * the form
          * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * @@ -637,13 +607,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private boolean ignoreWarnings_; + /** * * @@ -659,6 +630,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { public boolean getIgnoreWarnings() { return ignoreWarnings_; } + /** * * @@ -674,9 +646,11 @@ public boolean getIgnoreWarnings() { public Builder setIgnoreWarnings(boolean value) { ignoreWarnings_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -689,23 +663,12 @@ public Builder setIgnoreWarnings(boolean value) { * @return This builder for chaining. */ public Builder clearIgnoreWarnings() { - + bitField0_ = (bitField0_ & ~0x00000002); ignoreWarnings_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteAppProfileRequest) } @@ -727,7 +690,18 @@ public DeleteAppProfileRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteAppProfileRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java index f62608712c..5a64645a06 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,7 +30,8 @@ public interface DeleteAppProfileRequestOrBuilder * * *
    -   * Required. The unique name of the app profile to be deleted. Values are of the form
    +   * Required. The unique name of the app profile to be deleted. Values are of
    +   * the form
        * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * @@ -38,11 +42,13 @@ public interface DeleteAppProfileRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
    -   * Required. The unique name of the app profile to be deleted. Values are of the form
    +   * Required. The unique name of the app profile to be deleted. Values are of
    +   * the form
        * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequest.java new file mode 100644 index 0000000000..9c9bd001cb --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequestOrBuilder.java new file mode 100644 index 0000000000..ecce4aa278 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java index bf0a30d5cc..2ff3407d76 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -22,18 +24,31 @@ * * *
    - * The request for [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
    + * The request for
    + * [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
      * 
    * * Protobuf type {@code google.bigtable.admin.v2.DeleteBackupRequest} */ -public final class DeleteBackupRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private DeleteBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +56,13 @@ private DeleteBackupRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteBackupRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteBackupRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_fieldAccessorTable @@ -112,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -140,6 +103,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -182,10 +146,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -194,10 +158,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +178,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.DeleteBackupRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -227,7 +191,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -269,38 +233,38 @@ public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( public static com.google.bigtable.admin.v2.DeleteBackupRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -323,20 +287,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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].
    +   * 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.GeneratedMessageV3.Builder + 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 { @@ -346,7 +312,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_DeleteBackupRequest_fieldAccessorTable @@ -356,24 +322,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.DeleteBackupRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -401,42 +360,18 @@ public com.google.bigtable.admin.v2.DeleteBackupRequest build() { public com.google.bigtable.admin.v2.DeleteBackupRequest buildPartial() { com.google.bigtable.admin.v2.DeleteBackupRequest result = new com.google.bigtable.admin.v2.DeleteBackupRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -454,9 +389,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteBackupRequest other) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -471,21 +407,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.DeleteBackupRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.DeleteBackupRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -512,6 +471,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -538,6 +498,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -558,11 +519,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -579,11 +541,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -605,23 +568,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteBackupRequest) } @@ -643,7 +595,18 @@ public DeleteBackupRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteBackupRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java index 140db00664..354f00f56d 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -39,6 +42,7 @@ public interface DeleteBackupRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java index 3d21d301f9..8496a9a7f7 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.DeleteClusterRequest} */ -public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private DeleteClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +55,13 @@ private DeleteClusterRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteClusterRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteClusterRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable @@ -112,13 +71,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @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}`.
    +   * Required. The unique name of the cluster to be deleted. Values are of the
    +   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
        * 
    * * @@ -139,12 +101,13 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Required. The unique name of the cluster to be deleted. Values are of the form
    -   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
    +   * Required. The unique name of the cluster to be deleted. Values are of the
    +   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
        * 
    * * @@ -180,10 +143,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -192,10 +155,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +175,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.DeleteClusterRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,7 +188,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -267,38 +230,38 @@ public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( public static com.google.bigtable.admin.v2.DeleteClusterRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -321,10 +284,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -334,7 +298,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.DeleteClusterRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -344,7 +308,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteClusterRequest_fieldAccessorTable @@ -354,24 +318,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.DeleteClusterRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -399,42 +356,18 @@ public com.google.bigtable.admin.v2.DeleteClusterRequest build() { public com.google.bigtable.admin.v2.DeleteClusterRequest buildPartial() { com.google.bigtable.admin.v2.DeleteClusterRequest result = new com.google.bigtable.admin.v2.DeleteClusterRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -452,9 +385,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteClusterRequest other return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -469,28 +403,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.DeleteClusterRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.DeleteClusterRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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}`.
    +     * Required. The unique name of the cluster to be deleted. Values are of the
    +     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
          * 
    * * @@ -510,12 +466,13 @@ public java.lang.String getName() { 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}`.
    +     * Required. The unique name of the cluster to be deleted. Values are of the
    +     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
          * 
    * * @@ -535,12 +492,13 @@ public com.google.protobuf.ByteString getNameBytes() { 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}`.
    +     * Required. The unique name of the cluster to be deleted. Values are of the
    +     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
          * 
    * * @@ -554,17 +512,18 @@ 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}`.
    +     * Required. The unique name of the cluster to be deleted. Values are of the
    +     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
          * 
    * * @@ -574,17 +533,18 @@ public Builder setName(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the cluster to be deleted. Values are of the
    +     * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
          * 
    * * @@ -599,23 +559,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteClusterRequest) } @@ -637,7 +586,18 @@ public DeleteClusterRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteClusterRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java index 88c65b724d..8028e5c716 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteClusterRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,8 +30,8 @@ public interface DeleteClusterRequestOrBuilder * * *
    -   * Required. The unique name of the cluster to be deleted. Values are of the form
    -   * `projects/{project}/instances/{instance}/clusters/{cluster}`.
    +   * Required. The unique name of the cluster to be deleted. Values are of the
    +   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
        * 
    * * @@ -38,12 +41,13 @@ public interface DeleteClusterRequestOrBuilder * @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}`.
    +   * Required. The unique name of the cluster to be deleted. Values are of the
    +   * form `projects/{project}/instances/{instance}/clusters/{cluster}`.
        * 
    * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java index 1d6b1cf152..7b8e364075 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.DeleteInstanceRequest} */ -public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +55,13 @@ private DeleteInstanceRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteInstanceRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private DeleteInstanceRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable @@ -112,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -139,6 +101,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -180,10 +143,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -192,10 +155,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +175,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.DeleteInstanceRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,7 +188,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -267,38 +230,38 @@ public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( public static com.google.bigtable.admin.v2.DeleteInstanceRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -321,10 +284,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -334,7 +298,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.DeleteInstanceRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -344,7 +308,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_DeleteInstanceRequest_fieldAccessorTable @@ -354,24 +318,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.DeleteInstanceRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -399,42 +356,18 @@ public com.google.bigtable.admin.v2.DeleteInstanceRequest build() { public com.google.bigtable.admin.v2.DeleteInstanceRequest buildPartial() { com.google.bigtable.admin.v2.DeleteInstanceRequest result = new com.google.bigtable.admin.v2.DeleteInstanceRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -452,9 +385,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteInstanceRequest othe return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -469,22 +403,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.DeleteInstanceRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.DeleteInstanceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -510,6 +466,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -535,6 +492,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -554,11 +512,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -574,11 +533,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -599,23 +559,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteInstanceRequest) } @@ -637,7 +586,18 @@ public DeleteInstanceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteInstanceRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java index 2f53ef3e45..3d06b3fef6 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteInstanceRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -38,6 +41,7 @@ public interface DeleteInstanceRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequest.java new file mode 100644 index 0000000000..a57bf2c2c8 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteLogicalViewRequestOrBuilder.java new file mode 100644 index 0000000000..9b672fc9e4 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequest.java new file mode 100644 index 0000000000..03c2a8ee31 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteMaterializedViewRequestOrBuilder.java new file mode 100644 index 0000000000..eb02b9b9ad --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequest.java new file mode 100644 index 0000000000..61110600df --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSchemaBundleRequestOrBuilder.java new file mode 100644 index 0000000000..40248b0a4b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java index 73c6f25cb1..c13b17330a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -24,6 +26,7 @@ *
      * 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
    @@ -32,13 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.DeleteSnapshotRequest}
      */
    -public final class DeleteSnapshotRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private DeleteSnapshotRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -46,68 +61,13 @@ private DeleteSnapshotRequest() {
         name_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new DeleteSnapshotRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private DeleteSnapshotRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_fieldAccessorTable
    @@ -117,7 +77,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
    @@ -145,6 +108,7 @@ public java.lang.String getName() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -187,10 +151,10 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getNameBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -199,10 +163,10 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getNameBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -219,7 +183,7 @@ public boolean equals(final java.lang.Object obj) {
             (com.google.bigtable.admin.v2.DeleteSnapshotRequest) obj;
     
         if (!getName().equals(other.getName())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -232,7 +196,7 @@ public int hashCode() {
         hash = (19 * hash) + getDescriptor().hashCode();
         hash = (37 * hash) + NAME_FIELD_NUMBER;
         hash = (53 * hash) + getName().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -274,38 +238,38 @@ public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.DeleteSnapshotRequest parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -328,16 +292,18 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  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
    @@ -346,7 +312,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.DeleteSnapshotRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -356,7 +322,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_DeleteSnapshotRequest_fieldAccessorTable
    @@ -366,24 +332,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.DeleteSnapshotRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
           return this;
         }
     
    @@ -411,42 +370,18 @@ public com.google.bigtable.admin.v2.DeleteSnapshotRequest build() {
         public com.google.bigtable.admin.v2.DeleteSnapshotRequest buildPartial() {
           com.google.bigtable.admin.v2.DeleteSnapshotRequest result =
               new com.google.bigtable.admin.v2.DeleteSnapshotRequest(this);
    -      result.name_ = name_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -464,9 +399,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteSnapshotRequest othe
             return this;
           if (!other.getName().isEmpty()) {
             name_ = other.name_;
    +        bitField0_ |= 0x00000001;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -481,22 +417,44 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.DeleteSnapshotRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.DeleteSnapshotRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
    @@ -523,6 +481,7 @@ public java.lang.String getName() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -549,6 +508,7 @@ public com.google.protobuf.ByteString getNameBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -569,11 +529,12 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -590,11 +551,12 @@ public Builder setName(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearName() {
    -
           name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -616,23 +578,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteSnapshotRequest)
       }
     
    @@ -654,7 +605,18 @@ public DeleteSnapshotRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new DeleteSnapshotRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java
    index 0a137b602d..01c3a680e9 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteSnapshotRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -39,6 +42,7 @@ public interface DeleteSnapshotRequestOrBuilder
        * @return The name.
        */
       java.lang.String getName();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java
    index fc9df7b550..807389c9bc 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -28,13 +30,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.DeleteTableRequest}
      */
    -public final class DeleteTableRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private DeleteTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -42,68 +56,13 @@ private DeleteTableRequest() {
         name_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new DeleteTableRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private DeleteTableRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_DeleteTableRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_DeleteTableRequest_fieldAccessorTable
    @@ -113,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
    @@ -141,6 +103,7 @@ public java.lang.String getName() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -183,10 +146,10 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getNameBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -195,10 +158,10 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getNameBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -215,7 +178,7 @@ public boolean equals(final java.lang.Object obj) {
             (com.google.bigtable.admin.v2.DeleteTableRequest) obj;
     
         if (!getName().equals(other.getName())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -228,7 +191,7 @@ public int hashCode() {
         hash = (19 * hash) + getDescriptor().hashCode();
         hash = (37 * hash) + NAME_FIELD_NUMBER;
         hash = (53 * hash) + getName().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -270,38 +233,38 @@ public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.DeleteTableRequest parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -324,10 +287,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -338,7 +302,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.DeleteTableRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -348,7 +312,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_DeleteTableRequest_fieldAccessorTable
    @@ -358,24 +322,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.DeleteTableRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
           return this;
         }
     
    @@ -403,42 +360,18 @@ public com.google.bigtable.admin.v2.DeleteTableRequest build() {
         public com.google.bigtable.admin.v2.DeleteTableRequest buildPartial() {
           com.google.bigtable.admin.v2.DeleteTableRequest result =
               new com.google.bigtable.admin.v2.DeleteTableRequest(this);
    -      result.name_ = name_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -456,9 +389,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DeleteTableRequest other)
             return this;
           if (!other.getName().isEmpty()) {
             name_ = other.name_;
    +        bitField0_ |= 0x00000001;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -473,21 +407,44 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.DeleteTableRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.DeleteTableRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
    @@ -514,6 +471,7 @@ public java.lang.String getName() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -540,6 +498,7 @@ public com.google.protobuf.ByteString getNameBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -560,11 +519,12 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -581,11 +541,12 @@ public Builder setName(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearName() {
    -
           name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -607,23 +568,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DeleteTableRequest)
       }
     
    @@ -645,7 +595,18 @@ public DeleteTableRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new DeleteTableRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java
    index f70089424e..8e5c51af17 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -39,6 +42,7 @@ public interface DeleteTableRequestOrBuilder
        * @return The name.
        */
       java.lang.String getName();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java
    index 1dd43e9898..9be56fcb01 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -28,13 +30,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.DropRowRangeRequest}
      */
    -public final class DropRowRangeRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private DropRowRangeRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -42,80 +56,13 @@ private DropRowRangeRequest() {
         name_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new DropRowRangeRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private DropRowRangeRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          case 18:
    -            {
    -              targetCase_ = 2;
    -              target_ = input.readBytes();
    -              break;
    -            }
    -          case 24:
    -            {
    -              targetCase_ = 3;
    -              target_ = input.readBool();
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_fieldAccessorTable
    @@ -125,6 +72,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       private int targetCase_ = 0;
    +
    +  @SuppressWarnings("serial")
       private java.lang.Object target_;
     
       public enum TargetCase
    @@ -139,6 +88,7 @@ public enum TargetCase
         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.
    @@ -172,7 +122,10 @@ public TargetCase getTargetCase() {
       }
     
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
    @@ -200,6 +153,7 @@ public java.lang.String getName() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -229,6 +183,7 @@ public com.google.protobuf.ByteString getNameBytes() {
       }
     
       public static final int ROW_KEY_PREFIX_FIELD_NUMBER = 2;
    +
       /**
        *
        *
    @@ -245,6 +200,7 @@ public com.google.protobuf.ByteString getNameBytes() {
       public boolean hasRowKeyPrefix() {
         return targetCase_ == 2;
       }
    +
       /**
        *
        *
    @@ -266,6 +222,7 @@ public com.google.protobuf.ByteString getRowKeyPrefix() {
       }
     
       public static final int DELETE_ALL_DATA_FROM_TABLE_FIELD_NUMBER = 3;
    +
       /**
        *
        *
    @@ -281,6 +238,7 @@ public com.google.protobuf.ByteString getRowKeyPrefix() {
       public boolean hasDeleteAllDataFromTable() {
         return targetCase_ == 3;
       }
    +
       /**
        *
        *
    @@ -314,8 +272,8 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getNameBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    +    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_);
    @@ -323,7 +281,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (targetCase_ == 3) {
           output.writeBool(3, (boolean) ((java.lang.Boolean) target_));
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -332,8 +290,8 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getNameBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
         }
         if (targetCase_ == 2) {
           size +=
    @@ -345,7 +303,7 @@ public int getSerializedSize() {
               com.google.protobuf.CodedOutputStream.computeBoolSize(
                   3, (boolean) ((java.lang.Boolean) target_));
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -373,7 +331,7 @@ public boolean equals(final java.lang.Object obj) {
           case 0:
           default:
         }
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -398,7 +356,7 @@ public int hashCode() {
           case 0:
           default:
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -440,38 +398,38 @@ public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.DropRowRangeRequest parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -494,10 +452,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -508,7 +467,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.DropRowRangeRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -518,7 +477,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_DropRowRangeRequest_fieldAccessorTable
    @@ -528,24 +487,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.DropRowRangeRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
           targetCase_ = 0;
           target_ = null;
           return this;
    @@ -575,49 +527,24 @@ public com.google.bigtable.admin.v2.DropRowRangeRequest build() {
         public com.google.bigtable.admin.v2.DropRowRangeRequest buildPartial() {
           com.google.bigtable.admin.v2.DropRowRangeRequest result =
               new com.google.bigtable.admin.v2.DropRowRangeRequest(this);
    -      result.name_ = name_;
    -      if (targetCase_ == 2) {
    -        result.target_ = target_;
    -      }
    -      if (targetCase_ == 3) {
    -        result.target_ = target_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
    -      result.targetCase_ = targetCase_;
    +      buildPartialOneofs(result);
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    +    private void buildPartial0(com.google.bigtable.admin.v2.DropRowRangeRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
         }
     
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    private void buildPartialOneofs(com.google.bigtable.admin.v2.DropRowRangeRequest result) {
    +      result.targetCase_ = targetCase_;
    +      result.target_ = this.target_;
         }
     
         @java.lang.Override
    @@ -635,6 +562,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DropRowRangeRequest other)
             return this;
           if (!other.getName().isEmpty()) {
             name_ = other.name_;
    +        bitField0_ |= 0x00000001;
             onChanged();
           }
           switch (other.getTargetCase()) {
    @@ -653,7 +581,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.DropRowRangeRequest other)
                 break;
               }
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -668,17 +596,49 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.DropRowRangeRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.DropRowRangeRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    @@ -696,7 +656,10 @@ public Builder clearTarget() {
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
    @@ -723,6 +686,7 @@ public java.lang.String getName() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -749,6 +713,7 @@ public com.google.protobuf.ByteString getNameBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -769,11 +734,12 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -790,11 +756,12 @@ public Builder setName(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearName() {
    -
           name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -816,8 +783,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -837,6 +804,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
         public boolean hasRowKeyPrefix() {
           return targetCase_ == 2;
         }
    +
         /**
          *
          *
    @@ -855,6 +823,7 @@ public com.google.protobuf.ByteString getRowKeyPrefix() {
           }
           return com.google.protobuf.ByteString.EMPTY;
         }
    +
         /**
          *
          *
    @@ -877,6 +846,7 @@ public Builder setRowKeyPrefix(com.google.protobuf.ByteString value) {
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -912,6 +882,7 @@ public Builder clearRowKeyPrefix() {
         public boolean hasDeleteAllDataFromTable() {
           return targetCase_ == 3;
         }
    +
         /**
          *
          *
    @@ -929,6 +900,7 @@ public boolean getDeleteAllDataFromTable() {
           }
           return false;
         }
    +
         /**
          *
          *
    @@ -942,11 +914,13 @@ public boolean getDeleteAllDataFromTable() {
          * @return This builder for chaining.
          */
         public Builder setDeleteAllDataFromTable(boolean value) {
    +
           targetCase_ = 3;
           target_ = value;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -967,17 +941,6 @@ public Builder clearDeleteAllDataFromTable() {
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.DropRowRangeRequest)
       }
     
    @@ -999,7 +962,18 @@ public DropRowRangeRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new DropRowRangeRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java
    index 0c75eed434..f2e320121e 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -39,6 +42,7 @@ public interface DropRowRangeRequestOrBuilder
        * @return The name.
        */
       java.lang.String getName();
    +
       /**
        *
        *
    @@ -69,6 +73,7 @@ public interface DropRowRangeRequestOrBuilder
        * @return Whether the rowKeyPrefix field is set.
        */
       boolean hasRowKeyPrefix();
    +
       /**
        *
        *
    @@ -95,6 +100,7 @@ public interface DropRowRangeRequestOrBuilder
        * @return Whether the deleteAllDataFromTable field is set.
        */
       boolean hasDeleteAllDataFromTable();
    +
       /**
        *
        *
    @@ -108,5 +114,5 @@ public interface DropRowRangeRequestOrBuilder
        */
       boolean getDeleteAllDataFromTable();
     
    -  public com.google.bigtable.admin.v2.DropRowRangeRequest.TargetCase getTargetCase();
    +  com.google.bigtable.admin.v2.DropRowRangeRequest.TargetCase getTargetCase();
     }
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java
    index 5118ecbe43..37a7495ab7 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -30,13 +32,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.EncryptionInfo}
      */
    -public final class EncryptionInfo extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private EncryptionInfo(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -45,90 +59,13 @@ private EncryptionInfo() {
         kmsKeyVersion_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new EncryptionInfo();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private EncryptionInfo(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 18:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              kmsKeyVersion_ = s;
    -              break;
    -            }
    -          case 24:
    -            {
    -              int rawValue = input.readEnum();
    -
    -              encryptionType_ = rawValue;
    -              break;
    -            }
    -          case 34:
    -            {
    -              com.google.rpc.Status.Builder subBuilder = null;
    -              if (encryptionStatus_ != null) {
    -                subBuilder = encryptionStatus_.toBuilder();
    -              }
    -              encryptionStatus_ =
    -                  input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(encryptionStatus_);
    -                encryptionStatus_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.TableProto
             .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.TableProto
             .internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable
    @@ -188,6 +125,16 @@ public enum EncryptionType implements com.google.protobuf.ProtocolMessageEnum {
         UNRECOGNIZED(-1),
         ;
     
    +    static {
    +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +          /* major= */ 4,
    +          /* minor= */ 33,
    +          /* patch= */ 2,
    +          /* suffix= */ "",
    +          "EncryptionType");
    +    }
    +
         /**
          *
          *
    @@ -198,6 +145,7 @@ public enum EncryptionType implements com.google.protobuf.ProtocolMessageEnum {
          * ENCRYPTION_TYPE_UNSPECIFIED = 0;
          */
         public static final int ENCRYPTION_TYPE_UNSPECIFIED_VALUE = 0;
    +
         /**
          *
          *
    @@ -210,6 +158,7 @@ public enum EncryptionType implements com.google.protobuf.ProtocolMessageEnum {
          * GOOGLE_DEFAULT_ENCRYPTION = 1;
          */
         public static final int GOOGLE_DEFAULT_ENCRYPTION_VALUE = 1;
    +
         /**
          *
          *
    @@ -285,7 +234,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType
           return getDescriptor();
         }
     
    -    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
    +    public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
           return com.google.bigtable.admin.v2.EncryptionInfo.getDescriptor().getEnumTypes().get(0);
         }
     
    @@ -310,8 +259,10 @@ private EncryptionType(int 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_;
    +  private int encryptionType_ = 0;
    +
       /**
        *
        *
    @@ -329,6 +280,7 @@ private EncryptionType(int value) {
       public int getEncryptionTypeValue() {
         return encryptionType_;
       }
    +
       /**
        *
        *
    @@ -344,9 +296,8 @@ public int getEncryptionTypeValue() {
        */
       @java.lang.Override
       public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType() {
    -    @SuppressWarnings("deprecation")
         com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType result =
    -        com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.valueOf(encryptionType_);
    +        com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.forNumber(encryptionType_);
         return result == null
             ? com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED
             : result;
    @@ -354,6 +305,7 @@ public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionT
     
       public static final int ENCRYPTION_STATUS_FIELD_NUMBER = 4;
       private com.google.rpc.Status encryptionStatus_;
    +
       /**
        *
        *
    @@ -370,8 +322,9 @@ public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionT
        */
       @java.lang.Override
       public boolean hasEncryptionStatus() {
    -    return encryptionStatus_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
    +
       /**
        *
        *
    @@ -392,6 +345,7 @@ public com.google.rpc.Status getEncryptionStatus() {
             ? com.google.rpc.Status.getDefaultInstance()
             : encryptionStatus_;
       }
    +
       /**
        *
        *
    @@ -406,11 +360,16 @@ public com.google.rpc.Status getEncryptionStatus() {
        */
       @java.lang.Override
       public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() {
    -    return getEncryptionStatus();
    +    return encryptionStatus_ == null
    +        ? com.google.rpc.Status.getDefaultInstance()
    +        : encryptionStatus_;
       }
     
       public static final int KMS_KEY_VERSION_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object kmsKeyVersion_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object kmsKeyVersion_ = "";
    +
       /**
        *
        *
    @@ -437,6 +396,7 @@ public java.lang.String getKmsKeyVersion() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -478,18 +438,18 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getKmsKeyVersionBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyVersion_);
    +    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 (encryptionStatus_ != null) {
    +    if (((bitField0_ & 0x00000001) != 0)) {
           output.writeMessage(4, getEncryptionStatus());
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -498,18 +458,18 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getKmsKeyVersionBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kmsKeyVersion_);
    +    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 (encryptionStatus_ != null) {
    +    if (((bitField0_ & 0x00000001) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEncryptionStatus());
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -531,7 +491,7 @@ public boolean equals(final java.lang.Object obj) {
           if (!getEncryptionStatus().equals(other.getEncryptionStatus())) return false;
         }
         if (!getKmsKeyVersion().equals(other.getKmsKeyVersion())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -550,7 +510,7 @@ public int hashCode() {
         }
         hash = (37 * hash) + KMS_KEY_VERSION_FIELD_NUMBER;
         hash = (53 * hash) + getKmsKeyVersion().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -592,38 +552,38 @@ public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom(
     
       public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -646,10 +606,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -662,7 +623,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.EncryptionInfo}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -672,7 +633,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.TableProto
               .internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable
    @@ -686,28 +647,28 @@ private Builder() {
           maybeForceBuilderInitialization();
         }
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
           maybeForceBuilderInitialization();
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
    +        internalGetEncryptionStatusFieldBuilder();
    +      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           encryptionType_ = 0;
    -
    -      if (encryptionStatusBuilder_ == null) {
    -        encryptionStatus_ = null;
    -      } else {
    -        encryptionStatus_ = null;
    +      encryptionStatus_ = null;
    +      if (encryptionStatusBuilder_ != null) {
    +        encryptionStatusBuilder_.dispose();
             encryptionStatusBuilder_ = null;
           }
           kmsKeyVersion_ = "";
    -
           return this;
         }
     
    @@ -735,48 +696,28 @@ public com.google.bigtable.admin.v2.EncryptionInfo build() {
         public com.google.bigtable.admin.v2.EncryptionInfo buildPartial() {
           com.google.bigtable.admin.v2.EncryptionInfo result =
               new com.google.bigtable.admin.v2.EncryptionInfo(this);
    -      result.encryptionType_ = encryptionType_;
    -      if (encryptionStatusBuilder_ == null) {
    -        result.encryptionStatus_ = encryptionStatus_;
    -      } else {
    -        result.encryptionStatus_ = encryptionStatusBuilder_.build();
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
    -      result.kmsKeyVersion_ = kmsKeyVersion_;
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -799,9 +740,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.EncryptionInfo other) {
           }
           if (!other.getKmsKeyVersion().isEmpty()) {
             kmsKeyVersion_ = other.kmsKeyVersion_;
    +        bitField0_ |= 0x00000004;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -816,21 +758,57 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.EncryptionInfo parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.EncryptionInfo) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private int encryptionType_ = 0;
    +
         /**
          *
          *
    @@ -848,6 +826,7 @@ public Builder mergeFrom(
         public int getEncryptionTypeValue() {
           return encryptionType_;
         }
    +
         /**
          *
          *
    @@ -863,11 +842,12 @@ public int getEncryptionTypeValue() {
          * @return This builder for chaining.
          */
         public Builder setEncryptionTypeValue(int value) {
    -
           encryptionType_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -883,13 +863,13 @@ public Builder setEncryptionTypeValue(int value) {
          */
         @java.lang.Override
         public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType() {
    -      @SuppressWarnings("deprecation")
           com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType result =
    -          com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.valueOf(encryptionType_);
    +          com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.forNumber(encryptionType_);
           return result == null
               ? com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED
               : result;
         }
    +
         /**
          *
          *
    @@ -909,11 +889,12 @@ public Builder setEncryptionType(
           if (value == null) {
             throw new NullPointerException();
           }
    -
    +      bitField0_ |= 0x00000001;
           encryptionType_ = value.getNumber();
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -928,16 +909,17 @@ public Builder setEncryptionType(
          * @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.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
             encryptionStatusBuilder_;
    +
         /**
          *
          *
    @@ -953,8 +935,9 @@ public Builder clearEncryptionType() {
          * @return Whether the encryptionStatus field is set.
          */
         public boolean hasEncryptionStatus() {
    -      return encryptionStatusBuilder_ != null || encryptionStatus_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
    +
         /**
          *
          *
    @@ -978,6 +961,7 @@ public com.google.rpc.Status getEncryptionStatus() {
             return encryptionStatusBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -996,13 +980,14 @@ public Builder setEncryptionStatus(com.google.rpc.Status value) {
               throw new NullPointerException();
             }
             encryptionStatus_ = value;
    -        onChanged();
           } else {
             encryptionStatusBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1018,13 +1003,14 @@ public Builder setEncryptionStatus(com.google.rpc.Status value) {
         public Builder setEncryptionStatus(com.google.rpc.Status.Builder builderForValue) {
           if (encryptionStatusBuilder_ == null) {
             encryptionStatus_ = builderForValue.build();
    -        onChanged();
           } else {
             encryptionStatusBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1039,19 +1025,23 @@ public Builder setEncryptionStatus(com.google.rpc.Status.Builder builderForValue
          */
         public Builder mergeEncryptionStatus(com.google.rpc.Status value) {
           if (encryptionStatusBuilder_ == null) {
    -        if (encryptionStatus_ != null) {
    -          encryptionStatus_ =
    -              com.google.rpc.Status.newBuilder(encryptionStatus_).mergeFrom(value).buildPartial();
    +        if (((bitField0_ & 0x00000002) != 0)
    +            && encryptionStatus_ != null
    +            && encryptionStatus_ != com.google.rpc.Status.getDefaultInstance()) {
    +          getEncryptionStatusBuilder().mergeFrom(value);
             } else {
               encryptionStatus_ = value;
             }
    -        onChanged();
           } else {
             encryptionStatusBuilder_.mergeFrom(value);
           }
    -
    +      if (encryptionStatus_ != null) {
    +        bitField0_ |= 0x00000002;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -1065,16 +1055,16 @@ public Builder mergeEncryptionStatus(com.google.rpc.Status value) {
          * 
          */
         public Builder clearEncryptionStatus() {
    -      if (encryptionStatusBuilder_ == null) {
    -        encryptionStatus_ = null;
    -        onChanged();
    -      } else {
    -        encryptionStatus_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      encryptionStatus_ = null;
    +      if (encryptionStatusBuilder_ != null) {
    +        encryptionStatusBuilder_.dispose();
             encryptionStatusBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1088,10 +1078,11 @@ public Builder clearEncryptionStatus() {
          * 
          */
         public com.google.rpc.Status.Builder getEncryptionStatusBuilder() {
    -
    +      bitField0_ |= 0x00000002;
           onChanged();
    -      return getEncryptionStatusFieldBuilder().getBuilder();
    +      return internalGetEncryptionStatusFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -1113,6 +1104,7 @@ public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() {
                 : encryptionStatus_;
           }
         }
    +
         /**
          *
          *
    @@ -1125,12 +1117,12 @@ public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() {
          * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
          * 
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
    -        getEncryptionStatusFieldBuilder() {
    +        internalGetEncryptionStatusFieldBuilder() {
           if (encryptionStatusBuilder_ == null) {
             encryptionStatusBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.rpc.Status,
                     com.google.rpc.Status.Builder,
                     com.google.rpc.StatusOrBuilder>(
    @@ -1141,6 +1133,7 @@ public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() {
         }
     
         private java.lang.Object kmsKeyVersion_ = "";
    +
         /**
          *
          *
    @@ -1166,6 +1159,7 @@ public java.lang.String getKmsKeyVersion() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1191,6 +1185,7 @@ public com.google.protobuf.ByteString getKmsKeyVersionBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1210,11 +1205,12 @@ public Builder setKmsKeyVersion(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           kmsKeyVersion_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1230,11 +1226,12 @@ public Builder setKmsKeyVersion(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearKmsKeyVersion() {
    -
           kmsKeyVersion_ = getDefaultInstance().getKmsKeyVersion();
    +      bitField0_ = (bitField0_ & ~0x00000004);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1255,23 +1252,12 @@ public Builder setKmsKeyVersionBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           kmsKeyVersion_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.EncryptionInfo)
       }
     
    @@ -1293,7 +1279,18 @@ public EncryptionInfo parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new EncryptionInfo(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java
    index c3fdcb275b..26020f6ba6 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -37,6 +40,7 @@ public interface EncryptionInfoOrBuilder
        * @return The enum numeric value on the wire for encryptionType.
        */
       int getEncryptionTypeValue();
    +
       /**
        *
        *
    @@ -67,6 +71,7 @@ public interface EncryptionInfoOrBuilder
        * @return Whether the encryptionStatus field is set.
        */
       boolean hasEncryptionStatus();
    +
       /**
        *
        *
    @@ -82,6 +87,7 @@ public interface EncryptionInfoOrBuilder
        * @return The encryptionStatus.
        */
       com.google.rpc.Status getEncryptionStatus();
    +
       /**
        *
        *
    @@ -111,6 +117,7 @@ public interface EncryptionInfoOrBuilder
        * @return The kmsKeyVersion.
        */
       java.lang.String getKmsKeyVersion();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java
    index 6251235141..c7f168078b 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -27,117 +29,29 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.GcRule}
      */
    -public final class GcRule extends com.google.protobuf.GeneratedMessageV3
    +@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;
    -  // Use GcRule.newBuilder() to construct.
    -  private GcRule(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    -    super(builder);
    -  }
     
    -  private GcRule() {}
    -
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new GcRule();
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +        /* major= */ 4,
    +        /* minor= */ 33,
    +        /* patch= */ 2,
    +        /* suffix= */ "",
    +        "GcRule");
       }
     
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    +  // Use GcRule.newBuilder() to construct.
    +  private GcRule(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
       }
     
    -  private GcRule(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 8:
    -            {
    -              ruleCase_ = 1;
    -              rule_ = input.readInt32();
    -              break;
    -            }
    -          case 18:
    -            {
    -              com.google.protobuf.Duration.Builder subBuilder = null;
    -              if (ruleCase_ == 2) {
    -                subBuilder = ((com.google.protobuf.Duration) rule_).toBuilder();
    -              }
    -              rule_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom((com.google.protobuf.Duration) rule_);
    -                rule_ = subBuilder.buildPartial();
    -              }
    -              ruleCase_ = 2;
    -              break;
    -            }
    -          case 26:
    -            {
    -              com.google.bigtable.admin.v2.GcRule.Intersection.Builder subBuilder = null;
    -              if (ruleCase_ == 3) {
    -                subBuilder = ((com.google.bigtable.admin.v2.GcRule.Intersection) rule_).toBuilder();
    -              }
    -              rule_ =
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.GcRule.Intersection.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom((com.google.bigtable.admin.v2.GcRule.Intersection) rule_);
    -                rule_ = subBuilder.buildPartial();
    -              }
    -              ruleCase_ = 3;
    -              break;
    -            }
    -          case 34:
    -            {
    -              com.google.bigtable.admin.v2.GcRule.Union.Builder subBuilder = null;
    -              if (ruleCase_ == 4) {
    -                subBuilder = ((com.google.bigtable.admin.v2.GcRule.Union) rule_).toBuilder();
    -              }
    -              rule_ =
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.GcRule.Union.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom((com.google.bigtable.admin.v2.GcRule.Union) rule_);
    -                rule_ = subBuilder.buildPartial();
    -              }
    -              ruleCase_ = 4;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    +  private GcRule() {}
     
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.TableProto
    @@ -145,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.TableProto
             .internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable
    @@ -169,6 +83,7 @@ public interface IntersectionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         java.util.List getRulesList();
    +
         /**
          *
          *
    @@ -179,6 +94,7 @@ public interface IntersectionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         com.google.bigtable.admin.v2.GcRule getRules(int index);
    +
         /**
          *
          *
    @@ -189,6 +105,7 @@ public interface IntersectionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         int getRulesCount();
    +
         /**
          *
          *
    @@ -199,6 +116,7 @@ public interface IntersectionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         java.util.List getRulesOrBuilderList();
    +
         /**
          *
          *
    @@ -210,6 +128,7 @@ public interface IntersectionOrBuilder
          */
         com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index);
       }
    +
       /**
        *
        *
    @@ -219,13 +138,24 @@ public interface IntersectionOrBuilder
        *
        * Protobuf type {@code google.bigtable.admin.v2.GcRule.Intersection}
        */
    -  public static final class Intersection extends com.google.protobuf.GeneratedMessageV3
    +  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.GeneratedMessageV3.Builder builder) {
    +    private Intersection(com.google.protobuf.GeneratedMessage.Builder builder) {
           super(builder);
         }
     
    @@ -233,76 +163,13 @@ private Intersection() {
           rules_ = java.util.Collections.emptyList();
         }
     
    -    @java.lang.Override
    -    @SuppressWarnings({"unused"})
    -    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -      return new Intersection();
    -    }
    -
    -    @java.lang.Override
    -    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -      return this.unknownFields;
    -    }
    -
    -    private Intersection(
    -        com.google.protobuf.CodedInputStream input,
    -        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -        throws com.google.protobuf.InvalidProtocolBufferException {
    -      this();
    -      if (extensionRegistry == null) {
    -        throw new java.lang.NullPointerException();
    -      }
    -      int mutable_bitField0_ = 0;
    -      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -          com.google.protobuf.UnknownFieldSet.newBuilder();
    -      try {
    -        boolean done = false;
    -        while (!done) {
    -          int tag = input.readTag();
    -          switch (tag) {
    -            case 0:
    -              done = true;
    -              break;
    -            case 10:
    -              {
    -                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
    -                  rules_ = new java.util.ArrayList();
    -                  mutable_bitField0_ |= 0x00000001;
    -                }
    -                rules_.add(
    -                    input.readMessage(
    -                        com.google.bigtable.admin.v2.GcRule.parser(), extensionRegistry));
    -                break;
    -              }
    -            default:
    -              {
    -                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                  done = true;
    -                }
    -                break;
    -              }
    -          }
    -        }
    -      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -        throw e.setUnfinishedMessage(this);
    -      } catch (java.io.IOException e) {
    -        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -      } finally {
    -        if (((mutable_bitField0_ & 0x00000001) != 0)) {
    -          rules_ = java.util.Collections.unmodifiableList(rules_);
    -        }
    -        this.unknownFields = unknownFields.build();
    -        makeExtensionsImmutable();
    -      }
    -    }
    -
         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.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.TableProto
               .internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable
    @@ -312,7 +179,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         public static final int RULES_FIELD_NUMBER = 1;
    +
    +    @SuppressWarnings("serial")
         private java.util.List rules_;
    +
         /**
          *
          *
    @@ -326,6 +196,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         public java.util.List getRulesList() {
           return rules_;
         }
    +
         /**
          *
          *
    @@ -340,6 +211,7 @@ public java.util.List getRulesList() {
             getRulesOrBuilderList() {
           return rules_;
         }
    +
         /**
          *
          *
    @@ -353,6 +225,7 @@ public java.util.List getRulesList() {
         public int getRulesCount() {
           return rules_.size();
         }
    +
         /**
          *
          *
    @@ -366,6 +239,7 @@ public int getRulesCount() {
         public com.google.bigtable.admin.v2.GcRule getRules(int index) {
           return rules_.get(index);
         }
    +
         /**
          *
          *
    @@ -397,7 +271,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
           for (int i = 0; i < rules_.size(); i++) {
             output.writeMessage(1, rules_.get(i));
           }
    -      unknownFields.writeTo(output);
    +      getUnknownFields().writeTo(output);
         }
     
         @java.lang.Override
    @@ -409,7 +283,7 @@ public int getSerializedSize() {
           for (int i = 0; i < rules_.size(); i++) {
             size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i));
           }
    -      size += unknownFields.getSerializedSize();
    +      size += getUnknownFields().getSerializedSize();
           memoizedSize = size;
           return size;
         }
    @@ -426,7 +300,7 @@ public boolean equals(final java.lang.Object obj) {
               (com.google.bigtable.admin.v2.GcRule.Intersection) obj;
     
           if (!getRulesList().equals(other.getRulesList())) return false;
    -      if (!unknownFields.equals(other.unknownFields)) return false;
    +      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
           return true;
         }
     
    @@ -441,7 +315,7 @@ public int hashCode() {
             hash = (37 * hash) + RULES_FIELD_NUMBER;
             hash = (53 * hash) + getRulesList().hashCode();
           }
    -      hash = (29 * hash) + unknownFields.hashCode();
    +      hash = (29 * hash) + getUnknownFields().hashCode();
           memoizedHashCode = hash;
           return hash;
         }
    @@ -483,38 +357,38 @@ public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom(
     
         public static com.google.bigtable.admin.v2.GcRule.Intersection parseFrom(
             java.io.InputStream input) throws java.io.IOException {
    -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseWithIOException(
    +      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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseDelimitedWithIOException(
    +      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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseWithIOException(
    +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
               PARSER, input, extensionRegistry);
         }
     
    @@ -537,11 +411,11 @@ public Builder toBuilder() {
         }
     
         @java.lang.Override
    -    protected Builder newBuilderForType(
    -        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           Builder builder = new Builder(parent);
           return builder;
         }
    +
         /**
          *
          *
    @@ -551,8 +425,7 @@ protected Builder newBuilderForType(
          *
          * Protobuf type {@code google.bigtable.admin.v2.GcRule.Intersection}
          */
    -    public static final class Builder
    -        extends com.google.protobuf.GeneratedMessageV3.Builder
    +    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 {
    @@ -562,7 +435,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
     
           @java.lang.Override
    -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.bigtable.admin.v2.TableProto
                 .internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable
    @@ -572,30 +445,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
     
           // Construct using com.google.bigtable.admin.v2.GcRule.Intersection.newBuilder()
    -      private Builder() {
    -        maybeForceBuilderInitialization();
    -      }
    +      private Builder() {}
     
    -      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             super(parent);
    -        maybeForceBuilderInitialization();
    -      }
    -
    -      private void maybeForceBuilderInitialization() {
    -        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    -          getRulesFieldBuilder();
    -        }
           }
     
           @java.lang.Override
           public Builder clear() {
             super.clear();
    +        bitField0_ = 0;
             if (rulesBuilder_ == null) {
               rules_ = java.util.Collections.emptyList();
    -          bitField0_ = (bitField0_ & ~0x00000001);
             } else {
    +          rules_ = null;
               rulesBuilder_.clear();
             }
    +        bitField0_ = (bitField0_ & ~0x00000001);
             return this;
           }
     
    @@ -623,7 +489,16 @@ public com.google.bigtable.admin.v2.GcRule.Intersection build() {
           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);
    -        int from_bitField0_ = bitField0_;
    +        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_);
    @@ -633,43 +508,10 @@ public com.google.bigtable.admin.v2.GcRule.Intersection buildPartial() {
             } else {
               result.rules_ = rulesBuilder_.build();
             }
    -        onBuilt();
    -        return result;
    -      }
    -
    -      @java.lang.Override
    -      public Builder clone() {
    -        return super.clone();
    -      }
    -
    -      @java.lang.Override
    -      public Builder setField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -        return super.setField(field, value);
    -      }
    -
    -      @java.lang.Override
    -      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -        return super.clearField(field);
    -      }
    -
    -      @java.lang.Override
    -      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -        return super.clearOneof(oneof);
    -      }
    -
    -      @java.lang.Override
    -      public Builder setRepeatedField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field,
    -          int index,
    -          java.lang.Object value) {
    -        return super.setRepeatedField(field, index, value);
           }
     
    -      @java.lang.Override
    -      public Builder addRepeatedField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -        return super.addRepeatedField(field, value);
    +      private void buildPartial0(com.google.bigtable.admin.v2.GcRule.Intersection result) {
    +        int from_bitField0_ = bitField0_;
           }
     
           @java.lang.Override
    @@ -704,15 +546,15 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule.Intersection other)
                   rules_ = other.rules_;
                   bitField0_ = (bitField0_ & ~0x00000001);
                   rulesBuilder_ =
    -                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
    -                      ? getRulesFieldBuilder()
    +                  com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
    +                      ? internalGetRulesFieldBuilder()
                           : null;
                 } else {
                   rulesBuilder_.addAllMessages(other.rules_);
                 }
               }
             }
    -        this.mergeUnknownFields(other.unknownFields);
    +        this.mergeUnknownFields(other.getUnknownFields());
             onChanged();
             return this;
           }
    @@ -727,18 +569,44 @@ public Builder mergeFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        com.google.bigtable.admin.v2.GcRule.Intersection parsedMessage = null;
    +        if (extensionRegistry == null) {
    +          throw new java.lang.NullPointerException();
    +        }
             try {
    -          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +          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) {
    -          parsedMessage =
    -              (com.google.bigtable.admin.v2.GcRule.Intersection) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
    -          if (parsedMessage != null) {
    -            mergeFrom(parsedMessage);
    -          }
    -        }
    +          onChanged();
    +        } // finally
             return this;
           }
     
    @@ -754,7 +622,7 @@ private void ensureRulesIsMutable() {
             }
           }
     
    -      private com.google.protobuf.RepeatedFieldBuilderV3<
    +      private com.google.protobuf.RepeatedFieldBuilder<
                   com.google.bigtable.admin.v2.GcRule,
                   com.google.bigtable.admin.v2.GcRule.Builder,
                   com.google.bigtable.admin.v2.GcRuleOrBuilder>
    @@ -776,6 +644,7 @@ public java.util.List getRulesList() {
               return rulesBuilder_.getMessageList();
             }
           }
    +
           /**
            *
            *
    @@ -792,6 +661,7 @@ public int getRulesCount() {
               return rulesBuilder_.getCount();
             }
           }
    +
           /**
            *
            *
    @@ -808,6 +678,7 @@ public com.google.bigtable.admin.v2.GcRule getRules(int index) {
               return rulesBuilder_.getMessage(index);
             }
           }
    +
           /**
            *
            *
    @@ -830,6 +701,7 @@ public Builder setRules(int index, com.google.bigtable.admin.v2.GcRule value) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -850,6 +722,7 @@ public Builder setRules(
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -872,6 +745,7 @@ public Builder addRules(com.google.bigtable.admin.v2.GcRule value) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -894,6 +768,7 @@ public Builder addRules(int index, com.google.bigtable.admin.v2.GcRule value) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -913,6 +788,7 @@ public Builder addRules(com.google.bigtable.admin.v2.GcRule.Builder builderForVa
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -933,6 +809,7 @@ public Builder addRules(
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -953,6 +830,7 @@ public Builder addAllRules(
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -972,6 +850,7 @@ public Builder clearRules() {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -991,6 +870,7 @@ public Builder removeRules(int index) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1001,8 +881,9 @@ public Builder removeRules(int index) {
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public com.google.bigtable.admin.v2.GcRule.Builder getRulesBuilder(int index) {
    -        return getRulesFieldBuilder().getBuilder(index);
    +        return internalGetRulesFieldBuilder().getBuilder(index);
           }
    +
           /**
            *
            *
    @@ -1019,6 +900,7 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index)
               return rulesBuilder_.getMessageOrBuilder(index);
             }
           }
    +
           /**
            *
            *
    @@ -1036,6 +918,7 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index)
               return java.util.Collections.unmodifiableList(rules_);
             }
           }
    +
           /**
            *
            *
    @@ -1046,9 +929,10 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index)
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder() {
    -        return getRulesFieldBuilder()
    +        return internalGetRulesFieldBuilder()
                 .addBuilder(com.google.bigtable.admin.v2.GcRule.getDefaultInstance());
           }
    +
           /**
            *
            *
    @@ -1059,9 +943,10 @@ public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder() {
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder(int index) {
    -        return getRulesFieldBuilder()
    +        return internalGetRulesFieldBuilder()
                 .addBuilder(index, com.google.bigtable.admin.v2.GcRule.getDefaultInstance());
           }
    +
           /**
            *
            *
    @@ -1072,17 +957,17 @@ public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder(int index) {
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public java.util.List getRulesBuilderList() {
    -        return getRulesFieldBuilder().getBuilderList();
    +        return internalGetRulesFieldBuilder().getBuilderList();
           }
     
    -      private com.google.protobuf.RepeatedFieldBuilderV3<
    +      private com.google.protobuf.RepeatedFieldBuilder<
                   com.google.bigtable.admin.v2.GcRule,
                   com.google.bigtable.admin.v2.GcRule.Builder,
                   com.google.bigtable.admin.v2.GcRuleOrBuilder>
    -          getRulesFieldBuilder() {
    +          internalGetRulesFieldBuilder() {
             if (rulesBuilder_ == null) {
               rulesBuilder_ =
    -              new com.google.protobuf.RepeatedFieldBuilderV3<
    +              new com.google.protobuf.RepeatedFieldBuilder<
                       com.google.bigtable.admin.v2.GcRule,
                       com.google.bigtable.admin.v2.GcRule.Builder,
                       com.google.bigtable.admin.v2.GcRuleOrBuilder>(
    @@ -1092,18 +977,6 @@ public java.util.List getRulesBuild
             return rulesBuilder_;
           }
     
    -      @java.lang.Override
    -      public final Builder setUnknownFields(
    -          final com.google.protobuf.UnknownFieldSet unknownFields) {
    -        return super.setUnknownFields(unknownFields);
    -      }
    -
    -      @java.lang.Override
    -      public final Builder mergeUnknownFields(
    -          final com.google.protobuf.UnknownFieldSet unknownFields) {
    -        return super.mergeUnknownFields(unknownFields);
    -      }
    -
           // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GcRule.Intersection)
         }
     
    @@ -1125,7 +998,19 @@ public Intersection parsePartialFrom(
                   com.google.protobuf.CodedInputStream input,
                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                   throws com.google.protobuf.InvalidProtocolBufferException {
    -            return new Intersection(input, extensionRegistry);
    +            Builder builder = newBuilder();
    +            try {
    +              builder.mergeFrom(input, extensionRegistry);
    +            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +              throw e.setUnfinishedMessage(builder.buildPartial());
    +            } catch (com.google.protobuf.UninitializedMessageException e) {
    +              throw e.asInvalidProtocolBufferException()
    +                  .setUnfinishedMessage(builder.buildPartial());
    +            } catch (java.io.IOException e) {
    +              throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                  .setUnfinishedMessage(builder.buildPartial());
    +            }
    +            return builder.buildPartial();
               }
             };
     
    @@ -1159,6 +1044,7 @@ public interface UnionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         java.util.List getRulesList();
    +
         /**
          *
          *
    @@ -1169,6 +1055,7 @@ public interface UnionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         com.google.bigtable.admin.v2.GcRule getRules(int index);
    +
         /**
          *
          *
    @@ -1179,6 +1066,7 @@ public interface UnionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         int getRulesCount();
    +
         /**
          *
          *
    @@ -1189,6 +1077,7 @@ public interface UnionOrBuilder
          * repeated .google.bigtable.admin.v2.GcRule rules = 1;
          */
         java.util.List getRulesOrBuilderList();
    +
         /**
          *
          *
    @@ -1200,6 +1089,7 @@ public interface UnionOrBuilder
          */
         com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index);
       }
    +
       /**
        *
        *
    @@ -1209,13 +1099,24 @@ public interface UnionOrBuilder
        *
        * Protobuf type {@code google.bigtable.admin.v2.GcRule.Union}
        */
    -  public static final class Union extends com.google.protobuf.GeneratedMessageV3
    +  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.GeneratedMessageV3.Builder builder) {
    +    private Union(com.google.protobuf.GeneratedMessage.Builder builder) {
           super(builder);
         }
     
    @@ -1223,76 +1124,13 @@ private Union() {
           rules_ = java.util.Collections.emptyList();
         }
     
    -    @java.lang.Override
    -    @SuppressWarnings({"unused"})
    -    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -      return new Union();
    -    }
    -
    -    @java.lang.Override
    -    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -      return this.unknownFields;
    -    }
    -
    -    private Union(
    -        com.google.protobuf.CodedInputStream input,
    -        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -        throws com.google.protobuf.InvalidProtocolBufferException {
    -      this();
    -      if (extensionRegistry == null) {
    -        throw new java.lang.NullPointerException();
    -      }
    -      int mutable_bitField0_ = 0;
    -      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -          com.google.protobuf.UnknownFieldSet.newBuilder();
    -      try {
    -        boolean done = false;
    -        while (!done) {
    -          int tag = input.readTag();
    -          switch (tag) {
    -            case 0:
    -              done = true;
    -              break;
    -            case 10:
    -              {
    -                if (!((mutable_bitField0_ & 0x00000001) != 0)) {
    -                  rules_ = new java.util.ArrayList();
    -                  mutable_bitField0_ |= 0x00000001;
    -                }
    -                rules_.add(
    -                    input.readMessage(
    -                        com.google.bigtable.admin.v2.GcRule.parser(), extensionRegistry));
    -                break;
    -              }
    -            default:
    -              {
    -                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                  done = true;
    -                }
    -                break;
    -              }
    -          }
    -        }
    -      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -        throw e.setUnfinishedMessage(this);
    -      } catch (java.io.IOException e) {
    -        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -      } finally {
    -        if (((mutable_bitField0_ & 0x00000001) != 0)) {
    -          rules_ = java.util.Collections.unmodifiableList(rules_);
    -        }
    -        this.unknownFields = unknownFields.build();
    -        makeExtensionsImmutable();
    -      }
    -    }
    -
         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.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.TableProto
               .internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable
    @@ -1302,7 +1140,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         public static final int RULES_FIELD_NUMBER = 1;
    +
    +    @SuppressWarnings("serial")
         private java.util.List rules_;
    +
         /**
          *
          *
    @@ -1316,6 +1157,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         public java.util.List getRulesList() {
           return rules_;
         }
    +
         /**
          *
          *
    @@ -1330,6 +1172,7 @@ public java.util.List getRulesList() {
             getRulesOrBuilderList() {
           return rules_;
         }
    +
         /**
          *
          *
    @@ -1343,6 +1186,7 @@ public java.util.List getRulesList() {
         public int getRulesCount() {
           return rules_.size();
         }
    +
         /**
          *
          *
    @@ -1356,6 +1200,7 @@ public int getRulesCount() {
         public com.google.bigtable.admin.v2.GcRule getRules(int index) {
           return rules_.get(index);
         }
    +
         /**
          *
          *
    @@ -1387,7 +1232,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
           for (int i = 0; i < rules_.size(); i++) {
             output.writeMessage(1, rules_.get(i));
           }
    -      unknownFields.writeTo(output);
    +      getUnknownFields().writeTo(output);
         }
     
         @java.lang.Override
    @@ -1399,7 +1244,7 @@ public int getSerializedSize() {
           for (int i = 0; i < rules_.size(); i++) {
             size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rules_.get(i));
           }
    -      size += unknownFields.getSerializedSize();
    +      size += getUnknownFields().getSerializedSize();
           memoizedSize = size;
           return size;
         }
    @@ -1416,7 +1261,7 @@ public boolean equals(final java.lang.Object obj) {
               (com.google.bigtable.admin.v2.GcRule.Union) obj;
     
           if (!getRulesList().equals(other.getRulesList())) return false;
    -      if (!unknownFields.equals(other.unknownFields)) return false;
    +      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
           return true;
         }
     
    @@ -1431,7 +1276,7 @@ public int hashCode() {
             hash = (37 * hash) + RULES_FIELD_NUMBER;
             hash = (53 * hash) + getRulesList().hashCode();
           }
    -      hash = (29 * hash) + unknownFields.hashCode();
    +      hash = (29 * hash) + getUnknownFields().hashCode();
           memoizedHashCode = hash;
           return hash;
         }
    @@ -1473,38 +1318,38 @@ public static com.google.bigtable.admin.v2.GcRule.Union parseFrom(
     
         public static com.google.bigtable.admin.v2.GcRule.Union parseFrom(java.io.InputStream input)
             throws java.io.IOException {
    -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseWithIOException(
    +      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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseDelimitedWithIOException(
    +      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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseWithIOException(
    +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
               PARSER, input, extensionRegistry);
         }
     
    @@ -1527,11 +1372,11 @@ public Builder toBuilder() {
         }
     
         @java.lang.Override
    -    protected Builder newBuilderForType(
    -        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           Builder builder = new Builder(parent);
           return builder;
         }
    +
         /**
          *
          *
    @@ -1541,8 +1386,7 @@ protected Builder newBuilderForType(
          *
          * Protobuf type {@code google.bigtable.admin.v2.GcRule.Union}
          */
    -    public static final class Builder
    -        extends com.google.protobuf.GeneratedMessageV3.Builder
    +    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 {
    @@ -1552,7 +1396,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
     
           @java.lang.Override
    -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.bigtable.admin.v2.TableProto
                 .internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable
    @@ -1562,30 +1406,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
     
           // Construct using com.google.bigtable.admin.v2.GcRule.Union.newBuilder()
    -      private Builder() {
    -        maybeForceBuilderInitialization();
    -      }
    +      private Builder() {}
     
    -      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             super(parent);
    -        maybeForceBuilderInitialization();
    -      }
    -
    -      private void maybeForceBuilderInitialization() {
    -        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    -          getRulesFieldBuilder();
    -        }
           }
     
           @java.lang.Override
           public Builder clear() {
             super.clear();
    +        bitField0_ = 0;
             if (rulesBuilder_ == null) {
               rules_ = java.util.Collections.emptyList();
    -          bitField0_ = (bitField0_ & ~0x00000001);
             } else {
    +          rules_ = null;
               rulesBuilder_.clear();
             }
    +        bitField0_ = (bitField0_ & ~0x00000001);
             return this;
           }
     
    @@ -1613,7 +1450,15 @@ public com.google.bigtable.admin.v2.GcRule.Union build() {
           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);
    -        int from_bitField0_ = bitField0_;
    +        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_);
    @@ -1623,43 +1468,10 @@ public com.google.bigtable.admin.v2.GcRule.Union buildPartial() {
             } else {
               result.rules_ = rulesBuilder_.build();
             }
    -        onBuilt();
    -        return result;
    -      }
    -
    -      @java.lang.Override
    -      public Builder clone() {
    -        return super.clone();
           }
     
    -      @java.lang.Override
    -      public Builder setField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -        return super.setField(field, value);
    -      }
    -
    -      @java.lang.Override
    -      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -        return super.clearField(field);
    -      }
    -
    -      @java.lang.Override
    -      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -        return super.clearOneof(oneof);
    -      }
    -
    -      @java.lang.Override
    -      public Builder setRepeatedField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field,
    -          int index,
    -          java.lang.Object value) {
    -        return super.setRepeatedField(field, index, value);
    -      }
    -
    -      @java.lang.Override
    -      public Builder addRepeatedField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -        return super.addRepeatedField(field, value);
    +      private void buildPartial0(com.google.bigtable.admin.v2.GcRule.Union result) {
    +        int from_bitField0_ = bitField0_;
           }
     
           @java.lang.Override
    @@ -1693,15 +1505,15 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule.Union other) {
                   rules_ = other.rules_;
                   bitField0_ = (bitField0_ & ~0x00000001);
                   rulesBuilder_ =
    -                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
    -                      ? getRulesFieldBuilder()
    +                  com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
    +                      ? internalGetRulesFieldBuilder()
                           : null;
                 } else {
                   rulesBuilder_.addAllMessages(other.rules_);
                 }
               }
             }
    -        this.mergeUnknownFields(other.unknownFields);
    +        this.mergeUnknownFields(other.getUnknownFields());
             onChanged();
             return this;
           }
    @@ -1716,17 +1528,44 @@ public Builder mergeFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        com.google.bigtable.admin.v2.GcRule.Union parsedMessage = null;
    +        if (extensionRegistry == null) {
    +          throw new java.lang.NullPointerException();
    +        }
             try {
    -          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +          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) {
    -          parsedMessage = (com.google.bigtable.admin.v2.GcRule.Union) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
    -          if (parsedMessage != null) {
    -            mergeFrom(parsedMessage);
    -          }
    -        }
    +          onChanged();
    +        } // finally
             return this;
           }
     
    @@ -1742,7 +1581,7 @@ private void ensureRulesIsMutable() {
             }
           }
     
    -      private com.google.protobuf.RepeatedFieldBuilderV3<
    +      private com.google.protobuf.RepeatedFieldBuilder<
                   com.google.bigtable.admin.v2.GcRule,
                   com.google.bigtable.admin.v2.GcRule.Builder,
                   com.google.bigtable.admin.v2.GcRuleOrBuilder>
    @@ -1764,6 +1603,7 @@ public java.util.List getRulesList() {
               return rulesBuilder_.getMessageList();
             }
           }
    +
           /**
            *
            *
    @@ -1780,6 +1620,7 @@ public int getRulesCount() {
               return rulesBuilder_.getCount();
             }
           }
    +
           /**
            *
            *
    @@ -1796,6 +1637,7 @@ public com.google.bigtable.admin.v2.GcRule getRules(int index) {
               return rulesBuilder_.getMessage(index);
             }
           }
    +
           /**
            *
            *
    @@ -1818,6 +1660,7 @@ public Builder setRules(int index, com.google.bigtable.admin.v2.GcRule value) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1838,6 +1681,7 @@ public Builder setRules(
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1860,6 +1704,7 @@ public Builder addRules(com.google.bigtable.admin.v2.GcRule value) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1882,6 +1727,7 @@ public Builder addRules(int index, com.google.bigtable.admin.v2.GcRule value) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1901,6 +1747,7 @@ public Builder addRules(com.google.bigtable.admin.v2.GcRule.Builder builderForVa
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1921,6 +1768,7 @@ public Builder addRules(
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1941,6 +1789,7 @@ public Builder addAllRules(
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1960,6 +1809,7 @@ public Builder clearRules() {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1979,6 +1829,7 @@ public Builder removeRules(int index) {
             }
             return this;
           }
    +
           /**
            *
            *
    @@ -1989,8 +1840,9 @@ public Builder removeRules(int index) {
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public com.google.bigtable.admin.v2.GcRule.Builder getRulesBuilder(int index) {
    -        return getRulesFieldBuilder().getBuilder(index);
    +        return internalGetRulesFieldBuilder().getBuilder(index);
           }
    +
           /**
            *
            *
    @@ -2007,6 +1859,7 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index)
               return rulesBuilder_.getMessageOrBuilder(index);
             }
           }
    +
           /**
            *
            *
    @@ -2024,6 +1877,7 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index)
               return java.util.Collections.unmodifiableList(rules_);
             }
           }
    +
           /**
            *
            *
    @@ -2034,9 +1888,10 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getRulesOrBuilder(int index)
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder() {
    -        return getRulesFieldBuilder()
    +        return internalGetRulesFieldBuilder()
                 .addBuilder(com.google.bigtable.admin.v2.GcRule.getDefaultInstance());
           }
    +
           /**
            *
            *
    @@ -2047,9 +1902,10 @@ public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder() {
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder(int index) {
    -        return getRulesFieldBuilder()
    +        return internalGetRulesFieldBuilder()
                 .addBuilder(index, com.google.bigtable.admin.v2.GcRule.getDefaultInstance());
           }
    +
           /**
            *
            *
    @@ -2060,17 +1916,17 @@ public com.google.bigtable.admin.v2.GcRule.Builder addRulesBuilder(int index) {
            * repeated .google.bigtable.admin.v2.GcRule rules = 1;
            */
           public java.util.List getRulesBuilderList() {
    -        return getRulesFieldBuilder().getBuilderList();
    +        return internalGetRulesFieldBuilder().getBuilderList();
           }
     
    -      private com.google.protobuf.RepeatedFieldBuilderV3<
    +      private com.google.protobuf.RepeatedFieldBuilder<
                   com.google.bigtable.admin.v2.GcRule,
                   com.google.bigtable.admin.v2.GcRule.Builder,
                   com.google.bigtable.admin.v2.GcRuleOrBuilder>
    -          getRulesFieldBuilder() {
    +          internalGetRulesFieldBuilder() {
             if (rulesBuilder_ == null) {
               rulesBuilder_ =
    -              new com.google.protobuf.RepeatedFieldBuilderV3<
    +              new com.google.protobuf.RepeatedFieldBuilder<
                       com.google.bigtable.admin.v2.GcRule,
                       com.google.bigtable.admin.v2.GcRule.Builder,
                       com.google.bigtable.admin.v2.GcRuleOrBuilder>(
    @@ -2080,18 +1936,6 @@ public java.util.List getRulesBuild
             return rulesBuilder_;
           }
     
    -      @java.lang.Override
    -      public final Builder setUnknownFields(
    -          final com.google.protobuf.UnknownFieldSet unknownFields) {
    -        return super.setUnknownFields(unknownFields);
    -      }
    -
    -      @java.lang.Override
    -      public final Builder mergeUnknownFields(
    -          final com.google.protobuf.UnknownFieldSet unknownFields) {
    -        return super.mergeUnknownFields(unknownFields);
    -      }
    -
           // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GcRule.Union)
         }
     
    @@ -2113,7 +1957,19 @@ public Union parsePartialFrom(
                   com.google.protobuf.CodedInputStream input,
                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                   throws com.google.protobuf.InvalidProtocolBufferException {
    -            return new Union(input, extensionRegistry);
    +            Builder builder = newBuilder();
    +            try {
    +              builder.mergeFrom(input, extensionRegistry);
    +            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +              throw e.setUnfinishedMessage(builder.buildPartial());
    +            } catch (com.google.protobuf.UninitializedMessageException e) {
    +              throw e.asInvalidProtocolBufferException()
    +                  .setUnfinishedMessage(builder.buildPartial());
    +            } catch (java.io.IOException e) {
    +              throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                  .setUnfinishedMessage(builder.buildPartial());
    +            }
    +            return builder.buildPartial();
               }
             };
     
    @@ -2133,6 +1989,8 @@ public com.google.bigtable.admin.v2.GcRule.Union getDefaultInstanceForType() {
       }
     
       private int ruleCase_ = 0;
    +
    +  @SuppressWarnings("serial")
       private java.lang.Object rule_;
     
       public enum RuleCase
    @@ -2149,6 +2007,7 @@ public enum RuleCase
         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.
    @@ -2186,6 +2045,7 @@ public RuleCase getRuleCase() {
       }
     
       public static final int MAX_NUM_VERSIONS_FIELD_NUMBER = 1;
    +
       /**
        *
        *
    @@ -2201,6 +2061,7 @@ public RuleCase getRuleCase() {
       public boolean hasMaxNumVersions() {
         return ruleCase_ == 1;
       }
    +
       /**
        *
        *
    @@ -2221,6 +2082,7 @@ public int getMaxNumVersions() {
       }
     
       public static final int MAX_AGE_FIELD_NUMBER = 2;
    +
       /**
        *
        *
    @@ -2238,6 +2100,7 @@ public int getMaxNumVersions() {
       public boolean hasMaxAge() {
         return ruleCase_ == 2;
       }
    +
       /**
        *
        *
    @@ -2258,6 +2121,7 @@ public com.google.protobuf.Duration getMaxAge() {
         }
         return com.google.protobuf.Duration.getDefaultInstance();
       }
    +
       /**
        *
        *
    @@ -2278,6 +2142,7 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
       }
     
       public static final int INTERSECTION_FIELD_NUMBER = 3;
    +
       /**
        *
        *
    @@ -2293,6 +2158,7 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
       public boolean hasIntersection() {
         return ruleCase_ == 3;
       }
    +
       /**
        *
        *
    @@ -2311,6 +2177,7 @@ public com.google.bigtable.admin.v2.GcRule.Intersection getIntersection() {
         }
         return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance();
       }
    +
       /**
        *
        *
    @@ -2329,6 +2196,7 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
       }
     
       public static final int UNION_FIELD_NUMBER = 4;
    +
       /**
        *
        *
    @@ -2344,6 +2212,7 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
       public boolean hasUnion() {
         return ruleCase_ == 4;
       }
    +
       /**
        *
        *
    @@ -2362,6 +2231,7 @@ public com.google.bigtable.admin.v2.GcRule.Union getUnion() {
         }
         return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance();
       }
    +
       /**
        *
        *
    @@ -2405,7 +2275,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (ruleCase_ == 4) {
           output.writeMessage(4, (com.google.bigtable.admin.v2.GcRule.Union) rule_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -2434,7 +2304,7 @@ public int getSerializedSize() {
               com.google.protobuf.CodedOutputStream.computeMessageSize(
                   4, (com.google.bigtable.admin.v2.GcRule.Union) rule_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -2466,7 +2336,7 @@ public boolean equals(final java.lang.Object obj) {
           case 0:
           default:
         }
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -2497,7 +2367,7 @@ public int hashCode() {
           case 0:
           default:
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -2538,38 +2408,38 @@ public static com.google.bigtable.admin.v2.GcRule parseFrom(
     
       public static com.google.bigtable.admin.v2.GcRule parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -2592,10 +2462,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -2605,7 +2476,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.GcRule}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -2615,7 +2486,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.TableProto
               .internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable
    @@ -2625,22 +2496,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.GcRule.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @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;
    @@ -2669,66 +2543,30 @@ public com.google.bigtable.admin.v2.GcRule build() {
         @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 (ruleCase_ == 1) {
    -        result.rule_ = rule_;
    -      }
    -      if (ruleCase_ == 2) {
    -        if (maxAgeBuilder_ == null) {
    -          result.rule_ = rule_;
    -        } else {
    -          result.rule_ = maxAgeBuilder_.build();
    -        }
    -      }
    -      if (ruleCase_ == 3) {
    -        if (intersectionBuilder_ == null) {
    -          result.rule_ = rule_;
    -        } else {
    -          result.rule_ = intersectionBuilder_.build();
    -        }
    -      }
    -      if (ruleCase_ == 4) {
    -        if (unionBuilder_ == null) {
    -          result.rule_ = rule_;
    -        } else {
    -          result.rule_ = unionBuilder_.build();
    -        }
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
    -      result.ruleCase_ = ruleCase_;
    +      buildPartialOneofs(result);
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    +    private void buildPartial0(com.google.bigtable.admin.v2.GcRule result) {
    +      int from_bitField0_ = bitField0_;
         }
     
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -2769,7 +2607,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule other) {
                 break;
               }
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -2784,17 +2622,56 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.GcRule parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.GcRule) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    @@ -2812,6 +2689,8 @@ public Builder clearRule() {
           return this;
         }
     
    +    private int bitField0_;
    +
         /**
          *
          *
    @@ -2826,6 +2705,7 @@ public Builder clearRule() {
         public boolean hasMaxNumVersions() {
           return ruleCase_ == 1;
         }
    +
         /**
          *
          *
    @@ -2843,6 +2723,7 @@ public int getMaxNumVersions() {
           }
           return 0;
         }
    +
         /**
          *
          *
    @@ -2856,11 +2737,13 @@ public int getMaxNumVersions() {
          * @return This builder for chaining.
          */
         public Builder setMaxNumVersions(int value) {
    +
           ruleCase_ = 1;
           rule_ = value;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -2881,11 +2764,12 @@ public Builder clearMaxNumVersions() {
           return this;
         }
     
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Duration,
                 com.google.protobuf.Duration.Builder,
                 com.google.protobuf.DurationOrBuilder>
             maxAgeBuilder_;
    +
         /**
          *
          *
    @@ -2903,6 +2787,7 @@ public Builder clearMaxNumVersions() {
         public boolean hasMaxAge() {
           return ruleCase_ == 2;
         }
    +
         /**
          *
          *
    @@ -2930,6 +2815,7 @@ public com.google.protobuf.Duration getMaxAge() {
             return com.google.protobuf.Duration.getDefaultInstance();
           }
         }
    +
         /**
          *
          *
    @@ -2954,6 +2840,7 @@ public Builder setMaxAge(com.google.protobuf.Duration value) {
           ruleCase_ = 2;
           return this;
         }
    +
         /**
          *
          *
    @@ -2975,6 +2862,7 @@ public Builder setMaxAge(com.google.protobuf.Duration.Builder builderForValue) {
           ruleCase_ = 2;
           return this;
         }
    +
         /**
          *
          *
    @@ -3000,12 +2888,14 @@ public Builder mergeMaxAge(com.google.protobuf.Duration value) {
           } else {
             if (ruleCase_ == 2) {
               maxAgeBuilder_.mergeFrom(value);
    +        } else {
    +          maxAgeBuilder_.setMessage(value);
             }
    -        maxAgeBuilder_.setMessage(value);
           }
           ruleCase_ = 2;
           return this;
         }
    +
         /**
          *
          *
    @@ -3033,6 +2923,7 @@ public Builder clearMaxAge() {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -3045,8 +2936,9 @@ public Builder clearMaxAge() {
          * .google.protobuf.Duration max_age = 2;
          */
         public com.google.protobuf.Duration.Builder getMaxAgeBuilder() {
    -      return getMaxAgeFieldBuilder().getBuilder();
    +      return internalGetMaxAgeFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -3069,6 +2961,7 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
             return com.google.protobuf.Duration.getDefaultInstance();
           }
         }
    +
         /**
          *
          *
    @@ -3080,17 +2973,17 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
          *
          * .google.protobuf.Duration max_age = 2;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Duration,
                 com.google.protobuf.Duration.Builder,
                 com.google.protobuf.DurationOrBuilder>
    -        getMaxAgeFieldBuilder() {
    +        internalGetMaxAgeFieldBuilder() {
           if (maxAgeBuilder_ == null) {
             if (!(ruleCase_ == 2)) {
               rule_ = com.google.protobuf.Duration.getDefaultInstance();
             }
             maxAgeBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Duration,
                     com.google.protobuf.Duration.Builder,
                     com.google.protobuf.DurationOrBuilder>(
    @@ -3099,15 +2992,15 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
           }
           ruleCase_ = 2;
           onChanged();
    -      ;
           return maxAgeBuilder_;
         }
     
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    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_;
    +
         /**
          *
          *
    @@ -3123,6 +3016,7 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
         public boolean hasIntersection() {
           return ruleCase_ == 3;
         }
    +
         /**
          *
          *
    @@ -3148,6 +3042,7 @@ public com.google.bigtable.admin.v2.GcRule.Intersection getIntersection() {
             return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance();
           }
         }
    +
         /**
          *
          *
    @@ -3170,6 +3065,7 @@ public Builder setIntersection(com.google.bigtable.admin.v2.GcRule.Intersection
           ruleCase_ = 3;
           return this;
         }
    +
         /**
          *
          *
    @@ -3190,6 +3086,7 @@ public Builder setIntersection(
           ruleCase_ = 3;
           return this;
         }
    +
         /**
          *
          *
    @@ -3215,12 +3112,14 @@ public Builder mergeIntersection(com.google.bigtable.admin.v2.GcRule.Intersectio
           } else {
             if (ruleCase_ == 3) {
               intersectionBuilder_.mergeFrom(value);
    +        } else {
    +          intersectionBuilder_.setMessage(value);
             }
    -        intersectionBuilder_.setMessage(value);
           }
           ruleCase_ = 3;
           return this;
         }
    +
         /**
          *
          *
    @@ -3246,6 +3145,7 @@ public Builder clearIntersection() {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -3256,8 +3156,9 @@ public Builder clearIntersection() {
          * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3;
          */
         public com.google.bigtable.admin.v2.GcRule.Intersection.Builder getIntersectionBuilder() {
    -      return getIntersectionFieldBuilder().getBuilder();
    +      return internalGetIntersectionFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -3278,6 +3179,7 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
             return com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance();
           }
         }
    +
         /**
          *
          *
    @@ -3287,17 +3189,17 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
          *
          * .google.bigtable.admin.v2.GcRule.Intersection intersection = 3;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    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>
    -        getIntersectionFieldBuilder() {
    +        internalGetIntersectionFieldBuilder() {
           if (intersectionBuilder_ == null) {
             if (!(ruleCase_ == 3)) {
               rule_ = com.google.bigtable.admin.v2.GcRule.Intersection.getDefaultInstance();
             }
             intersectionBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            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>(
    @@ -3308,15 +3210,15 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
           }
           ruleCase_ = 3;
           onChanged();
    -      ;
           return intersectionBuilder_;
         }
     
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    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_;
    +
         /**
          *
          *
    @@ -3332,6 +3234,7 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
         public boolean hasUnion() {
           return ruleCase_ == 4;
         }
    +
         /**
          *
          *
    @@ -3357,6 +3260,7 @@ public com.google.bigtable.admin.v2.GcRule.Union getUnion() {
             return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance();
           }
         }
    +
         /**
          *
          *
    @@ -3379,6 +3283,7 @@ public Builder setUnion(com.google.bigtable.admin.v2.GcRule.Union value) {
           ruleCase_ = 4;
           return this;
         }
    +
         /**
          *
          *
    @@ -3398,6 +3303,7 @@ public Builder setUnion(com.google.bigtable.admin.v2.GcRule.Union.Builder builde
           ruleCase_ = 4;
           return this;
         }
    +
         /**
          *
          *
    @@ -3423,12 +3329,14 @@ public Builder mergeUnion(com.google.bigtable.admin.v2.GcRule.Union value) {
           } else {
             if (ruleCase_ == 4) {
               unionBuilder_.mergeFrom(value);
    +        } else {
    +          unionBuilder_.setMessage(value);
             }
    -        unionBuilder_.setMessage(value);
           }
           ruleCase_ = 4;
           return this;
         }
    +
         /**
          *
          *
    @@ -3454,6 +3362,7 @@ public Builder clearUnion() {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -3464,8 +3373,9 @@ public Builder clearUnion() {
          * .google.bigtable.admin.v2.GcRule.Union union = 4;
          */
         public com.google.bigtable.admin.v2.GcRule.Union.Builder getUnionBuilder() {
    -      return getUnionFieldBuilder().getBuilder();
    +      return internalGetUnionFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -3486,6 +3396,7 @@ public com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder() {
             return com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance();
           }
         }
    +
         /**
          *
          *
    @@ -3495,17 +3406,17 @@ public com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder() {
          *
          * .google.bigtable.admin.v2.GcRule.Union union = 4;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    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>
    -        getUnionFieldBuilder() {
    +        internalGetUnionFieldBuilder() {
           if (unionBuilder_ == null) {
             if (!(ruleCase_ == 4)) {
               rule_ = com.google.bigtable.admin.v2.GcRule.Union.getDefaultInstance();
             }
             unionBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            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>(
    @@ -3516,21 +3427,9 @@ public com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder() {
           }
           ruleCase_ = 4;
           onChanged();
    -      ;
           return unionBuilder_;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GcRule)
       }
     
    @@ -3552,7 +3451,18 @@ public GcRule parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new GcRule(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java
    index 2377b77320..8c10f8e2c1 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -35,6 +38,7 @@ public interface GcRuleOrBuilder
        * @return Whether the maxNumVersions field is set.
        */
       boolean hasMaxNumVersions();
    +
       /**
        *
        *
    @@ -62,6 +66,7 @@ public interface GcRuleOrBuilder
        * @return Whether the maxAge field is set.
        */
       boolean hasMaxAge();
    +
       /**
        *
        *
    @@ -76,6 +81,7 @@ public interface GcRuleOrBuilder
        * @return The maxAge.
        */
       com.google.protobuf.Duration getMaxAge();
    +
       /**
        *
        *
    @@ -101,6 +107,7 @@ public interface GcRuleOrBuilder
        * @return Whether the intersection field is set.
        */
       boolean hasIntersection();
    +
       /**
        *
        *
    @@ -113,6 +120,7 @@ public interface GcRuleOrBuilder
        * @return The intersection.
        */
       com.google.bigtable.admin.v2.GcRule.Intersection getIntersection();
    +
       /**
        *
        *
    @@ -136,6 +144,7 @@ public interface GcRuleOrBuilder
        * @return Whether the union field is set.
        */
       boolean hasUnion();
    +
       /**
        *
        *
    @@ -148,6 +157,7 @@ public interface GcRuleOrBuilder
        * @return The union.
        */
       com.google.bigtable.admin.v2.GcRule.Union getUnion();
    +
       /**
        *
        *
    @@ -159,5 +169,5 @@ public interface GcRuleOrBuilder
        */
       com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder();
     
    -  public com.google.bigtable.admin.v2.GcRule.RuleCase getRuleCase();
    +  com.google.bigtable.admin.v2.GcRule.RuleCase getRuleCase();
     }
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java
    index db2547bf0c..8b5f016a17 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -28,14 +30,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenRequest}
      */
    -public final class GenerateConsistencyTokenRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private GenerateConsistencyTokenRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -43,68 +56,13 @@ private GenerateConsistencyTokenRequest() {
         name_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new GenerateConsistencyTokenRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private GenerateConsistencyTokenRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_fieldAccessorTable
    @@ -114,13 +72,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @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
    +   * 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}`.
        * 
    * @@ -142,12 +103,13 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Required. The unique name of the Table for which to create a consistency token.
    -   * Values are of the form
    +   * 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}`.
        * 
    * @@ -184,10 +146,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -196,10 +158,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -216,7 +178,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -229,7 +191,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -271,38 +233,38 @@ public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parse public static com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -326,10 +288,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -340,7 +303,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -350,7 +313,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenRequest_fieldAccessorTable @@ -360,24 +323,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -406,42 +362,19 @@ public com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest build() { public com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest buildPartial() { com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest result = new com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -460,9 +393,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GenerateConsistencyTokenRe return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -477,28 +411,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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
    +     * 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}`.
          * 
    * @@ -519,12 +475,13 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the Table for which to create a consistency token.
    -     * Values are of the form
    +     * 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}`.
          * 
    * @@ -545,12 +502,13 @@ public com.google.protobuf.ByteString getNameBytes() { 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
    +     * 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}`.
          * 
    * @@ -565,17 +523,18 @@ 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
    +     * 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}`.
          * 
    * @@ -586,17 +545,18 @@ public Builder setName(java.lang.String value) { * @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
    +     * 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}`.
          * 
    * @@ -612,23 +572,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GenerateConsistencyTokenRequest) } @@ -651,7 +600,18 @@ public GenerateConsistencyTokenRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GenerateConsistencyTokenRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java index 9d70e81ddb..769965eba0 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,8 +30,8 @@ public interface GenerateConsistencyTokenRequestOrBuilder * * *
    -   * Required. The unique name of the Table for which to create a consistency token.
    -   * Values are of the form
    +   * 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}`.
        * 
    * @@ -39,12 +42,13 @@ public interface GenerateConsistencyTokenRequestOrBuilder * @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
    +   * 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}`.
        * 
    * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java index 804017aebd..75d75c0750 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,14 +30,26 @@ * * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenResponse} */ -public final class GenerateConsistencyTokenResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,68 +57,13 @@ private GenerateConsistencyTokenResponse() { consistencyToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GenerateConsistencyTokenResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GenerateConsistencyTokenResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - consistencyToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_fieldAccessorTable @@ -114,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CONSISTENCY_TOKEN_FIELD_NUMBER = 1; - private volatile java.lang.Object consistencyToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object consistencyToken_ = ""; + /** * * @@ -138,6 +100,7 @@ public java.lang.String getConsistencyToken() { return s; } } + /** * * @@ -176,10 +139,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getConsistencyTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, consistencyToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consistencyToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, consistencyToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -188,10 +151,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getConsistencyTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, consistencyToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(consistencyToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, consistencyToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -208,7 +171,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) obj; if (!getConsistencyToken().equals(other.getConsistencyToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -221,7 +184,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONSISTENCY_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getConsistencyToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -263,38 +226,38 @@ public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse pars public static com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -318,10 +281,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -332,7 +296,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.GenerateConsistencyTokenResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -342,7 +306,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GenerateConsistencyTokenResponse_fieldAccessorTable @@ -352,24 +316,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; consistencyToken_ = ""; - return this; } @@ -398,42 +355,19 @@ public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse build() { public com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse buildPartial() { com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse result = new com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse(this); - result.consistencyToken_ = consistencyToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -452,9 +386,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GenerateConsistencyTokenRe return this; if (!other.getConsistencyToken().isEmpty()) { consistencyToken_ = other.consistencyToken_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -469,23 +404,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object consistencyToken_ = ""; + /** * * @@ -508,6 +464,7 @@ public java.lang.String getConsistencyToken() { return (java.lang.String) ref; } } + /** * * @@ -530,6 +487,7 @@ public com.google.protobuf.ByteString getConsistencyTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -546,11 +504,12 @@ public Builder setConsistencyToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - consistencyToken_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -563,11 +522,12 @@ public Builder setConsistencyToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearConsistencyToken() { - consistencyToken_ = getDefaultInstance().getConsistencyToken(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -585,23 +545,12 @@ public Builder setConsistencyTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - consistencyToken_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GenerateConsistencyTokenResponse) } @@ -624,7 +573,18 @@ public GenerateConsistencyTokenResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GenerateConsistencyTokenResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java index 81049bc139..356129ca04 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface GenerateConsistencyTokenResponseOrBuilder * @return The consistencyToken. */ java.lang.String getConsistencyToken(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java index 4feffaa5a3..a01e809fc3 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.GetAppProfileRequest} */ -public final class GetAppProfileRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private GetAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +55,13 @@ private GetAppProfileRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetAppProfileRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetAppProfileRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable @@ -112,13 +71,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @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}`.
    +   * Required. The unique name of the requested app profile. Values are of the
    +   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * * @@ -139,12 +101,13 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Required. The unique name of the requested app profile. Values are of the form
    -   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
    +   * Required. The unique name of the requested app profile. Values are of the
    +   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * * @@ -180,10 +143,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -192,10 +155,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +175,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.GetAppProfileRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,7 +188,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -267,38 +230,38 @@ public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( public static com.google.bigtable.admin.v2.GetAppProfileRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -321,10 +284,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -334,7 +298,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.GetAppProfileRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -344,7 +308,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetAppProfileRequest_fieldAccessorTable @@ -354,24 +318,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.GetAppProfileRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -399,42 +356,18 @@ public com.google.bigtable.admin.v2.GetAppProfileRequest build() { public com.google.bigtable.admin.v2.GetAppProfileRequest buildPartial() { com.google.bigtable.admin.v2.GetAppProfileRequest result = new com.google.bigtable.admin.v2.GetAppProfileRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -452,9 +385,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GetAppProfileRequest other return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -469,28 +403,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.GetAppProfileRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.GetAppProfileRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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}`.
    +     * Required. The unique name of the requested app profile. Values are of the
    +     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * * @@ -510,12 +466,13 @@ public java.lang.String getName() { 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}`.
    +     * Required. The unique name of the requested app profile. Values are of the
    +     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * * @@ -535,12 +492,13 @@ public com.google.protobuf.ByteString getNameBytes() { 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}`.
    +     * Required. The unique name of the requested app profile. Values are of the
    +     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * * @@ -554,17 +512,18 @@ 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}`.
    +     * Required. The unique name of the requested app profile. Values are of the
    +     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * * @@ -574,17 +533,18 @@ public Builder setName(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the requested app profile. Values are of the
    +     * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
          * 
    * * @@ -599,23 +559,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetAppProfileRequest) } @@ -637,7 +586,18 @@ public GetAppProfileRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetAppProfileRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java index e020273ffe..6da19167c3 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAppProfileRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,8 +30,8 @@ public interface GetAppProfileRequestOrBuilder * * *
    -   * Required. The unique name of the requested app profile. Values are of the form
    -   * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
    +   * Required. The unique name of the requested app profile. Values are of the
    +   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * * @@ -38,12 +41,13 @@ public interface GetAppProfileRequestOrBuilder * @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}`.
    +   * Required. The unique name of the requested app profile. Values are of the
    +   * form `projects/{project}/instances/{instance}/appProfiles/{app_profile}`.
        * 
    * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequest.java new file mode 100644 index 0000000000..43a29c57e8 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequestOrBuilder.java new file mode 100644 index 0000000000..2ac1f5b771 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java index 39bf377a22..df54cabb16 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -22,18 +24,31 @@ * * *
    - * The request for [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
    + * The request for
    + * [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
      * 
    * * Protobuf type {@code google.bigtable.admin.v2.GetBackupRequest} */ -public final class GetBackupRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private GetBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +56,13 @@ private GetBackupRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetBackupRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetBackupRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GetBackupRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GetBackupRequest_fieldAccessorTable @@ -112,7 +72,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -140,6 +103,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -182,10 +146,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -194,10 +158,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +178,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.GetBackupRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -227,7 +191,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -269,38 +233,38 @@ public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom( public static com.google.bigtable.admin.v2.GetBackupRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -323,20 +287,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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].
    +   * 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.GeneratedMessageV3.Builder + 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 { @@ -346,7 +312,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_GetBackupRequest_fieldAccessorTable @@ -356,24 +322,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.GetBackupRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -401,42 +360,18 @@ public com.google.bigtable.admin.v2.GetBackupRequest build() { public com.google.bigtable.admin.v2.GetBackupRequest buildPartial() { com.google.bigtable.admin.v2.GetBackupRequest result = new com.google.bigtable.admin.v2.GetBackupRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -453,9 +388,10 @@ 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -470,21 +406,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.GetBackupRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.GetBackupRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -511,6 +470,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -537,6 +497,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -557,11 +518,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -578,11 +540,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -604,23 +567,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetBackupRequest) } @@ -642,7 +594,18 @@ public GetBackupRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetBackupRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java index e2a8898e2a..c16dfaf439 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetBackupRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -39,6 +42,7 @@ public interface GetBackupRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java index cd0957c172..e578d83b52 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.GetClusterRequest} */ -public final class GetClusterRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private GetClusterRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +55,13 @@ private GetClusterRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetClusterRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetClusterRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetClusterRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable @@ -112,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -139,6 +101,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -180,10 +143,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -192,10 +155,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +175,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.GetClusterRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,7 +188,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -267,38 +230,38 @@ public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom( public static com.google.bigtable.admin.v2.GetClusterRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -321,10 +284,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -334,7 +298,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.GetClusterRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -344,7 +308,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetClusterRequest_fieldAccessorTable @@ -354,24 +318,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.GetClusterRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -399,42 +356,18 @@ public com.google.bigtable.admin.v2.GetClusterRequest build() { public com.google.bigtable.admin.v2.GetClusterRequest buildPartial() { com.google.bigtable.admin.v2.GetClusterRequest result = new com.google.bigtable.admin.v2.GetClusterRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -451,9 +384,10 @@ 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -468,21 +402,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.GetClusterRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.GetClusterRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -508,6 +465,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -533,6 +491,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -552,11 +511,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -572,11 +532,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -597,23 +558,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetClusterRequest) } @@ -635,7 +585,18 @@ public GetClusterRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetClusterRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java index a4e313feb6..0dea1d0b35 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetClusterRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -38,6 +41,7 @@ public interface GetClusterRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java index 50a61e1224..656370bf06 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.GetInstanceRequest} */ -public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private GetInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,68 +55,13 @@ private GetInstanceRequest() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new GetInstanceRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private GetInstanceRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetInstanceRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable @@ -112,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -139,6 +101,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -180,10 +143,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -192,10 +155,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +175,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.GetInstanceRequest) obj; if (!getName().equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -225,7 +188,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -267,38 +230,38 @@ public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom( public static com.google.bigtable.admin.v2.GetInstanceRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -321,10 +284,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -334,7 +298,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.GetInstanceRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -344,7 +308,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_GetInstanceRequest_fieldAccessorTable @@ -354,24 +318,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.GetInstanceRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - return this; } @@ -399,42 +356,18 @@ public com.google.bigtable.admin.v2.GetInstanceRequest build() { public com.google.bigtable.admin.v2.GetInstanceRequest buildPartial() { com.google.bigtable.admin.v2.GetInstanceRequest result = new com.google.bigtable.admin.v2.GetInstanceRequest(this); - result.name_ = name_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -452,9 +385,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GetInstanceRequest other) return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -469,21 +403,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.GetInstanceRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.GetInstanceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -509,6 +466,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -534,6 +492,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -553,11 +512,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -573,11 +533,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -598,23 +559,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetInstanceRequest) } @@ -636,7 +586,18 @@ public GetInstanceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new GetInstanceRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java index 5d06a96344..a5680ee546 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetInstanceRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -38,6 +41,7 @@ public interface GetInstanceRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequest.java new file mode 100644 index 0000000000..32cfb8b327 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetLogicalViewRequestOrBuilder.java new file mode 100644 index 0000000000..e7e6b8d012 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequest.java new file mode 100644 index 0000000000..d8db352ad5 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetMaterializedViewRequestOrBuilder.java new file mode 100644 index 0000000000..361a3fecfd --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequest.java new file mode 100644 index 0000000000..81c50f6493 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSchemaBundleRequestOrBuilder.java new file mode 100644 index 0000000000..f8ab3b13b4 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java index 67d7f02111..c4cf6a9c05 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -24,6 +26,7 @@ *
      * 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
    @@ -32,13 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.GetSnapshotRequest}
      */
    -public final class GetSnapshotRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private GetSnapshotRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -46,68 +61,13 @@ private GetSnapshotRequest() {
         name_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new GetSnapshotRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private GetSnapshotRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_fieldAccessorTable
    @@ -117,7 +77,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
    @@ -145,6 +108,7 @@ public java.lang.String getName() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -187,10 +151,10 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getNameBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -199,10 +163,10 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getNameBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -219,7 +183,7 @@ public boolean equals(final java.lang.Object obj) {
             (com.google.bigtable.admin.v2.GetSnapshotRequest) obj;
     
         if (!getName().equals(other.getName())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -232,7 +196,7 @@ public int hashCode() {
         hash = (19 * hash) + getDescriptor().hashCode();
         hash = (37 * hash) + NAME_FIELD_NUMBER;
         hash = (53 * hash) + getName().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -274,38 +238,38 @@ public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.GetSnapshotRequest parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -328,16 +292,18 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  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
    @@ -346,7 +312,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.GetSnapshotRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -356,7 +322,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_GetSnapshotRequest_fieldAccessorTable
    @@ -366,24 +332,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.GetSnapshotRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
           return this;
         }
     
    @@ -411,42 +370,18 @@ public com.google.bigtable.admin.v2.GetSnapshotRequest build() {
         public com.google.bigtable.admin.v2.GetSnapshotRequest buildPartial() {
           com.google.bigtable.admin.v2.GetSnapshotRequest result =
               new com.google.bigtable.admin.v2.GetSnapshotRequest(this);
    -      result.name_ = name_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -464,9 +399,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GetSnapshotRequest other)
             return this;
           if (!other.getName().isEmpty()) {
             name_ = other.name_;
    +        bitField0_ |= 0x00000001;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -481,21 +417,44 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.GetSnapshotRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.GetSnapshotRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
    @@ -522,6 +481,7 @@ public java.lang.String getName() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -548,6 +508,7 @@ public com.google.protobuf.ByteString getNameBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -568,11 +529,12 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -589,11 +551,12 @@ public Builder setName(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearName() {
    -
           name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -615,23 +578,12 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetSnapshotRequest)
       }
     
    @@ -653,7 +605,18 @@ public GetSnapshotRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new GetSnapshotRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java
    index e56c3bd5f1..9959da4fe6 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetSnapshotRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -39,6 +42,7 @@ public interface GetSnapshotRequestOrBuilder
        * @return The name.
        */
       java.lang.String getName();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java
    index a6fd6d9422..7db681eff6 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -28,13 +30,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.GetTableRequest}
      */
    -public final class GetTableRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private GetTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -43,75 +57,13 @@ private GetTableRequest() {
         view_ = 0;
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new GetTableRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private GetTableRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          case 16:
    -            {
    -              int rawValue = input.readEnum();
    -
    -              view_ = rawValue;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_GetTableRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_GetTableRequest_fieldAccessorTable
    @@ -121,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
    @@ -149,6 +104,7 @@ public java.lang.String getName() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -178,7 +134,8 @@ public com.google.protobuf.ByteString getNameBytes() {
       }
     
       public static final int VIEW_FIELD_NUMBER = 2;
    -  private int view_;
    +  private int view_ = 0;
    +
       /**
        *
        *
    @@ -195,6 +152,7 @@ public com.google.protobuf.ByteString getNameBytes() {
       public int getViewValue() {
         return view_;
       }
    +
       /**
        *
        *
    @@ -209,9 +167,8 @@ public int getViewValue() {
        */
       @java.lang.Override
       public com.google.bigtable.admin.v2.Table.View getView() {
    -    @SuppressWarnings("deprecation")
         com.google.bigtable.admin.v2.Table.View result =
    -        com.google.bigtable.admin.v2.Table.View.valueOf(view_);
    +        com.google.bigtable.admin.v2.Table.View.forNumber(view_);
         return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result;
       }
     
    @@ -229,13 +186,13 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getNameBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    +    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_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -244,13 +201,13 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getNameBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    +    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 += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -268,7 +225,7 @@ public boolean equals(final java.lang.Object obj) {
     
         if (!getName().equals(other.getName())) return false;
         if (view_ != other.view_) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -283,7 +240,7 @@ public int hashCode() {
         hash = (53 * hash) + getName().hashCode();
         hash = (37 * hash) + VIEW_FIELD_NUMBER;
         hash = (53 * hash) + view_;
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -325,38 +282,38 @@ public static com.google.bigtable.admin.v2.GetTableRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.GetTableRequest parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -379,10 +336,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -393,7 +351,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.GetTableRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -403,7 +361,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_GetTableRequest_fieldAccessorTable
    @@ -413,26 +371,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.GetTableRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
           view_ = 0;
    -
           return this;
         }
     
    @@ -460,43 +410,21 @@ public com.google.bigtable.admin.v2.GetTableRequest build() {
         public com.google.bigtable.admin.v2.GetTableRequest buildPartial() {
           com.google.bigtable.admin.v2.GetTableRequest result =
               new com.google.bigtable.admin.v2.GetTableRequest(this);
    -      result.name_ = name_;
    -      result.view_ = view_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -513,12 +441,13 @@ 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.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -533,21 +462,50 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.GetTableRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.GetTableRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
    @@ -574,6 +532,7 @@ public java.lang.String getName() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -600,6 +559,7 @@ public com.google.protobuf.ByteString getNameBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -620,11 +580,12 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -641,11 +602,12 @@ public Builder setName(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearName() {
    -
           name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -667,13 +629,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
     
         private int view_ = 0;
    +
         /**
          *
          *
    @@ -690,6 +653,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
         public int getViewValue() {
           return view_;
         }
    +
         /**
          *
          *
    @@ -704,11 +668,12 @@ public int getViewValue() {
          * @return This builder for chaining.
          */
         public Builder setViewValue(int value) {
    -
           view_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -723,11 +688,11 @@ public Builder setViewValue(int value) {
          */
         @java.lang.Override
         public com.google.bigtable.admin.v2.Table.View getView() {
    -      @SuppressWarnings("deprecation")
           com.google.bigtable.admin.v2.Table.View result =
    -          com.google.bigtable.admin.v2.Table.View.valueOf(view_);
    +          com.google.bigtable.admin.v2.Table.View.forNumber(view_);
           return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result;
         }
    +
         /**
          *
          *
    @@ -745,11 +710,12 @@ 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;
         }
    +
         /**
          *
          *
    @@ -763,23 +729,12 @@ public Builder setView(com.google.bigtable.admin.v2.Table.View value) {
          * @return This builder for chaining.
          */
         public Builder clearView() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000002);
           view_ = 0;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.GetTableRequest)
       }
     
    @@ -801,7 +756,18 @@ public GetTableRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new GetTableRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java
    index 7e88e78807..55242a9071 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetTableRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -39,6 +42,7 @@ public interface GetTableRequestOrBuilder
        * @return The name.
        */
       java.lang.String getName();
    +
       /**
        *
        *
    @@ -69,6 +73,7 @@ public interface GetTableRequestOrBuilder
        * @return The enum numeric value on the wire for view.
        */
       int getViewValue();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTablet.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTablet.java
    new file mode 100644
    index 0000000000..1275e268e7
    --- /dev/null
    +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTabletOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTabletOrBuilder.java new file mode 100644 index 0000000000..077e8d2848 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java index 7eb3180d7c..f82d1ab9f7 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Instance.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -30,13 +32,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.Instance} */ -public final class Instance extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Instance(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -47,96 +61,6 @@ private Instance() { type_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Instance(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Instance( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - displayName_ = s; - break; - } - case 24: - { - int rawValue = input.readEnum(); - - state_ = rawValue; - break; - } - case 32: - { - int rawValue = input.readEnum(); - - type_ = rawValue; - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - labels_ = - com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry labels__ = - input.readMessage( - LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_Instance_descriptor; @@ -144,17 +68,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable @@ -208,6 +135,16 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "State"); + } + /** * * @@ -218,6 +155,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * STATE_NOT_KNOWN = 0; */ public static final int STATE_NOT_KNOWN_VALUE = 0; + /** * * @@ -229,6 +167,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum { * READY = 1; */ public static final int READY_VALUE = 1; + /** * * @@ -299,7 +238,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Instance.getDescriptor().getEnumTypes().get(0); } @@ -361,13 +300,8 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * * *
    -     * The instance is meant for development and testing purposes only; it has
    -     * no performance or uptime guarantees and is not covered by SLA.
    -     * After a development instance is created, it can be upgraded by
    -     * updating the instance to type `PRODUCTION`. An instance created
    -     * as a production instance cannot be changed to a development instance.
    -     * When creating a development instance, `serve_nodes` on the cluster must
    -     * not be set.
    +     * DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
    +     * a higher minimum node count than DEVELOPMENT.
          * 
    * * DEVELOPMENT = 2; @@ -376,6 +310,16 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Type"); + } + /** * * @@ -388,6 +332,7 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * TYPE_UNSPECIFIED = 0; */ public static final int TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -399,17 +344,13 @@ public enum Type implements com.google.protobuf.ProtocolMessageEnum { * PRODUCTION = 1; */ public static final int PRODUCTION_VALUE = 1; + /** * * *
    -     * The instance is meant for development and testing purposes only; it has
    -     * no performance or uptime guarantees and is not covered by SLA.
    -     * After a development instance is created, it can be upgraded by
    -     * updating the instance to type `PRODUCTION`. An instance created
    -     * as a production instance cannot be changed to a development instance.
    -     * When creating a development instance, `serve_nodes` on the cluster must
    -     * not be set.
    +     * DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces
    +     * a higher minimum node count than DEVELOPMENT.
          * 
    * * DEVELOPMENT = 2; @@ -474,7 +415,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Instance.getDescriptor().getEnumTypes().get(1); } @@ -499,8 +440,12 @@ private Type(int value) { // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Instance.Type) } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -509,7 +454,7 @@ private Type(int value) { * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. *
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ @@ -525,6 +470,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -533,7 +479,7 @@ public java.lang.String getName() { * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. *
    * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -551,7 +497,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int DISPLAY_NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object displayName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object displayName_ = ""; + /** * * @@ -577,6 +526,7 @@ public java.lang.String getDisplayName() { return s; } } + /** * * @@ -604,16 +554,18 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { } public static final int STATE_FIELD_NUMBER = 3; - private int state_; + private int state_ = 0; + /** * * *
    -   * (`OutputOnly`)
    -   * The current state of the instance.
    +   * Output only. The current state of the instance.
        * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -621,28 +573,30 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { public int getStateValue() { return state_; } + /** * * *
    -   * (`OutputOnly`)
    -   * The current state of the instance.
    +   * Output only. The current state of the instance.
        * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Instance.State result = - com.google.bigtable.admin.v2.Instance.State.valueOf(state_); + 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_; + private int type_ = 0; + /** * * @@ -658,6 +612,7 @@ public com.google.bigtable.admin.v2.Instance.State getState() { public int getTypeValue() { return type_; } + /** * * @@ -671,9 +626,8 @@ public int getTypeValue() { */ @java.lang.Override public com.google.bigtable.admin.v2.Instance.Type getType() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Instance.Type result = - com.google.bigtable.admin.v2.Instance.Type.valueOf(type_); + com.google.bigtable.admin.v2.Instance.Type.forNumber(type_); return result == null ? com.google.bigtable.admin.v2.Instance.Type.UNRECOGNIZED : result; } @@ -690,6 +644,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -702,6 +657,7 @@ private com.google.protobuf.MapField interna public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -710,10 +666,11 @@ public int getLabelsCount() { * 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}`. + * 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}`. + * 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. *
    @@ -723,16 +680,18 @@ public int getLabelsCount() { @java.lang.Override public boolean containsLabels(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + 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(); } + /** * * @@ -741,10 +700,11 @@ public java.util.Map getLabels() { * 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}`. + * 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}`. + * 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. *
    @@ -755,6 +715,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -763,10 +724,11 @@ public java.util.Map getLabelsMap() { * 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}`. + * 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}`. + * 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. * @@ -774,13 +736,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 5; */ @java.lang.Override - public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -789,10 +755,11 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin * 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}`. + * 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}`. + * 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. * @@ -802,7 +769,7 @@ public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.Strin @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { @@ -811,6 +778,281 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { 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 @@ -825,11 +1067,11 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!getDisplayNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + 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_); @@ -837,9 +1079,20 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (type_ != com.google.bigtable.admin.v2.Instance.Type.TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(4, type_); } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + com.google.protobuf.GeneratedMessage.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); - unknownFields.writeTo(output); + 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); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -848,11 +1101,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!getDisplayNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + 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_); @@ -870,7 +1123,26 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); } - size += unknownFields.getSerializedSize(); + 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__); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -890,7 +1162,20 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (type_ != other.type_) return false; if (!internalGetLabels().equals(other.internalGetLabels())) return false; - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -913,7 +1198,23 @@ public int hashCode() { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } - hash = (29 * hash) + unknownFields.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; } @@ -954,38 +1255,38 @@ public static com.google.bigtable.admin.v2.Instance parseFrom( public static com.google.bigtable.admin.v2.Instance parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1008,10 +1309,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1024,7 +1326,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.Instance} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1034,27 +1336,33 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { + 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.MapField internalGetMutableMapField(int number) { + 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.InstanceProto .internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable @@ -1068,27 +1376,34 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetCreateTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - displayName_ = ""; - state_ = 0; - type_ = 0; - internalGetMutableLabels().clear(); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + satisfiesPzs_ = false; + satisfiesPzi_ = false; + internalGetMutableTags().clear(); return this; } @@ -1116,68 +1431,71 @@ public com.google.bigtable.admin.v2.Instance build() { public com.google.bigtable.admin.v2.Instance buildPartial() { com.google.bigtable.admin.v2.Instance result = new com.google.bigtable.admin.v2.Instance(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.displayName_ = displayName_; - result.state_ = state_; - result.type_ = type_; - result.labels_ = internalGetLabels(); - result.labels_.makeImmutable(); + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); + 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.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.satisfiesPzs_ = satisfiesPzs_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.satisfiesPzi_ = satisfiesPzi_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + } + result.bitField0_ |= to_bitField0_; } @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.bigtable.admin.v2.Instance) { - return mergeFrom((com.google.bigtable.admin.v2.Instance) other); - } else { - super.mergeFrom(other); - return this; - } + 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) { @@ -1187,7 +1505,19 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Instance other) { setTypeValue(other.getTypeValue()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); - this.mergeUnknownFields(other.unknownFields); + bitField0_ |= 0x00000010; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasSatisfiesPzs()) { + setSatisfiesPzs(other.getSatisfiesPzs()); + } + if (other.hasSatisfiesPzi()) { + setSatisfiesPzi(other.getSatisfiesPzi()); + } + internalGetMutableTags().mergeFrom(other.internalGetTags()); + bitField0_ |= 0x00000100; + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1202,23 +1532,102 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.Instance parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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_ |= 0x00000010; + break; + } // case 42 + case 58: + { + input.readMessage( + internalGetCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 64: + { + satisfiesPzs_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + case 88: + { + satisfiesPzi_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 88 + case 98: + { + com.google.protobuf.MapEntry tags__ = + input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableTags().getMutableMap().put(tags__.getKey(), tags__.getValue()); + bitField0_ |= 0x00000100; + 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) { - parsedMessage = (com.google.bigtable.admin.v2.Instance) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -1227,7 +1636,7 @@ public Builder mergeFrom( * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ @@ -1242,6 +1651,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -1250,7 +1660,7 @@ public java.lang.String getName() { * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -1265,6 +1675,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1273,7 +1684,7 @@ public com.google.protobuf.ByteString getNameBytes() { * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @param value The name to set. * @return This builder for chaining. @@ -1282,11 +1693,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1295,16 +1707,17 @@ public Builder setName(java.lang.String value) { * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1313,7 +1726,7 @@ public Builder clearName() { * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @param value The bytes for name to set. * @return This builder for chaining. @@ -1323,13 +1736,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object displayName_ = ""; + /** * * @@ -1354,6 +1768,7 @@ public java.lang.String getDisplayName() { return (java.lang.String) ref; } } + /** * * @@ -1378,6 +1793,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1396,11 +1812,12 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1415,11 +1832,12 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1439,22 +1857,24 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } private int state_ = 0; + /** * * *
    -     * (`OutputOnly`)
    -     * The current state of the instance.
    +     * Output only. The current state of the instance.
          * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -1462,53 +1882,58 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { public int getStateValue() { return state_; } + /** * * *
    -     * (`OutputOnly`)
    -     * The current state of the instance.
    +     * Output only. The current state of the instance.
          * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .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; } + /** * * *
    -     * (`OutputOnly`)
    -     * The current state of the instance.
    +     * Output only. The current state of the instance.
          * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Instance.State result = - com.google.bigtable.admin.v2.Instance.State.valueOf(state_); + com.google.bigtable.admin.v2.Instance.State.forNumber(state_); return result == null ? com.google.bigtable.admin.v2.Instance.State.UNRECOGNIZED : result; } + /** * * *
    -     * (`OutputOnly`)
    -     * The current state of the instance.
    +     * Output only. The current state of the instance.
          * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .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. @@ -1517,31 +1942,34 @@ 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; } + /** * * *
    -     * (`OutputOnly`)
    -     * The current state of the instance.
    +     * Output only. The current state of the instance.
          * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .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; + /** * * @@ -1557,6 +1985,7 @@ public Builder clearState() { public int getTypeValue() { return type_; } + /** * * @@ -1570,11 +1999,12 @@ public int getTypeValue() { * @return This builder for chaining. */ public Builder setTypeValue(int value) { - type_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1588,11 +2018,11 @@ public Builder setTypeValue(int value) { */ @java.lang.Override public com.google.bigtable.admin.v2.Instance.Type getType() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Instance.Type result = - com.google.bigtable.admin.v2.Instance.Type.valueOf(type_); + com.google.bigtable.admin.v2.Instance.Type.forNumber(type_); return result == null ? com.google.bigtable.admin.v2.Instance.Type.UNRECOGNIZED : result; } + /** * * @@ -1609,11 +2039,12 @@ 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; } + /** * * @@ -1626,7 +2057,7 @@ public Builder setType(com.google.bigtable.admin.v2.Instance.Type value) { * @return This builder for chaining. */ public Builder clearType() { - + bitField0_ = (bitField0_ & ~0x00000008); type_ = 0; onChanged(); return this; @@ -1643,20 +2074,21 @@ private com.google.protobuf.MapField interna private com.google.protobuf.MapField internalGetMutableLabels() { - onChanged(); - ; if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } + bitField0_ |= 0x00000010; + onChanged(); return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } + /** * * @@ -1665,10 +2097,11 @@ public int getLabelsCount() { * 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}`. + * 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}`. + * 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. * @@ -1678,16 +2111,18 @@ public int getLabelsCount() { @java.lang.Override public boolean containsLabels(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + 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(); } + /** * * @@ -1696,10 +2131,11 @@ public java.util.Map getLabels() { * 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}`. + * 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}`. + * 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. * @@ -1710,6 +2146,7 @@ public java.util.Map getLabels() { public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } + /** * * @@ -1718,10 +2155,11 @@ public java.util.Map getLabelsMap() { * 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}`. + * 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}`. + * 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. * @@ -1729,14 +2167,17 @@ public java.util.Map getLabelsMap() { * map<string, string> labels = 5; */ @java.lang.Override - public java.lang.String getLabelsOrDefault( - java.lang.String key, java.lang.String defaultValue) { + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * @@ -1745,10 +2186,11 @@ public java.lang.String getLabelsOrDefault( * 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}`. + * 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}`. + * 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. * @@ -1758,7 +2200,7 @@ public java.lang.String getLabelsOrDefault( @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { @@ -1768,9 +2210,11 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000010); internalGetMutableLabels().getMutableMap().clear(); return this; } + /** * * @@ -1779,10 +2223,11 @@ public Builder clearLabels() { * 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}`. + * 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}`. + * 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. * @@ -1791,16 +2236,19 @@ public Builder clearLabels() { */ public Builder removeLabels(java.lang.String key) { if (key == null) { - throw new java.lang.NullPointerException(); + 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_ |= 0x00000010; return internalGetMutableLabels().getMutableMap(); } + /** * * @@ -1809,10 +2257,11 @@ public java.util.Map getMutableLabels() { * 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}`. + * 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}`. + * 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. * @@ -1821,14 +2270,16 @@ public java.util.Map getMutableLabels() { */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map key"); } if (value == null) { - throw new java.lang.NullPointerException(); + throw new NullPointerException("map value"); } internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000010; return this; } + /** * * @@ -1837,10 +2288,11 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { * 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}`. + * 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}`. + * 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. * @@ -1849,18 +2301,624 @@ public Builder putLabels(java.lang.String key, java.lang.String value) { */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000010; + 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_ & 0x00000020) != 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_ |= 0x00000020; + 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_ |= 0x00000020; + 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_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000020; + 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_ & ~0x00000020); + 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_ |= 0x00000020; + 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_ & 0x00000040) != 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_ |= 0x00000040; + 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_ & ~0x00000040); + 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 final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public boolean hasSatisfiesPzi() { + return ((bitField0_ & 0x00000080) != 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 final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + 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_ |= 0x00000080; + 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_ & ~0x00000080); + 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_ |= 0x00000100; + 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_ & ~0x00000100); + 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_ |= 0x00000100; + 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_ |= 0x00000100; + 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_ |= 0x00000100; + return this; } // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Instance) @@ -1884,7 +2942,18 @@ public Instance parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Instance(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java index be111f92f6..88cf05a3ed 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,7 +137,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { InstanceName that = ((InstanceName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance); @@ -181,8 +181,8 @@ public Builder setInstance(String instance) { } private Builder(InstanceName instanceName) { - project = instanceName.project; - instance = instanceName.instance; + this.project = instanceName.project; + this.instance = instanceName.instance; } public InstanceName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java index fd555df3fa..031e1375c3 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -31,11 +34,12 @@ public interface InstanceOrBuilder * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The name. */ java.lang.String getName(); + /** * * @@ -44,7 +48,7 @@ public interface InstanceOrBuilder * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. * * - * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * string name = 1; * * @return The bytes for name. */ @@ -64,6 +68,7 @@ public interface InstanceOrBuilder * @return The displayName. */ java.lang.String getDisplayName(); + /** * * @@ -83,24 +88,27 @@ public interface InstanceOrBuilder * * *
    -   * (`OutputOnly`)
    -   * The current state of the instance.
    +   * Output only. The current state of the instance.
        * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .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(); + /** * * *
    -   * (`OutputOnly`)
    -   * The current state of the instance.
    +   * Output only. The current state of the instance.
        * 
    * - * .google.bigtable.admin.v2.Instance.State state = 3; + * + * .google.bigtable.admin.v2.Instance.State state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The state. */ @@ -118,6 +126,7 @@ public interface InstanceOrBuilder * @return The enum numeric value on the wire for type. */ int getTypeValue(); + /** * * @@ -139,10 +148,11 @@ public interface InstanceOrBuilder * 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}`. + * 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}`. + * 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. * @@ -150,6 +160,7 @@ public interface InstanceOrBuilder * map<string, string> labels = 5; */ int getLabelsCount(); + /** * * @@ -158,10 +169,11 @@ public interface InstanceOrBuilder * 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}`. + * 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}`. + * 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. * @@ -169,9 +181,11 @@ public interface InstanceOrBuilder * map<string, string> labels = 5; */ boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated java.util.Map getLabels(); + /** * * @@ -180,10 +194,11 @@ public interface InstanceOrBuilder * 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}`. + * 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}`. + * 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. * @@ -191,6 +206,7 @@ public interface InstanceOrBuilder * map<string, string> labels = 5; */ java.util.Map getLabelsMap(); + /** * * @@ -199,17 +215,23 @@ public interface InstanceOrBuilder * 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}`. + * 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}`. + * 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 getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** * * @@ -218,10 +240,11 @@ public interface InstanceOrBuilder * 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}`. + * 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}`. + * 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. * @@ -229,4 +252,215 @@ public interface InstanceOrBuilder * 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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java index 38b3642a6e..18e496bcc7 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class InstanceProto { +@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) { @@ -29,32 +42,76 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_Instance_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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; @@ -64,59 +121,166 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\'google/bigtable/admin/v2/instance.prot" + "\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\"\335\003\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\031" - + "\n\014display_name\030\002 \001(\tB\003\340A\002\0227\n\005state\030\003 \001(\016" - + "2(.google.bigtable.admin.v2.Instance.Sta" - + "te\0225\n\004type\030\004 \001(\0162\'.google.bigtable.admin" - + ".v2.Instance.Type\022>\n\006labels\030\005 \003(\0132..goog" - + "le.bigtable.admin.v2.Instance.LabelsEntr" - + "y\032-\n\013LabelsEntry\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\nPRODUCTION\020\001\022\017\n\013DEVELOP" - + "MENT\020\002:N\352AK\n bigtable.googleapis.com/Ins" - + "tance\022\'projects/{project}/instances/{ins" - + "tance}\"\315\004\n\007Cluster\022\021\n\004name\030\001 \001(\tB\003\340A\003\0228\n" - + "\010location\030\002 \001(\tB&\372A#\n!locations.googleap" - + "is.com/Location\022;\n\005state\030\003 \001(\0162\'.google." - + "bigtable.admin.v2.Cluster.StateB\003\340A\003\022\030\n\013" - + "serve_nodes\030\004 \001(\005B\003\340A\002\022C\n\024default_storag" - + "e_type\030\005 \001(\0162%.google.bigtable.admin.v2." - + "StorageType\022R\n\021encryption_config\030\006 \001(\01322" - + ".google.bigtable.admin.v2.Cluster.Encryp" - + "tionConfigB\003\340A\005\032P\n\020EncryptionConfig\022<\n\014k" - + "ms_key_name\030\001 \001(\tB&\372A#\n!cloudkms.googlea" - + "pis.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\010RESI" - + "ZING\020\003\022\014\n\010DISABLED\020\004:`\352A]\n\037bigtable.goog" - + "leapis.com/Cluster\022:projects/{project}/i" - + "nstances/{instance}/clusters/{cluster}\"\356" - + "\003\n\nAppProfile\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.MultiClusterRoutingU" - + "seAnyH\000\022[\n\026single_cluster_routing\030\006 \001(\0132" - + "9.google.bigtable.admin.v2.AppProfile.Si" - + "ngleClusterRoutingH\000\032\033\n\031MultiClusterRout" - + "ingUseAny\032N\n\024SingleClusterRouting\022\022\n\nclu" - + "ster_id\030\001 \001(\t\022\"\n\032allow_transactional_wri" - + "tes\030\002 \001(\010:j\352Ag\n\"bigtable.googleapis.com/" - + "AppProfile\022Aprojects/{project}/instances" - + "/{instance}/appProfiles/{app_profile}B\020\n" - + "\016routing_policyB\320\002\n\034com.google.bigtable." - + "admin.v2B\rInstanceProtoP\001Z=google.golang" - + ".org/genproto/googleapis/bigtable/admin/" - + "v2;admin\252\002\036Google.Cloud.Bigtable.Admin.V" - + "2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Goo" - + "gle::Cloud::Bigtable::Admin::V2\352Ax\n!clou" - + "dkms.googleapis.com/CryptoKey\022Sprojects/" - + "{project}/locations/{location}/keyRings/" - + "{key_ring}/cryptoKeys/{crypto_key}b\006prot" - + "o3" + + ".proto\032\037google/protobuf/timestamp.proto\"\207\006\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" + + "\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: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\'.google.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.goog" + + "le.bigtable.admin.v2.Cluster.NodeScalingFactorB\003\340A\005\022I\n" + + "\016cluster_config\030\007 \001(\0132/.go" + + "ogle.bigtable.admin.v2.Cluster.ClusterConfigH\000\022H\n" + + "\024default_storage_type\030\005 \001(\0162%.g" + + "oogle.bigtable.admin.v2.StorageTypeB\003\340A\005\022R\n" + + "\021encryption_config\030\006 \001(\01322.google.big" + + "table.admin.v2.Cluster.EncryptionConfigB\003\340A\005\032\270\001\n" + + "\030ClusterAutoscalingConfig\022L\n" + + "\022autoscaling_limits\030\001" + + " \001(\0132+.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.bigtable.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/{pr" + + "oject}/instances/{instance}/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.adm" + + "in.v2.AppProfile.MultiClusterRoutingUseAnyH\000\022[\n" + + "\026single_cluster_routing\030\006 \001(\01329.g" + + "oogle.bigtable.admin.v2.AppProfile.SingleClusterRoutingH\000\022E\n" + + "\010priority\030\007 \001(\0162-.go" + + "ogle.bigtable.admin.v2.AppProfile.PriorityB\002\030\001H\001\022T\n" + + "\022standard_isolation\030\013 \001(\01326.g" + + "oogle.bigtable.admin.v2.AppProfile.StandardIsolationH\001\022i\n" + + "\036data_boost_isolation_read_only\030\n" + + " \001(\0132?.google.bigtable.admin.v" + + "2.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.goo" + + "gle.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.bigtable.admin.v2.AppPr" + + "ofile.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/{proj" + + "ect}/instances/{instance}/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/{project}/instances/{inst" + + "ance}/logicalViews/{logical_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/{pro" + + "ject}/instances/{instance}/materializedV" + + "iews/{materialized_view}*\021materializedViews2\020materializedViewB\313\002\n" + + "\034com.google.bigtable.admin.v2B\r" + + "InstanceProtoP\001Z8cloud.google.com/go/bigtable/admin/apiv2/adminp" + + "b;adminpb\252\002\036Google.Cloud.Bigtable.Admin." + + "V2\312\002\036Google\\Cloud\\Bigtable\\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( @@ -125,43 +289,99 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { 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().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_bigtable_admin_v2_Instance_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Instance_descriptor, new java.lang.String[] { - "Name", "DisplayName", "State", "Type", "Labels", + "Name", + "DisplayName", + "State", + "Type", + "Labels", + "CreateTime", + "SatisfiesPzs", + "SatisfiesPzi", + "Tags", }); internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor = - internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedType(0); internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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_Cluster_descriptor = - getDescriptor().getMessageTypes().get(1); + 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.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Cluster_descriptor, new java.lang.String[] { - "Name", "Location", "State", "ServeNodes", "DefaultStorageType", "EncryptionConfig", + "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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Cluster_descriptor.getNestedType(2); internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(2); + getDescriptor().getMessageType(4); internal_static_google_bigtable_admin_v2_AppProfile_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_AppProfile_descriptor, new java.lang.String[] { "Name", @@ -169,22 +389,86 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedType(0); internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedType(1); internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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); @@ -193,9 +477,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.bigtable.admin.v2.CommonProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java index 4ccbcdc420..277fc5fb58 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesRequest} */ -public final class ListAppProfilesRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListAppProfilesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,80 +56,13 @@ private ListAppProfilesRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListAppProfilesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListAppProfilesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - case 24: - { - pageSize_ = input.readInt32(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable @@ -125,13 +72,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @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
    +   * 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/-`.
    @@ -155,12 +105,13 @@ public java.lang.String getParent() {
           return s;
         }
       }
    +
       /**
        *
        *
        * 
    -   * Required. The unique name of the instance for which a list of app profiles is
    -   * requested. Values are of the form
    +   * 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/-`.
    @@ -186,15 +137,18 @@ public com.google.protobuf.ByteString getParentBytes() {
       }
     
       public static final int PAGE_SIZE_FIELD_NUMBER = 3;
    -  private int pageSize_;
    +  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.
    @@ -210,7 +164,10 @@ public int getPageSize() {
       }
     
       public static final int PAGE_TOKEN_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object pageToken_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object pageToken_ = "";
    +
       /**
        *
        *
    @@ -234,6 +191,7 @@ public java.lang.String getPageToken() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -272,16 +230,16 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getParentBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_);
         }
    -    if (!getPageTokenBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_);
         }
         if (pageSize_ != 0) {
           output.writeInt32(3, pageSize_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -290,16 +248,16 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getParentBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_);
         }
    -    if (!getPageTokenBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_);
    +    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 += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -318,7 +276,7 @@ public boolean equals(final java.lang.Object obj) {
         if (!getParent().equals(other.getParent())) return false;
         if (getPageSize() != other.getPageSize()) return false;
         if (!getPageToken().equals(other.getPageToken())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -335,7 +293,7 @@ public int hashCode() {
         hash = (53 * hash) + getPageSize();
         hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
         hash = (53 * hash) + getPageToken().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -377,38 +335,38 @@ public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.ListAppProfilesRequest parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -431,10 +389,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -444,7 +403,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -454,7 +413,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableInstanceAdminProto
               .internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable
    @@ -464,28 +423,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.ListAppProfilesRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           parent_ = "";
    -
           pageSize_ = 0;
    -
           pageToken_ = "";
    -
           return this;
         }
     
    @@ -513,44 +463,24 @@ public com.google.bigtable.admin.v2.ListAppProfilesRequest build() {
         public com.google.bigtable.admin.v2.ListAppProfilesRequest buildPartial() {
           com.google.bigtable.admin.v2.ListAppProfilesRequest result =
               new com.google.bigtable.admin.v2.ListAppProfilesRequest(this);
    -      result.parent_ = parent_;
    -      result.pageSize_ = pageSize_;
    -      result.pageToken_ = pageToken_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -568,6 +498,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesRequest oth
             return this;
           if (!other.getParent().isEmpty()) {
             parent_ = other.parent_;
    +        bitField0_ |= 0x00000001;
             onChanged();
           }
           if (other.getPageSize() != 0) {
    @@ -575,9 +506,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesRequest oth
           }
           if (!other.getPageToken().isEmpty()) {
             pageToken_ = other.pageToken_;
    +        bitField0_ |= 0x00000004;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -592,28 +524,62 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.ListAppProfilesRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.ListAppProfilesRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        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
    +     * 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/-`.
    @@ -636,12 +602,13 @@ public java.lang.String getParent() {
             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
    +     * 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/-`.
    @@ -664,12 +631,13 @@ public com.google.protobuf.ByteString getParentBytes() {
             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
    +     * 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/-`.
    @@ -686,17 +654,18 @@ 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
    +     * 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/-`.
    @@ -709,17 +678,18 @@ public Builder setParent(java.lang.String value) {
          * @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
    +     * 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/-`.
    @@ -737,21 +707,24 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
             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.
    @@ -765,14 +738,17 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
         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.
    @@ -786,17 +762,21 @@ public int getPageSize() {
         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.
    @@ -807,13 +787,14 @@ public Builder setPageSize(int value) {
          * @return This builder for chaining.
          */
         public Builder clearPageSize() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000002);
           pageSize_ = 0;
           onChanged();
           return this;
         }
     
         private java.lang.Object pageToken_ = "";
    +
         /**
          *
          *
    @@ -836,6 +817,7 @@ public java.lang.String getPageToken() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -858,6 +840,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -874,11 +857,12 @@ public Builder setPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -891,11 +875,12 @@ public Builder setPageToken(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearPageToken() {
    -
           pageToken_ = getDefaultInstance().getPageToken();
    +      bitField0_ = (bitField0_ & ~0x00000004);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -913,23 +898,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListAppProfilesRequest)
       }
     
    @@ -951,7 +925,18 @@ public ListAppProfilesRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new ListAppProfilesRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java
    index 20f3acd123..ff95d7c35a 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -27,8 +30,8 @@ public interface ListAppProfilesRequestOrBuilder
        *
        *
        * 
    -   * Required. The unique name of the instance for which a list of app profiles is
    -   * requested. Values are of the form
    +   * 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/-`.
    @@ -41,12 +44,13 @@ public interface ListAppProfilesRequestOrBuilder
        * @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
    +   * 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/-`.
    @@ -65,9 +69,11 @@ public interface ListAppProfilesRequestOrBuilder
        *
        * 
        * 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.
    @@ -91,6 +97,7 @@ public interface ListAppProfilesRequestOrBuilder
        * @return The pageToken.
        */
       java.lang.String getPageToken();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java
    index ba93c0705e..f04a7e710c 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -27,103 +29,32 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesResponse}
      */
    -public final class ListAppProfilesResponse extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private ListAppProfilesResponse(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
       private ListAppProfilesResponse() {
         appProfiles_ = java.util.Collections.emptyList();
         nextPageToken_ = "";
    -    failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    -  }
    -
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new ListAppProfilesResponse();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private ListAppProfilesResponse(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    int mutable_bitField0_ = 0;
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
    -                appProfiles_ = new java.util.ArrayList();
    -                mutable_bitField0_ |= 0x00000001;
    -              }
    -              appProfiles_.add(
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.AppProfile.parser(), extensionRegistry));
    -              break;
    -            }
    -          case 18:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              nextPageToken_ = s;
    -              break;
    -            }
    -          case 26:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -              if (!((mutable_bitField0_ & 0x00000002) != 0)) {
    -                failedLocations_ = new com.google.protobuf.LazyStringArrayList();
    -                mutable_bitField0_ |= 0x00000002;
    -              }
    -              failedLocations_.add(s);
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      if (((mutable_bitField0_ & 0x00000001) != 0)) {
    -        appProfiles_ = java.util.Collections.unmodifiableList(appProfiles_);
    -      }
    -      if (((mutable_bitField0_ & 0x00000002) != 0)) {
    -        failedLocations_ = failedLocations_.getUnmodifiableView();
    -      }
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    +    failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList();
       }
     
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    @@ -132,7 +63,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableInstanceAdminProto
             .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable
    @@ -142,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int APP_PROFILES_FIELD_NUMBER = 1;
    +
    +  @SuppressWarnings("serial")
       private java.util.List appProfiles_;
    +
       /**
        *
        *
    @@ -156,6 +90,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       public java.util.List getAppProfilesList() {
         return appProfiles_;
       }
    +
       /**
        *
        *
    @@ -170,6 +105,7 @@ public java.util.List getAppProfilesLis
           getAppProfilesOrBuilderList() {
         return appProfiles_;
       }
    +
       /**
        *
        *
    @@ -183,6 +119,7 @@ public java.util.List getAppProfilesLis
       public int getAppProfilesCount() {
         return appProfiles_.size();
       }
    +
       /**
        *
        *
    @@ -196,6 +133,7 @@ public int getAppProfilesCount() {
       public com.google.bigtable.admin.v2.AppProfile getAppProfiles(int index) {
         return appProfiles_.get(index);
       }
    +
       /**
        *
        *
    @@ -211,7 +149,10 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(
       }
     
       public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object nextPageToken_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object nextPageToken_ = "";
    +
       /**
        *
        *
    @@ -237,6 +178,7 @@ public java.lang.String getNextPageToken() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -264,7 +206,11 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() {
       }
     
       public static final int FAILED_LOCATIONS_FIELD_NUMBER = 3;
    -  private com.google.protobuf.LazyStringList failedLocations_;
    +
    +  @SuppressWarnings("serial")
    +  private com.google.protobuf.LazyStringArrayList failedLocations_ =
    +      com.google.protobuf.LazyStringArrayList.emptyList();
    +
       /**
        *
        *
    @@ -282,6 +228,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() {
       public com.google.protobuf.ProtocolStringList getFailedLocationsList() {
         return failedLocations_;
       }
    +
       /**
        *
        *
    @@ -299,6 +246,7 @@ public com.google.protobuf.ProtocolStringList getFailedLocationsList() {
       public int getFailedLocationsCount() {
         return failedLocations_.size();
       }
    +
       /**
        *
        *
    @@ -317,6 +265,7 @@ public int getFailedLocationsCount() {
       public java.lang.String getFailedLocations(int index) {
         return failedLocations_.get(index);
       }
    +
       /**
        *
        *
    @@ -353,13 +302,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         for (int i = 0; i < appProfiles_.size(); i++) {
           output.writeMessage(1, appProfiles_.get(i));
         }
    -    if (!getNextPageTokenBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    +    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.GeneratedMessageV3.writeString(output, 3, failedLocations_.getRaw(i));
    +      com.google.protobuf.GeneratedMessage.writeString(output, 3, failedLocations_.getRaw(i));
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -371,8 +320,8 @@ public int getSerializedSize() {
         for (int i = 0; i < appProfiles_.size(); i++) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, appProfiles_.get(i));
         }
    -    if (!getNextPageTokenBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_);
         }
         {
           int dataSize = 0;
    @@ -382,7 +331,7 @@ public int getSerializedSize() {
           size += dataSize;
           size += 1 * getFailedLocationsList().size();
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -401,7 +350,7 @@ public boolean equals(final java.lang.Object obj) {
         if (!getAppProfilesList().equals(other.getAppProfilesList())) return false;
         if (!getNextPageToken().equals(other.getNextPageToken())) return false;
         if (!getFailedLocationsList().equals(other.getFailedLocationsList())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -422,7 +371,7 @@ public int hashCode() {
           hash = (37 * hash) + FAILED_LOCATIONS_FIELD_NUMBER;
           hash = (53 * hash) + getFailedLocationsList().hashCode();
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -464,38 +413,38 @@ public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom(
     
       public static com.google.bigtable.admin.v2.ListAppProfilesResponse parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -518,10 +467,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -531,7 +481,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.ListAppProfilesResponse}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -541,7 +491,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableInstanceAdminProto
               .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable
    @@ -551,34 +501,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.ListAppProfilesResponse.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    -        getAppProfilesFieldBuilder();
    -      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           if (appProfilesBuilder_ == null) {
             appProfiles_ = java.util.Collections.emptyList();
    -        bitField0_ = (bitField0_ & ~0x00000001);
           } else {
    +        appProfiles_ = null;
             appProfilesBuilder_.clear();
           }
    +      bitField0_ = (bitField0_ & ~0x00000001);
           nextPageToken_ = "";
    -
    -      failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    -      bitField0_ = (bitField0_ & ~0x00000002);
    +      failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList();
           return this;
         }
     
    @@ -606,7 +547,16 @@ public com.google.bigtable.admin.v2.ListAppProfilesResponse build() {
         public com.google.bigtable.admin.v2.ListAppProfilesResponse buildPartial() {
           com.google.bigtable.admin.v2.ListAppProfilesResponse result =
               new com.google.bigtable.admin.v2.ListAppProfilesResponse(this);
    -      int from_bitField0_ = bitField0_;
    +      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_);
    @@ -616,47 +566,17 @@ public com.google.bigtable.admin.v2.ListAppProfilesResponse buildPartial() {
           } else {
             result.appProfiles_ = appProfilesBuilder_.build();
           }
    -      result.nextPageToken_ = nextPageToken_;
    -      if (((bitField0_ & 0x00000002) != 0)) {
    -        failedLocations_ = failedLocations_.getUnmodifiableView();
    -        bitField0_ = (bitField0_ & ~0x00000002);
    -      }
    -      result.failedLocations_ = failedLocations_;
    -      onBuilt();
    -      return result;
    -    }
    -
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
         }
     
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -691,8 +611,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesResponse ot
                 appProfiles_ = other.appProfiles_;
                 bitField0_ = (bitField0_ & ~0x00000001);
                 appProfilesBuilder_ =
    -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
    -                    ? getAppProfilesFieldBuilder()
    +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
    +                    ? internalGetAppProfilesFieldBuilder()
                         : null;
               } else {
                 appProfilesBuilder_.addAllMessages(other.appProfiles_);
    @@ -701,19 +621,20 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesResponse ot
           }
           if (!other.getNextPageToken().isEmpty()) {
             nextPageToken_ = other.nextPageToken_;
    +        bitField0_ |= 0x00000002;
             onChanged();
           }
           if (!other.failedLocations_.isEmpty()) {
             if (failedLocations_.isEmpty()) {
               failedLocations_ = other.failedLocations_;
    -          bitField0_ = (bitField0_ & ~0x00000002);
    +          bitField0_ |= 0x00000004;
             } else {
               ensureFailedLocationsIsMutable();
               failedLocations_.addAll(other.failedLocations_);
             }
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -728,18 +649,57 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.ListAppProfilesResponse parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.ListAppProfilesResponse) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    @@ -756,7 +716,7 @@ private void ensureAppProfilesIsMutable() {
           }
         }
     
    -    private com.google.protobuf.RepeatedFieldBuilderV3<
    +    private com.google.protobuf.RepeatedFieldBuilder<
                 com.google.bigtable.admin.v2.AppProfile,
                 com.google.bigtable.admin.v2.AppProfile.Builder,
                 com.google.bigtable.admin.v2.AppProfileOrBuilder>
    @@ -778,6 +738,7 @@ public java.util.List getAppProfilesLis
             return appProfilesBuilder_.getMessageList();
           }
         }
    +
         /**
          *
          *
    @@ -794,6 +755,7 @@ public int getAppProfilesCount() {
             return appProfilesBuilder_.getCount();
           }
         }
    +
         /**
          *
          *
    @@ -810,6 +772,7 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfiles(int index) {
             return appProfilesBuilder_.getMessage(index);
           }
         }
    +
         /**
          *
          *
    @@ -832,6 +795,7 @@ public Builder setAppProfiles(int index, com.google.bigtable.admin.v2.AppProfile
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -852,6 +816,7 @@ public Builder setAppProfiles(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -874,6 +839,7 @@ public Builder addAppProfiles(com.google.bigtable.admin.v2.AppProfile value) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -896,6 +862,7 @@ public Builder addAppProfiles(int index, com.google.bigtable.admin.v2.AppProfile
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -915,6 +882,7 @@ public Builder addAppProfiles(com.google.bigtable.admin.v2.AppProfile.Builder bu
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -935,6 +903,7 @@ public Builder addAppProfiles(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -955,6 +924,7 @@ public Builder addAllAppProfiles(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -974,6 +944,7 @@ public Builder clearAppProfiles() {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -993,6 +964,7 @@ public Builder removeAppProfiles(int index) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -1003,8 +975,9 @@ public Builder removeAppProfiles(int index) {
          * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1;
          */
         public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfilesBuilder(int index) {
    -      return getAppProfilesFieldBuilder().getBuilder(index);
    +      return internalGetAppProfilesFieldBuilder().getBuilder(index);
         }
    +
         /**
          *
          *
    @@ -1021,6 +994,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(
             return appProfilesBuilder_.getMessageOrBuilder(index);
           }
         }
    +
         /**
          *
          *
    @@ -1038,6 +1012,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(
             return java.util.Collections.unmodifiableList(appProfiles_);
           }
         }
    +
         /**
          *
          *
    @@ -1048,9 +1023,10 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder(
          * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1;
          */
         public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder() {
    -      return getAppProfilesFieldBuilder()
    +      return internalGetAppProfilesFieldBuilder()
               .addBuilder(com.google.bigtable.admin.v2.AppProfile.getDefaultInstance());
         }
    +
         /**
          *
          *
    @@ -1061,9 +1037,10 @@ public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder() {
          * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1;
          */
         public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder(int index) {
    -      return getAppProfilesFieldBuilder()
    +      return internalGetAppProfilesFieldBuilder()
               .addBuilder(index, com.google.bigtable.admin.v2.AppProfile.getDefaultInstance());
         }
    +
         /**
          *
          *
    @@ -1075,17 +1052,17 @@ public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder(int
          */
         public java.util.List
             getAppProfilesBuilderList() {
    -      return getAppProfilesFieldBuilder().getBuilderList();
    +      return internalGetAppProfilesFieldBuilder().getBuilderList();
         }
     
    -    private com.google.protobuf.RepeatedFieldBuilderV3<
    +    private com.google.protobuf.RepeatedFieldBuilder<
                 com.google.bigtable.admin.v2.AppProfile,
                 com.google.bigtable.admin.v2.AppProfile.Builder,
                 com.google.bigtable.admin.v2.AppProfileOrBuilder>
    -        getAppProfilesFieldBuilder() {
    +        internalGetAppProfilesFieldBuilder() {
           if (appProfilesBuilder_ == null) {
             appProfilesBuilder_ =
    -            new com.google.protobuf.RepeatedFieldBuilderV3<
    +            new com.google.protobuf.RepeatedFieldBuilder<
                     com.google.bigtable.admin.v2.AppProfile,
                     com.google.bigtable.admin.v2.AppProfile.Builder,
                     com.google.bigtable.admin.v2.AppProfileOrBuilder>(
    @@ -1096,6 +1073,7 @@ public com.google.bigtable.admin.v2.AppProfile.Builder addAppProfilesBuilder(int
         }
     
         private java.lang.Object nextPageToken_ = "";
    +
         /**
          *
          *
    @@ -1120,6 +1098,7 @@ public java.lang.String getNextPageToken() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1144,6 +1123,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1162,11 +1142,12 @@ public Builder setNextPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1181,11 +1162,12 @@ public Builder setNextPageToken(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearNextPageToken() {
    -
           nextPageToken_ = getDefaultInstance().getNextPageToken();
    +      bitField0_ = (bitField0_ & ~0x00000002);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1205,21 +1187,22 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
     
    -    private com.google.protobuf.LazyStringList failedLocations_ =
    -        com.google.protobuf.LazyStringArrayList.EMPTY;
    +    private com.google.protobuf.LazyStringArrayList failedLocations_ =
    +        com.google.protobuf.LazyStringArrayList.emptyList();
     
         private void ensureFailedLocationsIsMutable() {
    -      if (!((bitField0_ & 0x00000002) != 0)) {
    +      if (!failedLocations_.isModifiable()) {
             failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_);
    -        bitField0_ |= 0x00000002;
           }
    +      bitField0_ |= 0x00000004;
         }
    +
         /**
          *
          *
    @@ -1235,8 +1218,10 @@ private void ensureFailedLocationsIsMutable() {
          * @return A list containing the failedLocations.
          */
         public com.google.protobuf.ProtocolStringList getFailedLocationsList() {
    -      return failedLocations_.getUnmodifiableView();
    +      failedLocations_.makeImmutable();
    +      return failedLocations_;
         }
    +
         /**
          *
          *
    @@ -1254,6 +1239,7 @@ public com.google.protobuf.ProtocolStringList getFailedLocationsList() {
         public int getFailedLocationsCount() {
           return failedLocations_.size();
         }
    +
         /**
          *
          *
    @@ -1272,6 +1258,7 @@ public int getFailedLocationsCount() {
         public java.lang.String getFailedLocations(int index) {
           return failedLocations_.get(index);
         }
    +
         /**
          *
          *
    @@ -1290,6 +1277,7 @@ public java.lang.String getFailedLocations(int index) {
         public com.google.protobuf.ByteString getFailedLocationsBytes(int index) {
           return failedLocations_.getByteString(index);
         }
    +
         /**
          *
          *
    @@ -1312,9 +1300,11 @@ public Builder setFailedLocations(int index, java.lang.String value) {
           }
           ensureFailedLocationsIsMutable();
           failedLocations_.set(index, value);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1336,9 +1326,11 @@ public Builder addFailedLocations(java.lang.String value) {
           }
           ensureFailedLocationsIsMutable();
           failedLocations_.add(value);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1357,9 +1349,11 @@ public Builder addFailedLocations(java.lang.String value) {
         public Builder addAllFailedLocations(java.lang.Iterable values) {
           ensureFailedLocationsIsMutable();
           com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedLocations_);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1375,11 +1369,13 @@ public Builder addAllFailedLocations(java.lang.Iterable values
          * @return This builder for chaining.
          */
         public Builder clearFailedLocations() {
    -      failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    -      bitField0_ = (bitField0_ & ~0x00000002);
    +      failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList();
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      ;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1402,21 +1398,11 @@ public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) {
           checkByteStringIsUtf8(value);
           ensureFailedLocationsIsMutable();
           failedLocations_.add(value);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListAppProfilesResponse)
       }
     
    @@ -1438,7 +1424,18 @@ public ListAppProfilesResponse parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new ListAppProfilesResponse(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java
    index b4a022e5af..023200c187 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -33,6 +36,7 @@ public interface ListAppProfilesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1;
        */
       java.util.List getAppProfilesList();
    +
       /**
        *
        *
    @@ -43,6 +47,7 @@ public interface ListAppProfilesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1;
        */
       com.google.bigtable.admin.v2.AppProfile getAppProfiles(int index);
    +
       /**
        *
        *
    @@ -53,6 +58,7 @@ public interface ListAppProfilesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.AppProfile app_profiles = 1;
        */
       int getAppProfilesCount();
    +
       /**
        *
        *
    @@ -64,6 +70,7 @@ public interface ListAppProfilesResponseOrBuilder
        */
       java.util.List
           getAppProfilesOrBuilderList();
    +
       /**
        *
        *
    @@ -89,6 +96,7 @@ public interface ListAppProfilesResponseOrBuilder
        * @return The nextPageToken.
        */
       java.lang.String getNextPageToken();
    +
       /**
        *
        *
    @@ -119,6 +127,7 @@ public interface ListAppProfilesResponseOrBuilder
        * @return A list containing the failedLocations.
        */
       java.util.List getFailedLocationsList();
    +
       /**
        *
        *
    @@ -134,6 +143,7 @@ public interface ListAppProfilesResponseOrBuilder
        * @return The count of failedLocations.
        */
       int getFailedLocationsCount();
    +
       /**
        *
        *
    @@ -150,6 +160,7 @@ public interface ListAppProfilesResponseOrBuilder
        * @return The failedLocations at the given index.
        */
       java.lang.String getFailedLocations(int index);
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequest.java
    new file mode 100644
    index 0000000000..adad9eb877
    --- /dev/null
    +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequestOrBuilder.java new file mode 100644 index 0000000000..fca8de12bd --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponse.java new file mode 100644 index 0000000000..8d2efc53b0 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponseOrBuilder.java new file mode 100644 index 0000000000..d97163303d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java index 8b46d73189..28adc5789e 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -22,18 +24,31 @@ * * *
    - * The request for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
    + * The request for
    + * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
      * 
    * * Protobuf type {@code google.bigtable.admin.v2.ListBackupsRequest} */ -public final class ListBackupsRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListBackupsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,94 +59,13 @@ private ListBackupsRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListBackupsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListBackupsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - filter_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - orderBy_ = s; - break; - } - case 32: - { - pageSize_ = input.readInt32(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ListBackupsRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ListBackupsRequest_fieldAccessorTable @@ -141,7 +75,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * @@ -170,6 +107,7 @@ public java.lang.String getParent() { return s; } } + /** * * @@ -200,7 +138,10 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int FILTER_FIELD_NUMBER = 2; - private volatile java.lang.Object filter_; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** * * @@ -211,28 +152,33 @@ public com.google.protobuf.ByteString getParentBytes() { * 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` + * + * * `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 + * + * * `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; @@ -251,6 +197,7 @@ public java.lang.String getFilter() { return s; } } + /** * * @@ -261,28 +208,33 @@ public java.lang.String getFilter() { * 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` + * + * * `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 + * + * * `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; @@ -303,26 +255,34 @@ public com.google.protobuf.ByteString getFilterBytes() { } public static final int ORDER_BY_FIELD_NUMBER = 3; - private volatile java.lang.Object orderBy_; + + @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.
    +   * 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
    +   *
    +   * * 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.
        * 
    @@ -343,25 +303,31 @@ public java.lang.String getOrderBy() { 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.
    +   * 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
    +   *
    +   * * 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.
        * 
    @@ -384,7 +350,8 @@ public com.google.protobuf.ByteString getOrderByBytes() { } public static final int PAGE_SIZE_FIELD_NUMBER = 4; - private int pageSize_; + private int pageSize_ = 0; + /** * * @@ -403,15 +370,19 @@ public int getPageSize() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 5; - private volatile java.lang.Object pageToken_; + + @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`.
    +   * [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; @@ -430,14 +401,16 @@ public java.lang.String getPageToken() { 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`.
    +   * [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; @@ -471,22 +444,22 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getFilterBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, filter_); } - if (!getOrderByBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, orderBy_); } if (pageSize_ != 0) { output.writeInt32(4, pageSize_); } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -495,22 +468,22 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getFilterBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, filter_); } - if (!getOrderByBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + 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 (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -531,7 +504,7 @@ public boolean equals(final java.lang.Object obj) { if (!getOrderBy().equals(other.getOrderBy())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -552,7 +525,7 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -594,38 +567,38 @@ public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom( public static com.google.bigtable.admin.v2.ListBackupsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -648,20 +621,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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].
    +   * 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.GeneratedMessageV3.Builder + 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 { @@ -671,7 +646,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ListBackupsRequest_fieldAccessorTable @@ -681,32 +656,21 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ListBackupsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - filter_ = ""; - orderBy_ = ""; - pageSize_ = 0; - pageToken_ = ""; - return this; } @@ -734,46 +698,30 @@ public com.google.bigtable.admin.v2.ListBackupsRequest build() { public com.google.bigtable.admin.v2.ListBackupsRequest buildPartial() { com.google.bigtable.admin.v2.ListBackupsRequest result = new com.google.bigtable.admin.v2.ListBackupsRequest(this); - result.parent_ = parent_; - result.filter_ = filter_; - result.orderBy_ = orderBy_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -791,14 +739,17 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListBackupsRequest other) 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) { @@ -806,9 +757,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListBackupsRequest other) } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; + bitField0_ |= 0x00000010; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -823,21 +775,68 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ListBackupsRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.ListBackupsRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * @@ -865,6 +864,7 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * @@ -892,6 +892,7 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -913,11 +914,12 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -935,11 +937,12 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -962,13 +965,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object filter_ = ""; + /** * * @@ -979,28 +983,33 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * 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` + * + * * `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 + * + * * `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; @@ -1018,6 +1027,7 @@ public java.lang.String getFilter() { return (java.lang.String) ref; } } + /** * * @@ -1028,28 +1038,33 @@ public java.lang.String getFilter() { * 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` + * + * * `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 + * + * * `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; @@ -1067,6 +1082,7 @@ public com.google.protobuf.ByteString getFilterBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1077,28 +1093,33 @@ public com.google.protobuf.ByteString getFilterBytes() { * 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` + * + * * `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 + * + * * `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; @@ -1110,11 +1131,12 @@ public Builder setFilter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1125,28 +1147,33 @@ public Builder setFilter(java.lang.String value) { * 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` + * + * * `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 + * + * * `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; @@ -1154,11 +1181,12 @@ public Builder setFilter(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFilter() { - filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -1169,28 +1197,33 @@ public Builder clearFilter() { * 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` + * + * * `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 + * + * * `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; @@ -1203,32 +1236,38 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { 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.
    +     * 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
    +     *
    +     * * 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.
          * 
    @@ -1248,25 +1287,31 @@ public java.lang.String getOrderBy() { 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.
    +     * 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
    +     *
    +     * * 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.
          * 
    @@ -1286,25 +1331,31 @@ public com.google.protobuf.ByteString getOrderByBytes() { 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.
    +     * 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
    +     *
    +     * * 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.
          * 
    @@ -1318,30 +1369,36 @@ 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.
    +     * 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
    +     *
    +     * * 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.
          * 
    @@ -1351,30 +1408,36 @@ public Builder setOrderBy(java.lang.String value) { * @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.
    +     * 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
    +     *
    +     * * 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.
          * 
    @@ -1389,13 +1452,14 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - orderBy_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private int pageSize_; + /** * * @@ -1412,6 +1476,7 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) { public int getPageSize() { return pageSize_; } + /** * * @@ -1428,9 +1493,11 @@ public int getPageSize() { public Builder setPageSize(int value) { pageSize_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1444,21 +1511,23 @@ public Builder setPageSize(int value) { * @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`.
    +     * [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; @@ -1476,14 +1545,16 @@ public java.lang.String getPageToken() { 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`.
    +     * [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; @@ -1501,14 +1572,16 @@ public com.google.protobuf.ByteString getPageTokenBytes() { 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`.
    +     * [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; @@ -1520,19 +1593,21 @@ 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`.
    +     * [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; @@ -1540,19 +1615,21 @@ public Builder setPageToken(java.lang.String value) { * @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`.
    +     * [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; @@ -1565,23 +1642,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListBackupsRequest) } @@ -1603,7 +1669,18 @@ public ListBackupsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListBackupsRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java index c581ddaefb..06162ac8e1 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -40,6 +43,7 @@ public interface ListBackupsRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * @@ -68,28 +72,33 @@ public interface ListBackupsRequestOrBuilder * 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` + * + * * `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 + * + * * `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; @@ -97,6 +106,7 @@ public interface ListBackupsRequestOrBuilder * @return The filter. */ java.lang.String getFilter(); + /** * * @@ -107,28 +117,33 @@ public interface ListBackupsRequestOrBuilder * 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` + * + * * `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 + * + * * `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; @@ -142,20 +157,25 @@ public interface ListBackupsRequestOrBuilder * *
        * 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.
    +   * 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
    +   *
    +   * * 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.
        * 
    @@ -165,25 +185,31 @@ public interface ListBackupsRequestOrBuilder * @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.
    +   * 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
    +   *
    +   * * 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.
        * 
    @@ -213,9 +239,10 @@ public interface ListBackupsRequestOrBuilder * *
        * 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`.
    +   * [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; @@ -223,14 +250,16 @@ public interface ListBackupsRequestOrBuilder * @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`.
    +   * [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; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java index 8c9138a8ff..b1687c7f3c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -22,18 +24,31 @@ * * *
    - * The response for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
    + * The response for
    + * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
      * 
    * * Protobuf type {@code google.bigtable.admin.v2.ListBackupsResponse} */ -public final class ListBackupsResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListBackupsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,83 +57,13 @@ private ListBackupsResponse() { nextPageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListBackupsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListBackupsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - backups_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - backups_.add( - input.readMessage( - com.google.bigtable.admin.v2.Backup.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - backups_ = java.util.Collections.unmodifiableList(backups_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ListBackupsResponse_fieldAccessorTable @@ -128,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List backups_; + /** * * @@ -142,6 +90,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getBackupsList() { return backups_; } + /** * * @@ -156,6 +105,7 @@ public java.util.List getBackupsList() { getBackupsOrBuilderList() { return backups_; } + /** * * @@ -169,6 +119,7 @@ public java.util.List getBackupsList() { public int getBackupsCount() { return backups_.size(); } + /** * * @@ -182,6 +133,7 @@ public int getBackupsCount() { public com.google.bigtable.admin.v2.Backup getBackups(int index) { return backups_.get(index); } + /** * * @@ -197,14 +149,17 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int inde } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; + + @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.
    +   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +   * to fetch more of the matching backups.
        * 
    * * string next_page_token = 2; @@ -223,13 +178,14 @@ public java.lang.String getNextPageToken() { 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.
    +   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +   * to fetch more of the matching backups.
        * 
    * * string next_page_token = 2; @@ -266,10 +222,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < backups_.size(); i++) { output.writeMessage(1, backups_.get(i)); } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -281,10 +237,10 @@ public int getSerializedSize() { for (int i = 0; i < backups_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, backups_.get(i)); } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -302,7 +258,7 @@ public boolean equals(final java.lang.Object obj) { if (!getBackupsList().equals(other.getBackupsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -319,7 +275,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -361,38 +317,38 @@ public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( public static com.google.bigtable.admin.v2.ListBackupsResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -415,20 +371,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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].
    +   * 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.GeneratedMessageV3.Builder + 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 { @@ -438,7 +396,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ListBackupsResponse_fieldAccessorTable @@ -448,32 +406,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ListBackupsResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getBackupsFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (backupsBuilder_ == null) { backups_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + backups_ = null; backupsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; - return this; } @@ -501,7 +451,16 @@ public com.google.bigtable.admin.v2.ListBackupsResponse build() { public com.google.bigtable.admin.v2.ListBackupsResponse buildPartial() { com.google.bigtable.admin.v2.ListBackupsResponse result = new com.google.bigtable.admin.v2.ListBackupsResponse(this); - int from_bitField0_ = bitField0_; + 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_); @@ -511,42 +470,13 @@ public com.google.bigtable.admin.v2.ListBackupsResponse buildPartial() { } else { result.backups_ = backupsBuilder_.build(); } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -581,8 +511,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListBackupsResponse other) backups_ = other.backups_; bitField0_ = (bitField0_ & ~0x00000001); backupsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getBackupsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetBackupsFieldBuilder() : null; } else { backupsBuilder_.addAllMessages(other.backups_); @@ -591,9 +521,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListBackupsResponse other) } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -608,17 +539,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ListBackupsResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.ListBackupsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -634,7 +598,7 @@ private void ensureBackupsIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder> @@ -656,6 +620,7 @@ public java.util.List getBackupsList() { return backupsBuilder_.getMessageList(); } } + /** * * @@ -672,6 +637,7 @@ public int getBackupsCount() { return backupsBuilder_.getCount(); } } + /** * * @@ -688,6 +654,7 @@ public com.google.bigtable.admin.v2.Backup getBackups(int index) { return backupsBuilder_.getMessage(index); } } + /** * * @@ -710,6 +677,7 @@ public Builder setBackups(int index, com.google.bigtable.admin.v2.Backup value) } return this; } + /** * * @@ -730,6 +698,7 @@ public Builder setBackups( } return this; } + /** * * @@ -752,6 +721,7 @@ public Builder addBackups(com.google.bigtable.admin.v2.Backup value) { } return this; } + /** * * @@ -774,6 +744,7 @@ public Builder addBackups(int index, com.google.bigtable.admin.v2.Backup value) } return this; } + /** * * @@ -793,6 +764,7 @@ public Builder addBackups(com.google.bigtable.admin.v2.Backup.Builder builderFor } return this; } + /** * * @@ -813,6 +785,7 @@ public Builder addBackups( } return this; } + /** * * @@ -833,6 +806,7 @@ public Builder addAllBackups( } return this; } + /** * * @@ -852,6 +826,7 @@ public Builder clearBackups() { } return this; } + /** * * @@ -871,6 +846,7 @@ public Builder removeBackups(int index) { } return this; } + /** * * @@ -881,8 +857,9 @@ public Builder removeBackups(int index) { * repeated .google.bigtable.admin.v2.Backup backups = 1; */ public com.google.bigtable.admin.v2.Backup.Builder getBackupsBuilder(int index) { - return getBackupsFieldBuilder().getBuilder(index); + return internalGetBackupsFieldBuilder().getBuilder(index); } + /** * * @@ -899,6 +876,7 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int inde return backupsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -916,6 +894,7 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int inde return java.util.Collections.unmodifiableList(backups_); } } + /** * * @@ -926,9 +905,10 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupsOrBuilder(int inde * repeated .google.bigtable.admin.v2.Backup backups = 1; */ public com.google.bigtable.admin.v2.Backup.Builder addBackupsBuilder() { - return getBackupsFieldBuilder() + return internalGetBackupsFieldBuilder() .addBuilder(com.google.bigtable.admin.v2.Backup.getDefaultInstance()); } + /** * * @@ -939,9 +919,10 @@ public com.google.bigtable.admin.v2.Backup.Builder addBackupsBuilder() { * repeated .google.bigtable.admin.v2.Backup backups = 1; */ public com.google.bigtable.admin.v2.Backup.Builder addBackupsBuilder(int index) { - return getBackupsFieldBuilder() + return internalGetBackupsFieldBuilder() .addBuilder(index, com.google.bigtable.admin.v2.Backup.getDefaultInstance()); } + /** * * @@ -952,17 +933,17 @@ public com.google.bigtable.admin.v2.Backup.Builder addBackupsBuilder(int index) * repeated .google.bigtable.admin.v2.Backup backups = 1; */ public java.util.List getBackupsBuilderList() { - return getBackupsFieldBuilder().getBuilderList(); + return internalGetBackupsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder> - getBackupsFieldBuilder() { + internalGetBackupsFieldBuilder() { if (backupsBuilder_ == null) { backupsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder>( @@ -973,13 +954,14 @@ public java.util.List getBackupsBui } 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.
    +     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +     * to fetch more of the matching backups.
          * 
    * * string next_page_token = 2; @@ -997,13 +979,14 @@ public java.lang.String getNextPageToken() { 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.
    +     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +     * to fetch more of the matching backups.
          * 
    * * string next_page_token = 2; @@ -1021,13 +1004,14 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { 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.
    +     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +     * to fetch more of the matching backups.
          * 
    * * string next_page_token = 2; @@ -1039,18 +1023,19 @@ 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.
    +     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +     * to fetch more of the matching backups.
          * 
    * * string next_page_token = 2; @@ -1058,18 +1043,19 @@ public Builder setNextPageToken(java.lang.String value) { * @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.
    +     * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +     * to fetch more of the matching backups.
          * 
    * * string next_page_token = 2; @@ -1082,23 +1068,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListBackupsResponse) } @@ -1120,7 +1095,18 @@ public ListBackupsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListBackupsResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java index 99a982ec0d..c1f8d9efc5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListBackupsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -33,6 +36,7 @@ public interface ListBackupsResponseOrBuilder * repeated .google.bigtable.admin.v2.Backup backups = 1; */ java.util.List getBackupsList(); + /** * * @@ -43,6 +47,7 @@ public interface ListBackupsResponseOrBuilder * repeated .google.bigtable.admin.v2.Backup backups = 1; */ com.google.bigtable.admin.v2.Backup getBackups(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListBackupsResponseOrBuilder * repeated .google.bigtable.admin.v2.Backup backups = 1; */ int getBackupsCount(); + /** * * @@ -63,6 +69,7 @@ public interface ListBackupsResponseOrBuilder * repeated .google.bigtable.admin.v2.Backup backups = 1; */ java.util.List getBackupsOrBuilderList(); + /** * * @@ -79,8 +86,8 @@ public interface ListBackupsResponseOrBuilder * *
        * `next_page_token` can be sent in a subsequent
    -   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call to fetch more
    -   * of the matching backups.
    +   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +   * to fetch more of the matching backups.
        * 
    * * string next_page_token = 2; @@ -88,13 +95,14 @@ public interface ListBackupsResponseOrBuilder * @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.
    +   * [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call
    +   * to fetch more of the matching backups.
        * 
    * * string next_page_token = 2; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java index 2d1a2cf256..5a2288c178 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.ListClustersRequest} */ -public final class ListClustersRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListClustersRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,75 +56,13 @@ private ListClustersRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListClustersRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListClustersRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListClustersRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable @@ -120,15 +72,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @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/-`.
    +   * 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/-`.
        * 
    * * @@ -149,14 +105,16 @@ public java.lang.String getParent() { 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/-`.
    +   * 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/-`.
        * 
    * * @@ -179,7 +137,10 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** * * @@ -203,6 +164,7 @@ public java.lang.String getPageToken() { return s; } } + /** * * @@ -241,13 +203,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -256,13 +218,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -280,7 +242,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -295,7 +257,7 @@ public int hashCode() { hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -337,38 +299,38 @@ public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( public static com.google.bigtable.admin.v2.ListClustersRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -391,10 +353,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -404,7 +367,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.ListClustersRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -414,7 +377,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListClustersRequest_fieldAccessorTable @@ -424,26 +387,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ListClustersRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - pageToken_ = ""; - return this; } @@ -471,43 +426,21 @@ public com.google.bigtable.admin.v2.ListClustersRequest build() { public com.google.bigtable.admin.v2.ListClustersRequest buildPartial() { com.google.bigtable.admin.v2.ListClustersRequest result = new com.google.bigtable.admin.v2.ListClustersRequest(this); - result.parent_ = parent_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -525,13 +458,15 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListClustersRequest other) 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -546,29 +481,59 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ListClustersRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.ListClustersRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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/-`.
    +     * 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/-`.
          * 
    * * @@ -588,14 +553,16 @@ public java.lang.String getParent() { 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/-`.
    +     * 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/-`.
          * 
    * * @@ -615,14 +582,16 @@ public com.google.protobuf.ByteString getParentBytes() { 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/-`.
    +     * 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/-`.
          * 
    * * @@ -636,19 +605,21 @@ 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/-`.
    +     * 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/-`.
          * 
    * * @@ -658,19 +629,21 @@ public Builder setParent(java.lang.String value) { * @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/-`.
    +     * 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/-`.
          * 
    * * @@ -685,13 +658,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object pageToken_ = ""; + /** * * @@ -714,6 +688,7 @@ public java.lang.String getPageToken() { return (java.lang.String) ref; } } + /** * * @@ -736,6 +711,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -752,11 +728,12 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -769,11 +746,12 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -791,23 +769,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListClustersRequest) } @@ -829,7 +796,18 @@ public ListClustersRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListClustersRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java index 897c16d1c5..799caf000b 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,10 +30,11 @@ public interface ListClustersRequestOrBuilder * * *
    -   * 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/-`.
    +   * 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/-`.
        * 
    * * @@ -40,14 +44,16 @@ public interface ListClustersRequestOrBuilder * @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/-`.
    +   * 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/-`.
        * 
    * * @@ -70,6 +76,7 @@ public interface ListClustersRequestOrBuilder * @return The pageToken. */ java.lang.String getPageToken(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java index b3a4623430..e18d241018 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,112 +29,41 @@ * * Protobuf type {@code google.bigtable.admin.v2.ListClustersResponse} */ -public final class ListClustersResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListClustersResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ListClustersResponse() { clusters_ = java.util.Collections.emptyList(); - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); nextPageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListClustersResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListClustersResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - clusters_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - clusters_.add( - input.readMessage( - com.google.bigtable.admin.v2.Cluster.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - failedLocations_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - failedLocations_.add(s); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - clusters_ = java.util.Collections.unmodifiableList(clusters_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - failedLocations_ = failedLocations_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable @@ -142,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List clusters_; + /** * * @@ -156,6 +90,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getClustersList() { return clusters_; } + /** * * @@ -170,6 +105,7 @@ public java.util.List getClustersList() { getClustersOrBuilderList() { return clusters_; } + /** * * @@ -183,6 +119,7 @@ public java.util.List getClustersList() { public int getClustersCount() { return clusters_.size(); } + /** * * @@ -196,6 +133,7 @@ public int getClustersCount() { public com.google.bigtable.admin.v2.Cluster getClusters(int index) { return clusters_.get(index); } + /** * * @@ -211,7 +149,11 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int in } public static final int FAILED_LOCATIONS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList failedLocations_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -230,6 +172,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int in public com.google.protobuf.ProtocolStringList getFailedLocationsList() { return failedLocations_; } + /** * * @@ -248,6 +191,7 @@ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { public int getFailedLocationsCount() { return failedLocations_.size(); } + /** * * @@ -267,6 +211,7 @@ public int getFailedLocationsCount() { public java.lang.String getFailedLocations(int index) { return failedLocations_.get(index); } + /** * * @@ -288,7 +233,10 @@ public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object nextPageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** * * @@ -312,6 +260,7 @@ public java.lang.String getNextPageToken() { return s; } } + /** * * @@ -354,12 +303,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage(1, clusters_.get(i)); } for (int i = 0; i < failedLocations_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, failedLocations_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, failedLocations_.getRaw(i)); } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -379,10 +328,10 @@ public int getSerializedSize() { size += dataSize; size += 1 * getFailedLocationsList().size(); } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -401,7 +350,7 @@ public boolean equals(final java.lang.Object obj) { if (!getClustersList().equals(other.getClustersList())) return false; if (!getFailedLocationsList().equals(other.getFailedLocationsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -422,7 +371,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -464,38 +413,38 @@ public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( public static com.google.bigtable.admin.v2.ListClustersResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -518,10 +467,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -531,7 +481,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.ListClustersResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -541,7 +491,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListClustersResponse_fieldAccessorTable @@ -551,34 +501,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ListClustersResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getClustersFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (clustersBuilder_ == null) { clusters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + clusters_ = null; clustersBuilder_.clear(); } - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); nextPageToken_ = ""; - return this; } @@ -606,7 +547,16 @@ public com.google.bigtable.admin.v2.ListClustersResponse build() { public com.google.bigtable.admin.v2.ListClustersResponse buildPartial() { com.google.bigtable.admin.v2.ListClustersResponse result = new com.google.bigtable.admin.v2.ListClustersResponse(this); - int from_bitField0_ = bitField0_; + 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_); @@ -616,47 +566,17 @@ public com.google.bigtable.admin.v2.ListClustersResponse buildPartial() { } else { result.clusters_ = clustersBuilder_.build(); } - if (((bitField0_ & 0x00000002) != 0)) { - failedLocations_ = failedLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.failedLocations_ = failedLocations_; - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -691,8 +611,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListClustersResponse other clusters_ = other.clusters_; bitField0_ = (bitField0_ & ~0x00000001); clustersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getClustersFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetClustersFieldBuilder() : null; } else { clustersBuilder_.addAllMessages(other.clusters_); @@ -702,7 +622,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListClustersResponse other if (!other.failedLocations_.isEmpty()) { if (failedLocations_.isEmpty()) { failedLocations_ = other.failedLocations_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000002; } else { ensureFailedLocationsIsMutable(); failedLocations_.addAll(other.failedLocations_); @@ -711,9 +631,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListClustersResponse other } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000004; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -728,18 +649,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ListClustersResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.ListClustersResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -755,7 +715,7 @@ private void ensureClustersIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder> @@ -777,6 +737,7 @@ public java.util.List getClustersList() { return clustersBuilder_.getMessageList(); } } + /** * * @@ -793,6 +754,7 @@ public int getClustersCount() { return clustersBuilder_.getCount(); } } + /** * * @@ -809,6 +771,7 @@ public com.google.bigtable.admin.v2.Cluster getClusters(int index) { return clustersBuilder_.getMessage(index); } } + /** * * @@ -831,6 +794,7 @@ public Builder setClusters(int index, com.google.bigtable.admin.v2.Cluster value } return this; } + /** * * @@ -851,6 +815,7 @@ public Builder setClusters( } return this; } + /** * * @@ -873,6 +838,7 @@ public Builder addClusters(com.google.bigtable.admin.v2.Cluster value) { } return this; } + /** * * @@ -895,6 +861,7 @@ public Builder addClusters(int index, com.google.bigtable.admin.v2.Cluster value } return this; } + /** * * @@ -914,6 +881,7 @@ public Builder addClusters(com.google.bigtable.admin.v2.Cluster.Builder builderF } return this; } + /** * * @@ -934,6 +902,7 @@ public Builder addClusters( } return this; } + /** * * @@ -954,6 +923,7 @@ public Builder addAllClusters( } return this; } + /** * * @@ -973,6 +943,7 @@ public Builder clearClusters() { } return this; } + /** * * @@ -992,6 +963,7 @@ public Builder removeClusters(int index) { } return this; } + /** * * @@ -1002,8 +974,9 @@ public Builder removeClusters(int index) { * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ public com.google.bigtable.admin.v2.Cluster.Builder getClustersBuilder(int index) { - return getClustersFieldBuilder().getBuilder(index); + return internalGetClustersFieldBuilder().getBuilder(index); } + /** * * @@ -1020,6 +993,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int in return clustersBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1037,6 +1011,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int in return java.util.Collections.unmodifiableList(clusters_); } } + /** * * @@ -1047,9 +1022,10 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder(int in * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ public com.google.bigtable.admin.v2.Cluster.Builder addClustersBuilder() { - return getClustersFieldBuilder() + return internalGetClustersFieldBuilder() .addBuilder(com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); } + /** * * @@ -1060,9 +1036,10 @@ public com.google.bigtable.admin.v2.Cluster.Builder addClustersBuilder() { * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ public com.google.bigtable.admin.v2.Cluster.Builder addClustersBuilder(int index) { - return getClustersFieldBuilder() + return internalGetClustersFieldBuilder() .addBuilder(index, com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); } + /** * * @@ -1073,17 +1050,17 @@ public com.google.bigtable.admin.v2.Cluster.Builder addClustersBuilder(int index * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ public java.util.List getClustersBuilderList() { - return getClustersFieldBuilder().getBuilderList(); + return internalGetClustersFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder> - getClustersFieldBuilder() { + internalGetClustersFieldBuilder() { if (clustersBuilder_ == null) { clustersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder>( @@ -1093,15 +1070,16 @@ public java.util.List getClustersB return clustersBuilder_; } - private com.google.protobuf.LazyStringList failedLocations_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureFailedLocationsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!failedLocations_.isModifiable()) { failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000002; } + /** * * @@ -1118,8 +1096,10 @@ private void ensureFailedLocationsIsMutable() { * @return A list containing the failedLocations. */ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { - return failedLocations_.getUnmodifiableView(); + failedLocations_.makeImmutable(); + return failedLocations_; } + /** * * @@ -1138,6 +1118,7 @@ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { public int getFailedLocationsCount() { return failedLocations_.size(); } + /** * * @@ -1157,6 +1138,7 @@ public int getFailedLocationsCount() { public java.lang.String getFailedLocations(int index) { return failedLocations_.get(index); } + /** * * @@ -1176,6 +1158,7 @@ public java.lang.String getFailedLocations(int index) { public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { return failedLocations_.getByteString(index); } + /** * * @@ -1199,9 +1182,11 @@ public Builder setFailedLocations(int index, java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1224,9 +1209,11 @@ public Builder addFailedLocations(java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1246,9 +1233,11 @@ public Builder addFailedLocations(java.lang.String value) { public Builder addAllFailedLocations(java.lang.Iterable values) { ensureFailedLocationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedLocations_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1265,11 +1254,13 @@ public Builder addAllFailedLocations(java.lang.Iterable values * @return This builder for chaining. */ public Builder clearFailedLocations() { - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -1293,11 +1284,13 @@ public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object nextPageToken_ = ""; + /** * * @@ -1320,6 +1313,7 @@ public java.lang.String getNextPageToken() { return (java.lang.String) ref; } } + /** * * @@ -1342,6 +1336,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1358,11 +1353,12 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1375,11 +1371,12 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1397,23 +1394,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListClustersResponse) } @@ -1435,7 +1421,18 @@ public ListClustersResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListClustersResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java index 9ca59de913..92eeb65c41 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -33,6 +36,7 @@ public interface ListClustersResponseOrBuilder * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ java.util.List getClustersList(); + /** * * @@ -43,6 +47,7 @@ public interface ListClustersResponseOrBuilder * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ com.google.bigtable.admin.v2.Cluster getClusters(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListClustersResponseOrBuilder * repeated .google.bigtable.admin.v2.Cluster clusters = 1; */ int getClustersCount(); + /** * * @@ -64,6 +70,7 @@ public interface ListClustersResponseOrBuilder */ java.util.List getClustersOrBuilderList(); + /** * * @@ -91,6 +98,7 @@ public interface ListClustersResponseOrBuilder * @return A list containing the failedLocations. */ java.util.List getFailedLocationsList(); + /** * * @@ -107,6 +115,7 @@ public interface ListClustersResponseOrBuilder * @return The count of failedLocations. */ int getFailedLocationsCount(); + /** * * @@ -124,6 +133,7 @@ public interface ListClustersResponseOrBuilder * @return The failedLocations at the given index. */ java.lang.String getFailedLocations(int index); + /** * * @@ -154,6 +164,7 @@ public interface ListClustersResponseOrBuilder * @return The nextPageToken. */ java.lang.String getNextPageToken(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequest.java new file mode 100644 index 0000000000..bf4757cc61 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequestOrBuilder.java new file mode 100644 index 0000000000..cb49993125 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponse.java new file mode 100644 index 0000000000..d744c8e42a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponseOrBuilder.java new file mode 100644 index 0000000000..f740e4e4ad --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java index 020341106c..13657d6edd 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.ListInstancesRequest} */ -public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListInstancesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,75 +56,13 @@ private ListInstancesRequest() { pageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListInstancesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListInstancesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListInstancesRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable @@ -120,13 +72,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @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}`.
    +   * Required. The unique name of the project for which a list of instances is
    +   * requested. Values are of the form `projects/{project}`.
        * 
    * * @@ -147,12 +102,13 @@ public java.lang.String getParent() { return s; } } + /** * * *
    -   * Required. The unique name of the project for which a list of instances is requested.
    -   * Values are of the form `projects/{project}`.
    +   * Required. The unique name of the project for which a list of instances is
    +   * requested. Values are of the form `projects/{project}`.
        * 
    * * @@ -175,7 +131,10 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object pageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** * * @@ -199,6 +158,7 @@ public java.lang.String getPageToken() { return s; } } + /** * * @@ -237,13 +197,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -252,13 +212,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -276,7 +236,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParent().equals(other.getParent())) return false; if (!getPageToken().equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -291,7 +251,7 @@ public int hashCode() { hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -333,38 +293,38 @@ public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( public static com.google.bigtable.admin.v2.ListInstancesRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -387,10 +347,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -400,7 +361,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.ListInstancesRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -410,7 +371,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListInstancesRequest_fieldAccessorTable @@ -420,26 +381,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ListInstancesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - pageToken_ = ""; - return this; } @@ -467,43 +420,21 @@ public com.google.bigtable.admin.v2.ListInstancesRequest build() { public com.google.bigtable.admin.v2.ListInstancesRequest buildPartial() { com.google.bigtable.admin.v2.ListInstancesRequest result = new com.google.bigtable.admin.v2.ListInstancesRequest(this); - result.parent_ = parent_; - result.pageToken_ = pageToken_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -521,13 +452,15 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListInstancesRequest other 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -542,28 +475,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ListInstancesRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.ListInstancesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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}`.
    +     * Required. The unique name of the project for which a list of instances is
    +     * requested. Values are of the form `projects/{project}`.
          * 
    * * @@ -583,12 +544,13 @@ public java.lang.String getParent() { 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}`.
    +     * Required. The unique name of the project for which a list of instances is
    +     * requested. Values are of the form `projects/{project}`.
          * 
    * * @@ -608,12 +570,13 @@ public com.google.protobuf.ByteString getParentBytes() { 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}`.
    +     * Required. The unique name of the project for which a list of instances is
    +     * requested. Values are of the form `projects/{project}`.
          * 
    * * @@ -627,17 +590,18 @@ 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}`.
    +     * Required. The unique name of the project for which a list of instances is
    +     * requested. Values are of the form `projects/{project}`.
          * 
    * * @@ -647,17 +611,18 @@ public Builder setParent(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the project for which a list of instances is
    +     * requested. Values are of the form `projects/{project}`.
          * 
    * * @@ -672,13 +637,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object pageToken_ = ""; + /** * * @@ -701,6 +667,7 @@ public java.lang.String getPageToken() { return (java.lang.String) ref; } } + /** * * @@ -723,6 +690,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -739,11 +707,12 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -756,11 +725,12 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -778,23 +748,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListInstancesRequest) } @@ -816,7 +775,18 @@ public ListInstancesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListInstancesRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java index c6646d25d2..4b32b5b837 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,8 +30,8 @@ public interface ListInstancesRequestOrBuilder * * *
    -   * Required. The unique name of the project for which a list of instances is requested.
    -   * Values are of the form `projects/{project}`.
    +   * Required. The unique name of the project for which a list of instances is
    +   * requested. Values are of the form `projects/{project}`.
        * 
    * * @@ -38,12 +41,13 @@ public interface ListInstancesRequestOrBuilder * @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}`.
    +   * Required. The unique name of the project for which a list of instances is
    +   * requested. Values are of the form `projects/{project}`.
        * 
    * * @@ -66,6 +70,7 @@ public interface ListInstancesRequestOrBuilder * @return The pageToken. */ java.lang.String getPageToken(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java index df97139dc7..fdf318bf9b 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,112 +29,41 @@ * * Protobuf type {@code google.bigtable.admin.v2.ListInstancesResponse} */ -public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ListInstancesResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ListInstancesResponse() { instances_ = java.util.Collections.emptyList(); - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); nextPageToken_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ListInstancesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ListInstancesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - instances_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - instances_.add( - input.readMessage( - com.google.bigtable.admin.v2.Instance.parser(), extensionRegistry)); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - failedLocations_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - failedLocations_.add(s); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - instances_ = java.util.Collections.unmodifiableList(instances_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - failedLocations_ = failedLocations_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable @@ -142,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List instances_; + /** * * @@ -156,6 +90,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getInstancesList() { return instances_; } + /** * * @@ -170,6 +105,7 @@ public java.util.List getInstancesList() getInstancesOrBuilderList() { return instances_; } + /** * * @@ -183,6 +119,7 @@ public java.util.List getInstancesList() public int getInstancesCount() { return instances_.size(); } + /** * * @@ -196,6 +133,7 @@ public int getInstancesCount() { public com.google.bigtable.admin.v2.Instance getInstances(int index) { return instances_.get(index); } + /** * * @@ -211,7 +149,11 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int } public static final int FAILED_LOCATIONS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList failedLocations_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -231,6 +173,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int public com.google.protobuf.ProtocolStringList getFailedLocationsList() { return failedLocations_; } + /** * * @@ -250,6 +193,7 @@ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { public int getFailedLocationsCount() { return failedLocations_.size(); } + /** * * @@ -270,6 +214,7 @@ public int getFailedLocationsCount() { public java.lang.String getFailedLocations(int index) { return failedLocations_.get(index); } + /** * * @@ -292,7 +237,10 @@ public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { } public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object nextPageToken_; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** * * @@ -316,6 +264,7 @@ public java.lang.String getNextPageToken() { return s; } } + /** * * @@ -358,12 +307,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage(1, instances_.get(i)); } for (int i = 0; i < failedLocations_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, failedLocations_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 2, failedLocations_.getRaw(i)); } - if (!getNextPageTokenBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -383,10 +332,10 @@ public int getSerializedSize() { size += dataSize; size += 1 * getFailedLocationsList().size(); } - if (!getNextPageTokenBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -405,7 +354,7 @@ public boolean equals(final java.lang.Object obj) { if (!getInstancesList().equals(other.getInstancesList())) return false; if (!getFailedLocationsList().equals(other.getFailedLocationsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -426,7 +375,7 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -468,38 +417,38 @@ public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( public static com.google.bigtable.admin.v2.ListInstancesResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -522,10 +471,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -535,7 +485,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.ListInstancesResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -545,7 +495,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_ListInstancesResponse_fieldAccessorTable @@ -555,34 +505,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ListInstancesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getInstancesFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (instancesBuilder_ == null) { instances_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + instances_ = null; instancesBuilder_.clear(); } - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); nextPageToken_ = ""; - return this; } @@ -610,7 +551,16 @@ public com.google.bigtable.admin.v2.ListInstancesResponse build() { public com.google.bigtable.admin.v2.ListInstancesResponse buildPartial() { com.google.bigtable.admin.v2.ListInstancesResponse result = new com.google.bigtable.admin.v2.ListInstancesResponse(this); - int from_bitField0_ = bitField0_; + 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_); @@ -620,47 +570,17 @@ public com.google.bigtable.admin.v2.ListInstancesResponse buildPartial() { } else { result.instances_ = instancesBuilder_.build(); } - if (((bitField0_ & 0x00000002) != 0)) { - failedLocations_ = failedLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.failedLocations_ = failedLocations_; - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -695,8 +615,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListInstancesResponse othe instances_ = other.instances_; bitField0_ = (bitField0_ & ~0x00000001); instancesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getInstancesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetInstancesFieldBuilder() : null; } else { instancesBuilder_.addAllMessages(other.instances_); @@ -706,7 +626,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListInstancesResponse othe if (!other.failedLocations_.isEmpty()) { if (failedLocations_.isEmpty()) { failedLocations_ = other.failedLocations_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ |= 0x00000002; } else { ensureFailedLocationsIsMutable(); failedLocations_.addAll(other.failedLocations_); @@ -715,9 +635,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListInstancesResponse othe } if (!other.getNextPageToken().isEmpty()) { nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000004; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -732,18 +653,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ListInstancesResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.ListInstancesResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -759,7 +719,7 @@ private void ensureInstancesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder> @@ -781,6 +741,7 @@ public java.util.List getInstancesList() return instancesBuilder_.getMessageList(); } } + /** * * @@ -797,6 +758,7 @@ public int getInstancesCount() { return instancesBuilder_.getCount(); } } + /** * * @@ -813,6 +775,7 @@ public com.google.bigtable.admin.v2.Instance getInstances(int index) { return instancesBuilder_.getMessage(index); } } + /** * * @@ -835,6 +798,7 @@ public Builder setInstances(int index, com.google.bigtable.admin.v2.Instance val } return this; } + /** * * @@ -855,6 +819,7 @@ public Builder setInstances( } return this; } + /** * * @@ -877,6 +842,7 @@ public Builder addInstances(com.google.bigtable.admin.v2.Instance value) { } return this; } + /** * * @@ -899,6 +865,7 @@ public Builder addInstances(int index, com.google.bigtable.admin.v2.Instance val } return this; } + /** * * @@ -918,6 +885,7 @@ public Builder addInstances(com.google.bigtable.admin.v2.Instance.Builder builde } return this; } + /** * * @@ -938,6 +906,7 @@ public Builder addInstances( } return this; } + /** * * @@ -958,6 +927,7 @@ public Builder addAllInstances( } return this; } + /** * * @@ -977,6 +947,7 @@ public Builder clearInstances() { } return this; } + /** * * @@ -996,6 +967,7 @@ public Builder removeInstances(int index) { } return this; } + /** * * @@ -1006,8 +978,9 @@ public Builder removeInstances(int index) { * repeated .google.bigtable.admin.v2.Instance instances = 1; */ public com.google.bigtable.admin.v2.Instance.Builder getInstancesBuilder(int index) { - return getInstancesFieldBuilder().getBuilder(index); + return internalGetInstancesFieldBuilder().getBuilder(index); } + /** * * @@ -1024,6 +997,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int return instancesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1041,6 +1015,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int return java.util.Collections.unmodifiableList(instances_); } } + /** * * @@ -1051,9 +1026,10 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder(int * repeated .google.bigtable.admin.v2.Instance instances = 1; */ public com.google.bigtable.admin.v2.Instance.Builder addInstancesBuilder() { - return getInstancesFieldBuilder() + return internalGetInstancesFieldBuilder() .addBuilder(com.google.bigtable.admin.v2.Instance.getDefaultInstance()); } + /** * * @@ -1064,9 +1040,10 @@ public com.google.bigtable.admin.v2.Instance.Builder addInstancesBuilder() { * repeated .google.bigtable.admin.v2.Instance instances = 1; */ public com.google.bigtable.admin.v2.Instance.Builder addInstancesBuilder(int index) { - return getInstancesFieldBuilder() + return internalGetInstancesFieldBuilder() .addBuilder(index, com.google.bigtable.admin.v2.Instance.getDefaultInstance()); } + /** * * @@ -1077,17 +1054,17 @@ public com.google.bigtable.admin.v2.Instance.Builder addInstancesBuilder(int ind * repeated .google.bigtable.admin.v2.Instance instances = 1; */ public java.util.List getInstancesBuilderList() { - return getInstancesFieldBuilder().getBuilderList(); + return internalGetInstancesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder> - getInstancesFieldBuilder() { + internalGetInstancesFieldBuilder() { if (instancesBuilder_ == null) { instancesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder>( @@ -1097,15 +1074,16 @@ public java.util.List getInstance return instancesBuilder_; } - private com.google.protobuf.LazyStringList failedLocations_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList failedLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureFailedLocationsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!failedLocations_.isModifiable()) { failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_); - bitField0_ |= 0x00000002; } + bitField0_ |= 0x00000002; } + /** * * @@ -1123,8 +1101,10 @@ private void ensureFailedLocationsIsMutable() { * @return A list containing the failedLocations. */ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { - return failedLocations_.getUnmodifiableView(); + failedLocations_.makeImmutable(); + return failedLocations_; } + /** * * @@ -1144,6 +1124,7 @@ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { public int getFailedLocationsCount() { return failedLocations_.size(); } + /** * * @@ -1164,6 +1145,7 @@ public int getFailedLocationsCount() { public java.lang.String getFailedLocations(int index) { return failedLocations_.get(index); } + /** * * @@ -1184,6 +1166,7 @@ public java.lang.String getFailedLocations(int index) { public com.google.protobuf.ByteString getFailedLocationsBytes(int index) { return failedLocations_.getByteString(index); } + /** * * @@ -1208,9 +1191,11 @@ public Builder setFailedLocations(int index, java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1234,9 +1219,11 @@ public Builder addFailedLocations(java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1257,9 +1244,11 @@ public Builder addFailedLocations(java.lang.String value) { public Builder addAllFailedLocations(java.lang.Iterable values) { ensureFailedLocationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, failedLocations_); + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1277,11 +1266,13 @@ public Builder addAllFailedLocations(java.lang.Iterable values * @return This builder for chaining. */ public Builder clearFailedLocations() { - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + ; onChanged(); return this; } + /** * * @@ -1306,11 +1297,13 @@ public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object nextPageToken_ = ""; + /** * * @@ -1333,6 +1326,7 @@ public java.lang.String getNextPageToken() { return (java.lang.String) ref; } } + /** * * @@ -1355,6 +1349,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1371,11 +1366,12 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1388,11 +1384,12 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1410,23 +1407,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListInstancesResponse) } @@ -1448,7 +1434,18 @@ public ListInstancesResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ListInstancesResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java index 74165dcc31..c8a67d0651 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -33,6 +36,7 @@ public interface ListInstancesResponseOrBuilder * repeated .google.bigtable.admin.v2.Instance instances = 1; */ java.util.List getInstancesList(); + /** * * @@ -43,6 +47,7 @@ public interface ListInstancesResponseOrBuilder * repeated .google.bigtable.admin.v2.Instance instances = 1; */ com.google.bigtable.admin.v2.Instance getInstances(int index); + /** * * @@ -53,6 +58,7 @@ public interface ListInstancesResponseOrBuilder * repeated .google.bigtable.admin.v2.Instance instances = 1; */ int getInstancesCount(); + /** * * @@ -64,6 +70,7 @@ public interface ListInstancesResponseOrBuilder */ java.util.List getInstancesOrBuilderList(); + /** * * @@ -92,6 +99,7 @@ public interface ListInstancesResponseOrBuilder * @return A list containing the failedLocations. */ java.util.List getFailedLocationsList(); + /** * * @@ -109,6 +117,7 @@ public interface ListInstancesResponseOrBuilder * @return The count of failedLocations. */ int getFailedLocationsCount(); + /** * * @@ -127,6 +136,7 @@ public interface ListInstancesResponseOrBuilder * @return The failedLocations at the given index. */ java.lang.String getFailedLocations(int index); + /** * * @@ -158,6 +168,7 @@ public interface ListInstancesResponseOrBuilder * @return The nextPageToken. */ java.lang.String getNextPageToken(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequest.java new file mode 100644 index 0000000000..c7c4459f59 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsRequestOrBuilder.java new file mode 100644 index 0000000000..18b5ea9e7a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponse.java new file mode 100644 index 0000000000..245cf63f2a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListLogicalViewsResponseOrBuilder.java new file mode 100644 index 0000000000..1d8b2d34fb --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequest.java new file mode 100644 index 0000000000..0170c4ba13 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsRequestOrBuilder.java new file mode 100644 index 0000000000..a706c8db7b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponse.java new file mode 100644 index 0000000000..6c36e54251 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListMaterializedViewsResponseOrBuilder.java new file mode 100644 index 0000000000..34bbd2ea0c --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequest.java new file mode 100644 index 0000000000..11fa9c7fbc --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesRequestOrBuilder.java new file mode 100644 index 0000000000..4352f147eb --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponse.java new file mode 100644 index 0000000000..c4c023fbca --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSchemaBundlesResponseOrBuilder.java new file mode 100644 index 0000000000..f7c4cd2d02 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java index 9a34175110..4616321aa3 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -24,6 +26,7 @@ *
      * 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
    @@ -32,13 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsRequest}
      */
    -public final class ListSnapshotsRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private ListSnapshotsRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -47,80 +62,13 @@ private ListSnapshotsRequest() {
         pageToken_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new ListSnapshotsRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private ListSnapshotsRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              parent_ = s;
    -              break;
    -            }
    -          case 16:
    -            {
    -              pageSize_ = input.readInt32();
    -              break;
    -            }
    -          case 26:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              pageToken_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_fieldAccessorTable
    @@ -130,13 +78,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int PARENT_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object parent_;
    +
    +  @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
    +   * 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/-`.
    @@ -160,12 +111,13 @@ public java.lang.String getParent() {
           return s;
         }
       }
    +
       /**
        *
        *
        * 
    -   * Required. The unique name of the cluster for which snapshots should be listed.
    -   * Values are of the form
    +   * 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/-`.
    @@ -191,7 +143,8 @@ public com.google.protobuf.ByteString getParentBytes() {
       }
     
       public static final int PAGE_SIZE_FIELD_NUMBER = 2;
    -  private int pageSize_;
    +  private int pageSize_ = 0;
    +
       /**
        *
        *
    @@ -210,7 +163,10 @@ public int getPageSize() {
       }
     
       public static final int PAGE_TOKEN_FIELD_NUMBER = 3;
    -  private volatile java.lang.Object pageToken_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object pageToken_ = "";
    +
       /**
        *
        *
    @@ -234,6 +190,7 @@ public java.lang.String getPageToken() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -272,16 +229,16 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getParentBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_);
         }
         if (pageSize_ != 0) {
           output.writeInt32(2, pageSize_);
         }
    -    if (!getPageTokenBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -290,16 +247,16 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getParentBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    +    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 (!getPageTokenBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(3, pageToken_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -318,7 +275,7 @@ public boolean equals(final java.lang.Object obj) {
         if (!getParent().equals(other.getParent())) return false;
         if (getPageSize() != other.getPageSize()) return false;
         if (!getPageToken().equals(other.getPageToken())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -335,7 +292,7 @@ public int hashCode() {
         hash = (53 * hash) + getPageSize();
         hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
         hash = (53 * hash) + getPageToken().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -377,38 +334,38 @@ public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.ListSnapshotsRequest parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -431,16 +388,18 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  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
    @@ -449,7 +408,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -459,7 +418,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_ListSnapshotsRequest_fieldAccessorTable
    @@ -469,28 +428,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.ListSnapshotsRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           parent_ = "";
    -
           pageSize_ = 0;
    -
           pageToken_ = "";
    -
           return this;
         }
     
    @@ -518,44 +468,24 @@ public com.google.bigtable.admin.v2.ListSnapshotsRequest build() {
         public com.google.bigtable.admin.v2.ListSnapshotsRequest buildPartial() {
           com.google.bigtable.admin.v2.ListSnapshotsRequest result =
               new com.google.bigtable.admin.v2.ListSnapshotsRequest(this);
    -      result.parent_ = parent_;
    -      result.pageSize_ = pageSize_;
    -      result.pageToken_ = pageToken_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -573,6 +503,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsRequest other
             return this;
           if (!other.getParent().isEmpty()) {
             parent_ = other.parent_;
    +        bitField0_ |= 0x00000001;
             onChanged();
           }
           if (other.getPageSize() != 0) {
    @@ -580,9 +511,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsRequest other
           }
           if (!other.getPageToken().isEmpty()) {
             pageToken_ = other.pageToken_;
    +        bitField0_ |= 0x00000004;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -597,28 +529,62 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.ListSnapshotsRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.ListSnapshotsRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        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
    +     * 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/-`.
    @@ -641,12 +607,13 @@ public java.lang.String getParent() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
          * 
    -     * Required. The unique name of the cluster for which snapshots should be listed.
    -     * Values are of the form
    +     * 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/-`.
    @@ -669,12 +636,13 @@ public com.google.protobuf.ByteString getParentBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
          * 
    -     * Required. The unique name of the cluster for which snapshots should be listed.
    -     * Values are of the form
    +     * 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/-`.
    @@ -691,17 +659,18 @@ 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
    +     * 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/-`.
    @@ -714,17 +683,18 @@ public Builder setParent(java.lang.String value) {
          * @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
    +     * 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/-`.
    @@ -742,13 +712,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
     
         private int pageSize_;
    +
         /**
          *
          *
    @@ -765,6 +736,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
         public int getPageSize() {
           return pageSize_;
         }
    +
         /**
          *
          *
    @@ -781,9 +753,11 @@ public int getPageSize() {
         public Builder setPageSize(int value) {
     
           pageSize_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -797,13 +771,14 @@ public Builder setPageSize(int value) {
          * @return This builder for chaining.
          */
         public Builder clearPageSize() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000002);
           pageSize_ = 0;
           onChanged();
           return this;
         }
     
         private java.lang.Object pageToken_ = "";
    +
         /**
          *
          *
    @@ -826,6 +801,7 @@ public java.lang.String getPageToken() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -848,6 +824,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -864,11 +841,12 @@ public Builder setPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -881,11 +859,12 @@ public Builder setPageToken(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearPageToken() {
    -
           pageToken_ = getDefaultInstance().getPageToken();
    +      bitField0_ = (bitField0_ & ~0x00000004);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -903,23 +882,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListSnapshotsRequest)
       }
     
    @@ -941,7 +909,18 @@ public ListSnapshotsRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new ListSnapshotsRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java
    index 8437c4e8da..611ca5eb27 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -27,8 +30,8 @@ public interface ListSnapshotsRequestOrBuilder
        *
        *
        * 
    -   * Required. The unique name of the cluster for which snapshots should be listed.
    -   * Values are of the form
    +   * 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/-`.
    @@ -41,12 +44,13 @@ public interface ListSnapshotsRequestOrBuilder
        * @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
    +   * 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/-`.
    @@ -86,6 +90,7 @@ public interface ListSnapshotsRequestOrBuilder
        * @return The pageToken.
        */
       java.lang.String getPageToken();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java
    index 555fc82bdb..4fd00db504 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponse.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -24,6 +26,7 @@
      * 
      * 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
    @@ -32,13 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsResponse}
      */
    -public final class ListSnapshotsResponse extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private ListSnapshotsResponse(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -47,83 +62,13 @@ private ListSnapshotsResponse() {
         nextPageToken_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new ListSnapshotsResponse();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private ListSnapshotsResponse(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    int mutable_bitField0_ = 0;
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
    -                snapshots_ = new java.util.ArrayList();
    -                mutable_bitField0_ |= 0x00000001;
    -              }
    -              snapshots_.add(
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.Snapshot.parser(), extensionRegistry));
    -              break;
    -            }
    -          case 18:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              nextPageToken_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      if (((mutable_bitField0_ & 0x00000001) != 0)) {
    -        snapshots_ = java.util.Collections.unmodifiableList(snapshots_);
    -      }
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       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.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_fieldAccessorTable
    @@ -133,7 +78,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int SNAPSHOTS_FIELD_NUMBER = 1;
    +
    +  @SuppressWarnings("serial")
       private java.util.List snapshots_;
    +
       /**
        *
        *
    @@ -147,6 +95,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       public java.util.List getSnapshotsList() {
         return snapshots_;
       }
    +
       /**
        *
        *
    @@ -161,6 +110,7 @@ public java.util.List getSnapshotsList()
           getSnapshotsOrBuilderList() {
         return snapshots_;
       }
    +
       /**
        *
        *
    @@ -174,6 +124,7 @@ public java.util.List getSnapshotsList()
       public int getSnapshotsCount() {
         return snapshots_.size();
       }
    +
       /**
        *
        *
    @@ -187,6 +138,7 @@ public int getSnapshotsCount() {
       public com.google.bigtable.admin.v2.Snapshot getSnapshots(int index) {
         return snapshots_.get(index);
       }
    +
       /**
        *
        *
    @@ -202,7 +154,10 @@ public com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int
       }
     
       public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object nextPageToken_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object nextPageToken_ = "";
    +
       /**
        *
        *
    @@ -228,6 +183,7 @@ public java.lang.String getNextPageToken() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -271,10 +227,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         for (int i = 0; i < snapshots_.size(); i++) {
           output.writeMessage(1, snapshots_.get(i));
         }
    -    if (!getNextPageTokenBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -286,10 +242,10 @@ public int getSerializedSize() {
         for (int i = 0; i < snapshots_.size(); i++) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, snapshots_.get(i));
         }
    -    if (!getNextPageTokenBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -307,7 +263,7 @@ public boolean equals(final java.lang.Object obj) {
     
         if (!getSnapshotsList().equals(other.getSnapshotsList())) return false;
         if (!getNextPageToken().equals(other.getNextPageToken())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -324,7 +280,7 @@ public int hashCode() {
         }
         hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
         hash = (53 * hash) + getNextPageToken().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -366,38 +322,38 @@ public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom(
     
       public static com.google.bigtable.admin.v2.ListSnapshotsResponse parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -420,16 +376,18 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  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
    @@ -438,7 +396,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.ListSnapshotsResponse}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -448,7 +406,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_ListSnapshotsResponse_fieldAccessorTable
    @@ -458,32 +416,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.ListSnapshotsResponse.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    -        getSnapshotsFieldBuilder();
    -      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           if (snapshotsBuilder_ == null) {
             snapshots_ = java.util.Collections.emptyList();
    -        bitField0_ = (bitField0_ & ~0x00000001);
           } else {
    +        snapshots_ = null;
             snapshotsBuilder_.clear();
           }
    +      bitField0_ = (bitField0_ & ~0x00000001);
           nextPageToken_ = "";
    -
           return this;
         }
     
    @@ -511,7 +461,16 @@ public com.google.bigtable.admin.v2.ListSnapshotsResponse build() {
         public com.google.bigtable.admin.v2.ListSnapshotsResponse buildPartial() {
           com.google.bigtable.admin.v2.ListSnapshotsResponse result =
               new com.google.bigtable.admin.v2.ListSnapshotsResponse(this);
    -      int from_bitField0_ = bitField0_;
    +      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_);
    @@ -521,42 +480,13 @@ public com.google.bigtable.admin.v2.ListSnapshotsResponse buildPartial() {
           } else {
             result.snapshots_ = snapshotsBuilder_.build();
           }
    -      result.nextPageToken_ = nextPageToken_;
    -      onBuilt();
    -      return result;
    -    }
    -
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
         }
     
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -591,8 +521,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsResponse othe
                 snapshots_ = other.snapshots_;
                 bitField0_ = (bitField0_ & ~0x00000001);
                 snapshotsBuilder_ =
    -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
    -                    ? getSnapshotsFieldBuilder()
    +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
    +                    ? internalGetSnapshotsFieldBuilder()
                         : null;
               } else {
                 snapshotsBuilder_.addAllMessages(other.snapshots_);
    @@ -601,9 +531,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListSnapshotsResponse othe
           }
           if (!other.getNextPageToken().isEmpty()) {
             nextPageToken_ = other.nextPageToken_;
    +        bitField0_ |= 0x00000002;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -618,18 +549,50 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.ListSnapshotsResponse parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.ListSnapshotsResponse) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    @@ -645,7 +608,7 @@ private void ensureSnapshotsIsMutable() {
           }
         }
     
    -    private com.google.protobuf.RepeatedFieldBuilderV3<
    +    private com.google.protobuf.RepeatedFieldBuilder<
                 com.google.bigtable.admin.v2.Snapshot,
                 com.google.bigtable.admin.v2.Snapshot.Builder,
                 com.google.bigtable.admin.v2.SnapshotOrBuilder>
    @@ -667,6 +630,7 @@ public java.util.List getSnapshotsList()
             return snapshotsBuilder_.getMessageList();
           }
         }
    +
         /**
          *
          *
    @@ -683,6 +647,7 @@ public int getSnapshotsCount() {
             return snapshotsBuilder_.getCount();
           }
         }
    +
         /**
          *
          *
    @@ -699,6 +664,7 @@ public com.google.bigtable.admin.v2.Snapshot getSnapshots(int index) {
             return snapshotsBuilder_.getMessage(index);
           }
         }
    +
         /**
          *
          *
    @@ -721,6 +687,7 @@ public Builder setSnapshots(int index, com.google.bigtable.admin.v2.Snapshot val
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -741,6 +708,7 @@ public Builder setSnapshots(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -763,6 +731,7 @@ public Builder addSnapshots(com.google.bigtable.admin.v2.Snapshot value) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -785,6 +754,7 @@ public Builder addSnapshots(int index, com.google.bigtable.admin.v2.Snapshot val
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -804,6 +774,7 @@ public Builder addSnapshots(com.google.bigtable.admin.v2.Snapshot.Builder builde
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -824,6 +795,7 @@ public Builder addSnapshots(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -844,6 +816,7 @@ public Builder addAllSnapshots(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -863,6 +836,7 @@ public Builder clearSnapshots() {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -882,6 +856,7 @@ public Builder removeSnapshots(int index) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -892,8 +867,9 @@ public Builder removeSnapshots(int index) {
          * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
          */
         public com.google.bigtable.admin.v2.Snapshot.Builder getSnapshotsBuilder(int index) {
    -      return getSnapshotsFieldBuilder().getBuilder(index);
    +      return internalGetSnapshotsFieldBuilder().getBuilder(index);
         }
    +
         /**
          *
          *
    @@ -910,6 +886,7 @@ public com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int
             return snapshotsBuilder_.getMessageOrBuilder(index);
           }
         }
    +
         /**
          *
          *
    @@ -927,6 +904,7 @@ public com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int
             return java.util.Collections.unmodifiableList(snapshots_);
           }
         }
    +
         /**
          *
          *
    @@ -937,9 +915,10 @@ public com.google.bigtable.admin.v2.SnapshotOrBuilder getSnapshotsOrBuilder(int
          * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
          */
         public com.google.bigtable.admin.v2.Snapshot.Builder addSnapshotsBuilder() {
    -      return getSnapshotsFieldBuilder()
    +      return internalGetSnapshotsFieldBuilder()
               .addBuilder(com.google.bigtable.admin.v2.Snapshot.getDefaultInstance());
         }
    +
         /**
          *
          *
    @@ -950,9 +929,10 @@ public com.google.bigtable.admin.v2.Snapshot.Builder addSnapshotsBuilder() {
          * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
          */
         public com.google.bigtable.admin.v2.Snapshot.Builder addSnapshotsBuilder(int index) {
    -      return getSnapshotsFieldBuilder()
    +      return internalGetSnapshotsFieldBuilder()
               .addBuilder(index, com.google.bigtable.admin.v2.Snapshot.getDefaultInstance());
         }
    +
         /**
          *
          *
    @@ -963,17 +943,17 @@ public com.google.bigtable.admin.v2.Snapshot.Builder addSnapshotsBuilder(int ind
          * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
          */
         public java.util.List getSnapshotsBuilderList() {
    -      return getSnapshotsFieldBuilder().getBuilderList();
    +      return internalGetSnapshotsFieldBuilder().getBuilderList();
         }
     
    -    private com.google.protobuf.RepeatedFieldBuilderV3<
    +    private com.google.protobuf.RepeatedFieldBuilder<
                 com.google.bigtable.admin.v2.Snapshot,
                 com.google.bigtable.admin.v2.Snapshot.Builder,
                 com.google.bigtable.admin.v2.SnapshotOrBuilder>
    -        getSnapshotsFieldBuilder() {
    +        internalGetSnapshotsFieldBuilder() {
           if (snapshotsBuilder_ == null) {
             snapshotsBuilder_ =
    -            new com.google.protobuf.RepeatedFieldBuilderV3<
    +            new com.google.protobuf.RepeatedFieldBuilder<
                     com.google.bigtable.admin.v2.Snapshot,
                     com.google.bigtable.admin.v2.Snapshot.Builder,
                     com.google.bigtable.admin.v2.SnapshotOrBuilder>(
    @@ -984,6 +964,7 @@ public java.util.List getSnapshot
         }
     
         private java.lang.Object nextPageToken_ = "";
    +
         /**
          *
          *
    @@ -1008,6 +989,7 @@ public java.lang.String getNextPageToken() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1032,6 +1014,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1050,11 +1033,12 @@ public Builder setNextPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1069,11 +1053,12 @@ public Builder setNextPageToken(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearNextPageToken() {
    -
           nextPageToken_ = getDefaultInstance().getNextPageToken();
    +      bitField0_ = (bitField0_ & ~0x00000002);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1093,23 +1078,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListSnapshotsResponse)
       }
     
    @@ -1131,7 +1105,18 @@ public ListSnapshotsResponse parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new ListSnapshotsResponse(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java
    index d321a94cb6..849c3c6408 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsResponseOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -33,6 +36,7 @@ public interface ListSnapshotsResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
        */
       java.util.List getSnapshotsList();
    +
       /**
        *
        *
    @@ -43,6 +47,7 @@ public interface ListSnapshotsResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
        */
       com.google.bigtable.admin.v2.Snapshot getSnapshots(int index);
    +
       /**
        *
        *
    @@ -53,6 +58,7 @@ public interface ListSnapshotsResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Snapshot snapshots = 1;
        */
       int getSnapshotsCount();
    +
       /**
        *
        *
    @@ -64,6 +70,7 @@ public interface ListSnapshotsResponseOrBuilder
        */
       java.util.List
           getSnapshotsOrBuilderList();
    +
       /**
        *
        *
    @@ -89,6 +96,7 @@ public interface ListSnapshotsResponseOrBuilder
        * @return The nextPageToken.
        */
       java.lang.String getNextPageToken();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java
    index c3681d5a0c..e567a8c1ae 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -28,13 +30,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.ListTablesRequest}
      */
    -public final class ListTablesRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private ListTablesRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -44,87 +58,13 @@ private ListTablesRequest() {
         pageToken_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new ListTablesRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private ListTablesRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              parent_ = s;
    -              break;
    -            }
    -          case 16:
    -            {
    -              int rawValue = input.readEnum();
    -
    -              view_ = rawValue;
    -              break;
    -            }
    -          case 26:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              pageToken_ = s;
    -              break;
    -            }
    -          case 32:
    -            {
    -              pageSize_ = input.readInt32();
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_ListTablesRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_ListTablesRequest_fieldAccessorTable
    @@ -134,13 +74,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int PARENT_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object parent_;
    +
    +  @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}`.
    +   * Required. The unique name of the instance for which tables should be
    +   * listed. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -161,12 +104,13 @@ public java.lang.String getParent() { return s; } } + /** * * *
    -   * Required. The unique name of the instance for which tables should be listed.
    -   * Values are of the form `projects/{project}/instances/{instance}`.
    +   * Required. The unique name of the instance for which tables should be
    +   * listed. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -189,13 +133,14 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int VIEW_FIELD_NUMBER = 2; - private int view_; + private int view_ = 0; + /** * * *
        * The view to be applied to the returned tables' fields.
    -   * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
        * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -206,12 +151,13 @@ public com.google.protobuf.ByteString getParentBytes() { public int getViewValue() { return view_; } + /** * * *
        * The view to be applied to the returned tables' fields.
    -   * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
        * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -220,22 +166,24 @@ public int getViewValue() { */ @java.lang.Override public com.google.bigtable.admin.v2.Table.View getView() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Table.View result = - com.google.bigtable.admin.v2.Table.View.valueOf(view_); + 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_; + 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.
    @@ -251,7 +199,10 @@ public int getPageSize() {
       }
     
       public static final int PAGE_TOKEN_FIELD_NUMBER = 3;
    -  private volatile java.lang.Object pageToken_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object pageToken_ = "";
    +
       /**
        *
        *
    @@ -275,6 +226,7 @@ public java.lang.String getPageToken() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -313,19 +265,19 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (!getParentBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
    +    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 (!getPageTokenBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(pageToken_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 3, pageToken_);
         }
         if (pageSize_ != 0) {
           output.writeInt32(4, pageSize_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -334,19 +286,19 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (!getParentBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
    +    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 (!getPageTokenBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
    +    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 += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -366,7 +318,7 @@ public boolean equals(final java.lang.Object obj) {
         if (view_ != other.view_) return false;
         if (getPageSize() != other.getPageSize()) return false;
         if (!getPageToken().equals(other.getPageToken())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -385,7 +337,7 @@ public int hashCode() {
         hash = (53 * hash) + getPageSize();
         hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER;
         hash = (53 * hash) + getPageToken().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -427,38 +379,38 @@ public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom(
     
       public static com.google.bigtable.admin.v2.ListTablesRequest parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -481,10 +433,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -495,7 +448,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.ListTablesRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -505,7 +458,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_ListTablesRequest_fieldAccessorTable
    @@ -515,30 +468,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.ListTablesRequest.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           parent_ = "";
    -
           view_ = 0;
    -
           pageSize_ = 0;
    -
           pageToken_ = "";
    -
           return this;
         }
     
    @@ -566,45 +509,27 @@ public com.google.bigtable.admin.v2.ListTablesRequest build() {
         public com.google.bigtable.admin.v2.ListTablesRequest buildPartial() {
           com.google.bigtable.admin.v2.ListTablesRequest result =
               new com.google.bigtable.admin.v2.ListTablesRequest(this);
    -      result.parent_ = parent_;
    -      result.view_ = view_;
    -      result.pageSize_ = pageSize_;
    -      result.pageToken_ = pageToken_;
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
    +      }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -621,6 +546,7 @@ 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) {
    @@ -631,9 +557,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesRequest other) {
           }
           if (!other.getPageToken().isEmpty()) {
             pageToken_ = other.pageToken_;
    +        bitField0_ |= 0x00000008;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -648,27 +575,68 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.ListTablesRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.ListTablesRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        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}`.
    +     * Required. The unique name of the instance for which tables should be
    +     * listed. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -688,12 +656,13 @@ public java.lang.String getParent() { 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}`.
    +     * Required. The unique name of the instance for which tables should be
    +     * listed. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -713,12 +682,13 @@ public com.google.protobuf.ByteString getParentBytes() { 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}`.
    +     * Required. The unique name of the instance for which tables should be
    +     * listed. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -732,17 +702,18 @@ 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}`.
    +     * Required. The unique name of the instance for which tables should be
    +     * listed. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -752,17 +723,18 @@ public Builder setParent(java.lang.String value) { * @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}`.
    +     * Required. The unique name of the instance for which tables should be
    +     * listed. Values are of the form `projects/{project}/instances/{instance}`.
          * 
    * * @@ -777,19 +749,20 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { 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.
    -     * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
          * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -800,12 +773,13 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { public int getViewValue() { return view_; } + /** * * *
          * The view to be applied to the returned tables' fields.
    -     * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
          * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -814,17 +788,18 @@ public int getViewValue() { * @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.
    -     * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
          * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -833,17 +808,17 @@ public Builder setViewValue(int value) { */ @java.lang.Override public com.google.bigtable.admin.v2.Table.View getView() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Table.View result = - com.google.bigtable.admin.v2.Table.View.valueOf(view_); + 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.
    -     * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
          * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -855,17 +830,18 @@ 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.
    -     * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +     * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
          * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -873,21 +849,24 @@ public Builder setView(com.google.bigtable.admin.v2.Table.View value) { * @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.
    @@ -901,14 +880,17 @@ public Builder clearView() {
         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.
    @@ -922,17 +904,21 @@ public int getPageSize() {
         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.
    @@ -943,13 +929,14 @@ public Builder setPageSize(int value) {
          * @return This builder for chaining.
          */
         public Builder clearPageSize() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000004);
           pageSize_ = 0;
           onChanged();
           return this;
         }
     
         private java.lang.Object pageToken_ = "";
    +
         /**
          *
          *
    @@ -972,6 +959,7 @@ public java.lang.String getPageToken() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -994,6 +982,7 @@ public com.google.protobuf.ByteString getPageTokenBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1010,11 +999,12 @@ public Builder setPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000008;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1027,11 +1017,12 @@ public Builder setPageToken(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearPageToken() {
    -
           pageToken_ = getDefaultInstance().getPageToken();
    +      bitField0_ = (bitField0_ & ~0x00000008);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1049,23 +1040,12 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000008;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListTablesRequest)
       }
     
    @@ -1087,7 +1067,18 @@ public ListTablesRequest parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new ListTablesRequest(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java
    index 7497be7075..7809366346 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -27,8 +30,8 @@ public interface ListTablesRequestOrBuilder
        *
        *
        * 
    -   * Required. The unique name of the instance for which tables should be listed.
    -   * Values are of the form `projects/{project}/instances/{instance}`.
    +   * Required. The unique name of the instance for which tables should be
    +   * listed. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -38,12 +41,13 @@ public interface ListTablesRequestOrBuilder * @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}`.
    +   * Required. The unique name of the instance for which tables should be
    +   * listed. Values are of the form `projects/{project}/instances/{instance}`.
        * 
    * * @@ -59,7 +63,7 @@ public interface ListTablesRequestOrBuilder * *
        * The view to be applied to the returned tables' fields.
    -   * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
        * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -67,12 +71,13 @@ public interface ListTablesRequestOrBuilder * @return The enum numeric value on the wire for view. */ int getViewValue(); + /** * * *
        * The view to be applied to the returned tables' fields.
    -   * Only NAME_ONLY view (default) and REPLICATION_VIEW are supported.
    +   * NAME_ONLY view (default) and REPLICATION_VIEW are supported.
        * 
    * * .google.bigtable.admin.v2.Table.View view = 2; @@ -86,9 +91,11 @@ public interface ListTablesRequestOrBuilder * *
        * 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.
    @@ -112,6 +119,7 @@ public interface ListTablesRequestOrBuilder
        * @return The pageToken.
        */
       java.lang.String getPageToken();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java
    index 4391d17e08..281d07bc39 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponse.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -28,13 +30,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.ListTablesResponse}
      */
    -public final class ListTablesResponse extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private ListTablesResponse(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -43,83 +57,13 @@ private ListTablesResponse() {
         nextPageToken_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new ListTablesResponse();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private ListTablesResponse(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    int mutable_bitField0_ = 0;
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
    -                tables_ = new java.util.ArrayList();
    -                mutable_bitField0_ |= 0x00000001;
    -              }
    -              tables_.add(
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.Table.parser(), extensionRegistry));
    -              break;
    -            }
    -          case 18:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              nextPageToken_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      if (((mutable_bitField0_ & 0x00000001) != 0)) {
    -        tables_ = java.util.Collections.unmodifiableList(tables_);
    -      }
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       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.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_ListTablesResponse_fieldAccessorTable
    @@ -129,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int TABLES_FIELD_NUMBER = 1;
    +
    +  @SuppressWarnings("serial")
       private java.util.List tables_;
    +
       /**
        *
        *
    @@ -143,6 +90,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       public java.util.List getTablesList() {
         return tables_;
       }
    +
       /**
        *
        *
    @@ -157,6 +105,7 @@ public java.util.List getTablesList() {
           getTablesOrBuilderList() {
         return tables_;
       }
    +
       /**
        *
        *
    @@ -170,6 +119,7 @@ public java.util.List getTablesList() {
       public int getTablesCount() {
         return tables_.size();
       }
    +
       /**
        *
        *
    @@ -183,6 +133,7 @@ public int getTablesCount() {
       public com.google.bigtable.admin.v2.Table getTables(int index) {
         return tables_.get(index);
       }
    +
       /**
        *
        *
    @@ -198,7 +149,10 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index)
       }
     
       public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object nextPageToken_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object nextPageToken_ = "";
    +
       /**
        *
        *
    @@ -224,6 +178,7 @@ public java.lang.String getNextPageToken() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -267,10 +222,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         for (int i = 0; i < tables_.size(); i++) {
           output.writeMessage(1, tables_.get(i));
         }
    -    if (!getNextPageTokenBytes().isEmpty()) {
    -      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) {
    +      com.google.protobuf.GeneratedMessage.writeString(output, 2, nextPageToken_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -282,10 +237,10 @@ public int getSerializedSize() {
         for (int i = 0; i < tables_.size(); i++) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, tables_.get(i));
         }
    -    if (!getNextPageTokenBytes().isEmpty()) {
    -      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
    +    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(nextPageToken_)) {
    +      size += com.google.protobuf.GeneratedMessage.computeStringSize(2, nextPageToken_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -303,7 +258,7 @@ public boolean equals(final java.lang.Object obj) {
     
         if (!getTablesList().equals(other.getTablesList())) return false;
         if (!getNextPageToken().equals(other.getNextPageToken())) return false;
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -320,7 +275,7 @@ public int hashCode() {
         }
         hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER;
         hash = (53 * hash) + getNextPageToken().hashCode();
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -362,38 +317,38 @@ public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom(
     
       public static com.google.bigtable.admin.v2.ListTablesResponse parseFrom(java.io.InputStream input)
           throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -416,10 +371,11 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
         Builder builder = new Builder(parent);
         return builder;
       }
    +
       /**
        *
        *
    @@ -430,7 +386,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.ListTablesResponse}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -440,7 +396,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_ListTablesResponse_fieldAccessorTable
    @@ -450,32 +406,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         // Construct using com.google.bigtable.admin.v2.ListTablesResponse.newBuilder()
    -    private Builder() {
    -      maybeForceBuilderInitialization();
    -    }
    +    private Builder() {}
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
    -      maybeForceBuilderInitialization();
    -    }
    -
    -    private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    -        getTablesFieldBuilder();
    -      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           if (tablesBuilder_ == null) {
             tables_ = java.util.Collections.emptyList();
    -        bitField0_ = (bitField0_ & ~0x00000001);
           } else {
    +        tables_ = null;
             tablesBuilder_.clear();
           }
    +      bitField0_ = (bitField0_ & ~0x00000001);
           nextPageToken_ = "";
    -
           return this;
         }
     
    @@ -503,7 +451,16 @@ public com.google.bigtable.admin.v2.ListTablesResponse build() {
         public com.google.bigtable.admin.v2.ListTablesResponse buildPartial() {
           com.google.bigtable.admin.v2.ListTablesResponse result =
               new com.google.bigtable.admin.v2.ListTablesResponse(this);
    -      int from_bitField0_ = bitField0_;
    +      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_);
    @@ -513,42 +470,13 @@ public com.google.bigtable.admin.v2.ListTablesResponse buildPartial() {
           } else {
             result.tables_ = tablesBuilder_.build();
           }
    -      result.nextPageToken_ = nextPageToken_;
    -      onBuilt();
    -      return result;
    -    }
    -
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
         }
     
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -583,8 +511,8 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesResponse other)
                 tables_ = other.tables_;
                 bitField0_ = (bitField0_ & ~0x00000001);
                 tablesBuilder_ =
    -                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
    -                    ? getTablesFieldBuilder()
    +                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders
    +                    ? internalGetTablesFieldBuilder()
                         : null;
               } else {
                 tablesBuilder_.addAllMessages(other.tables_);
    @@ -593,9 +521,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesResponse other)
           }
           if (!other.getNextPageToken().isEmpty()) {
             nextPageToken_ = other.nextPageToken_;
    +        bitField0_ |= 0x00000002;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -610,17 +539,50 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.ListTablesResponse parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.ListTablesResponse) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    @@ -636,7 +598,7 @@ private void ensureTablesIsMutable() {
           }
         }
     
    -    private com.google.protobuf.RepeatedFieldBuilderV3<
    +    private com.google.protobuf.RepeatedFieldBuilder<
                 com.google.bigtable.admin.v2.Table,
                 com.google.bigtable.admin.v2.Table.Builder,
                 com.google.bigtable.admin.v2.TableOrBuilder>
    @@ -658,6 +620,7 @@ public java.util.List getTablesList() {
             return tablesBuilder_.getMessageList();
           }
         }
    +
         /**
          *
          *
    @@ -674,6 +637,7 @@ public int getTablesCount() {
             return tablesBuilder_.getCount();
           }
         }
    +
         /**
          *
          *
    @@ -690,6 +654,7 @@ public com.google.bigtable.admin.v2.Table getTables(int index) {
             return tablesBuilder_.getMessage(index);
           }
         }
    +
         /**
          *
          *
    @@ -712,6 +677,7 @@ public Builder setTables(int index, com.google.bigtable.admin.v2.Table value) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -732,6 +698,7 @@ public Builder setTables(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -754,6 +721,7 @@ public Builder addTables(com.google.bigtable.admin.v2.Table value) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -776,6 +744,7 @@ public Builder addTables(int index, com.google.bigtable.admin.v2.Table value) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -795,6 +764,7 @@ public Builder addTables(com.google.bigtable.admin.v2.Table.Builder builderForVa
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -815,6 +785,7 @@ public Builder addTables(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -835,6 +806,7 @@ public Builder addAllTables(
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -854,6 +826,7 @@ public Builder clearTables() {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -873,6 +846,7 @@ public Builder removeTables(int index) {
           }
           return this;
         }
    +
         /**
          *
          *
    @@ -883,8 +857,9 @@ public Builder removeTables(int index) {
          * repeated .google.bigtable.admin.v2.Table tables = 1;
          */
         public com.google.bigtable.admin.v2.Table.Builder getTablesBuilder(int index) {
    -      return getTablesFieldBuilder().getBuilder(index);
    +      return internalGetTablesFieldBuilder().getBuilder(index);
         }
    +
         /**
          *
          *
    @@ -901,6 +876,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index)
             return tablesBuilder_.getMessageOrBuilder(index);
           }
         }
    +
         /**
          *
          *
    @@ -918,6 +894,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index)
             return java.util.Collections.unmodifiableList(tables_);
           }
         }
    +
         /**
          *
          *
    @@ -928,9 +905,10 @@ public com.google.bigtable.admin.v2.TableOrBuilder getTablesOrBuilder(int index)
          * repeated .google.bigtable.admin.v2.Table tables = 1;
          */
         public com.google.bigtable.admin.v2.Table.Builder addTablesBuilder() {
    -      return getTablesFieldBuilder()
    +      return internalGetTablesFieldBuilder()
               .addBuilder(com.google.bigtable.admin.v2.Table.getDefaultInstance());
         }
    +
         /**
          *
          *
    @@ -941,9 +919,10 @@ public com.google.bigtable.admin.v2.Table.Builder addTablesBuilder() {
          * repeated .google.bigtable.admin.v2.Table tables = 1;
          */
         public com.google.bigtable.admin.v2.Table.Builder addTablesBuilder(int index) {
    -      return getTablesFieldBuilder()
    +      return internalGetTablesFieldBuilder()
               .addBuilder(index, com.google.bigtable.admin.v2.Table.getDefaultInstance());
         }
    +
         /**
          *
          *
    @@ -954,17 +933,17 @@ public com.google.bigtable.admin.v2.Table.Builder addTablesBuilder(int index) {
          * repeated .google.bigtable.admin.v2.Table tables = 1;
          */
         public java.util.List getTablesBuilderList() {
    -      return getTablesFieldBuilder().getBuilderList();
    +      return internalGetTablesFieldBuilder().getBuilderList();
         }
     
    -    private com.google.protobuf.RepeatedFieldBuilderV3<
    +    private com.google.protobuf.RepeatedFieldBuilder<
                 com.google.bigtable.admin.v2.Table,
                 com.google.bigtable.admin.v2.Table.Builder,
                 com.google.bigtable.admin.v2.TableOrBuilder>
    -        getTablesFieldBuilder() {
    +        internalGetTablesFieldBuilder() {
           if (tablesBuilder_ == null) {
             tablesBuilder_ =
    -            new com.google.protobuf.RepeatedFieldBuilderV3<
    +            new com.google.protobuf.RepeatedFieldBuilder<
                     com.google.bigtable.admin.v2.Table,
                     com.google.bigtable.admin.v2.Table.Builder,
                     com.google.bigtable.admin.v2.TableOrBuilder>(
    @@ -975,6 +954,7 @@ public java.util.List getTablesBuild
         }
     
         private java.lang.Object nextPageToken_ = "";
    +
         /**
          *
          *
    @@ -999,6 +979,7 @@ public java.lang.String getNextPageToken() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1023,6 +1004,7 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1041,11 +1023,12 @@ public Builder setNextPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1060,11 +1043,12 @@ public Builder setNextPageToken(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearNextPageToken() {
    -
           nextPageToken_ = getDefaultInstance().getNextPageToken();
    +      bitField0_ = (bitField0_ & ~0x00000002);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1084,23 +1068,12 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.ListTablesResponse)
       }
     
    @@ -1122,7 +1095,18 @@ public ListTablesResponse parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new ListTablesResponse(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java
    index 476077f165..8e309c305b 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesResponseOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -33,6 +36,7 @@ public interface ListTablesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Table tables = 1;
        */
       java.util.List getTablesList();
    +
       /**
        *
        *
    @@ -43,6 +47,7 @@ public interface ListTablesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Table tables = 1;
        */
       com.google.bigtable.admin.v2.Table getTables(int index);
    +
       /**
        *
        *
    @@ -53,6 +58,7 @@ public interface ListTablesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Table tables = 1;
        */
       int getTablesCount();
    +
       /**
        *
        *
    @@ -63,6 +69,7 @@ public interface ListTablesResponseOrBuilder
        * repeated .google.bigtable.admin.v2.Table tables = 1;
        */
       java.util.List getTablesOrBuilderList();
    +
       /**
        *
        *
    @@ -88,6 +95,7 @@ public interface ListTablesResponseOrBuilder
        * @return The nextPageToken.
        */
       java.lang.String getNextPageToken();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java
    index cbb076aed4..cb19f47946 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LocationName.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -137,7 +137,7 @@ public boolean equals(Object o) {
         if (o == this) {
           return true;
         }
    -    if (o != null || getClass() == o.getClass()) {
    +    if (o != null && getClass() == o.getClass()) {
           LocationName that = ((LocationName) o);
           return Objects.equals(this.project, that.project)
               && Objects.equals(this.location, that.location);
    @@ -181,8 +181,8 @@ public Builder setLocation(String location) {
         }
     
         private Builder(LocationName locationName) {
    -      project = locationName.project;
    -      location = locationName.location;
    +      this.project = locationName.project;
    +      this.location = locationName.location;
         }
     
         public LocationName build() {
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalView.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalView.java
    new file mode 100644
    index 0000000000..dc1f53193f
    --- /dev/null
    +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewName.java new file mode 100644 index 0000000000..6f77ebe815 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/LogicalViewOrBuilder.java new file mode 100644 index 0000000000..1ace53b9bc --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedView.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedView.java new file mode 100644 index 0000000000..87610aa1fb --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewName.java new file mode 100644 index 0000000000..1cc350e40a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/MaterializedViewOrBuilder.java new file mode 100644 index 0000000000..e96881ebd2 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java index 7210f68aca..5ea20e672c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest} */ -public final class ModifyColumnFamiliesRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ModifyColumnFamiliesRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,87 +57,13 @@ private ModifyColumnFamiliesRequest() { modifications_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ModifyColumnFamiliesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ModifyColumnFamiliesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - modifications_ = - new java.util.ArrayList< - com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification>(); - mutable_bitField0_ |= 0x00000001; - } - modifications_.add( - input.readMessage( - com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification - .parser(), - extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - modifications_ = java.util.Collections.unmodifiableList(modifications_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_fieldAccessorTable @@ -149,6 +89,7 @@ public interface ModificationOrBuilder * @return The id. */ java.lang.String getId(); + /** * * @@ -175,6 +116,7 @@ public interface ModificationOrBuilder * @return Whether the create field is set. */ boolean hasCreate(); + /** * * @@ -188,6 +130,7 @@ public interface ModificationOrBuilder * @return The create. */ com.google.bigtable.admin.v2.ColumnFamily getCreate(); + /** * * @@ -213,6 +156,7 @@ public interface ModificationOrBuilder * @return Whether the update field is set. */ boolean hasUpdate(); + /** * * @@ -226,6 +170,7 @@ public interface ModificationOrBuilder * @return The update. */ com.google.bigtable.admin.v2.ColumnFamily getUpdate(); + /** * * @@ -251,6 +196,7 @@ public interface ModificationOrBuilder * @return Whether the drop field is set. */ boolean hasDrop(); + /** * * @@ -265,9 +211,55 @@ public interface ModificationOrBuilder */ boolean getDrop(); - public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.ModCase - getModCase(); + /** + * + * + *
    +     * 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(); } + /** * * @@ -277,13 +269,24 @@ public interface ModificationOrBuilder * * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} */ - public static final class Modification extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private Modification(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -291,106 +294,13 @@ private Modification() { id_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Modification(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Modification( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - id_ = s; - break; - } - case 18: - { - com.google.bigtable.admin.v2.ColumnFamily.Builder subBuilder = null; - if (modCase_ == 2) { - subBuilder = ((com.google.bigtable.admin.v2.ColumnFamily) mod_).toBuilder(); - } - mod_ = - input.readMessage( - com.google.bigtable.admin.v2.ColumnFamily.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.admin.v2.ColumnFamily) mod_); - mod_ = subBuilder.buildPartial(); - } - modCase_ = 2; - break; - } - case 26: - { - com.google.bigtable.admin.v2.ColumnFamily.Builder subBuilder = null; - if (modCase_ == 3) { - subBuilder = ((com.google.bigtable.admin.v2.ColumnFamily) mod_).toBuilder(); - } - mod_ = - input.readMessage( - com.google.bigtable.admin.v2.ColumnFamily.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.admin.v2.ColumnFamily) mod_); - mod_ = subBuilder.buildPartial(); - } - modCase_ = 3; - break; - } - case 32: - { - modCase_ = 4; - mod_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_fieldAccessorTable @@ -399,7 +309,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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 @@ -415,6 +328,7 @@ public enum ModCase 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. @@ -450,7 +364,10 @@ public ModCase getModCase() { } public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; + + @SuppressWarnings("serial") + private volatile java.lang.Object id_ = ""; + /** * * @@ -474,6 +391,7 @@ public java.lang.String getId() { return s; } } + /** * * @@ -499,6 +417,7 @@ public com.google.protobuf.ByteString getIdBytes() { } public static final int CREATE_FIELD_NUMBER = 2; + /** * * @@ -515,6 +434,7 @@ public com.google.protobuf.ByteString getIdBytes() { public boolean hasCreate() { return modCase_ == 2; } + /** * * @@ -534,6 +454,7 @@ public com.google.bigtable.admin.v2.ColumnFamily getCreate() { } return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } + /** * * @@ -553,6 +474,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { } public static final int UPDATE_FIELD_NUMBER = 3; + /** * * @@ -569,6 +491,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { public boolean hasUpdate() { return modCase_ == 3; } + /** * * @@ -588,6 +511,7 @@ public com.google.bigtable.admin.v2.ColumnFamily getUpdate() { } return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } + /** * * @@ -607,6 +531,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { } public static final int DROP_FIELD_NUMBER = 4; + /** * * @@ -623,6 +548,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { public boolean hasDrop() { return modCase_ == 4; } + /** * * @@ -643,6 +569,64 @@ public boolean getDrop() { 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 @@ -657,8 +641,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + 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_); @@ -669,7 +653,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (modCase_ == 4) { output.writeBool(4, (boolean) ((java.lang.Boolean) mod_)); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(6, getUpdateMask()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -678,8 +665,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, id_); } if (modCase_ == 2) { size += @@ -696,7 +683,10 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 4, (boolean) ((java.lang.Boolean) mod_)); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateMask()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -713,6 +703,10 @@ public boolean equals(final java.lang.Object obj) { (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: @@ -727,7 +721,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -740,6 +734,10 @@ public int hashCode() { 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; @@ -756,7 +754,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -798,39 +796,39 @@ public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modificat public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -854,11 +852,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -868,8 +866,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -879,7 +876,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_Modification_fieldAccessorTable @@ -895,20 +892,33 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + 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; @@ -941,62 +951,39 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification bui 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); - result.id_ = id_; - if (modCase_ == 2) { - if (createBuilder_ == null) { - result.mod_ = mod_; - } else { - result.mod_ = createBuilder_.build(); - } - } - if (modCase_ == 3) { - if (updateBuilder_ == null) { - result.mod_ = mod_; - } else { - result.mod_ = updateBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - if (modCase_ == 4) { - result.mod_ = mod_; - } - result.modCase_ = modCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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_; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -1018,8 +1005,12 @@ public Builder mergeFrom( .getDefaultInstance()) return this; if (!other.getId().isEmpty()) { id_ = other.id_; + bitField0_ |= 0x00000001; onChanged(); } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } switch (other.getModCase()) { case CREATE: { @@ -1041,7 +1032,7 @@ public Builder mergeFrom( break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1056,19 +1047,64 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1086,7 +1122,10 @@ public Builder clearMod() { return this; } + private int bitField0_; + private java.lang.Object id_ = ""; + /** * * @@ -1109,6 +1148,7 @@ public java.lang.String getId() { return (java.lang.String) ref; } } + /** * * @@ -1131,6 +1171,7 @@ public com.google.protobuf.ByteString getIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1147,11 +1188,12 @@ public Builder setId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1164,11 +1206,12 @@ public Builder setId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearId() { - id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -1186,17 +1229,18 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -1213,6 +1257,7 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { public boolean hasCreate() { return modCase_ == 2; } + /** * * @@ -1239,6 +1284,7 @@ public com.google.bigtable.admin.v2.ColumnFamily getCreate() { return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } } + /** * * @@ -1262,6 +1308,7 @@ public Builder setCreate(com.google.bigtable.admin.v2.ColumnFamily value) { modCase_ = 2; return this; } + /** * * @@ -1282,6 +1329,7 @@ public Builder setCreate(com.google.bigtable.admin.v2.ColumnFamily.Builder build modCase_ = 2; return this; } + /** * * @@ -1308,12 +1356,14 @@ public Builder mergeCreate(com.google.bigtable.admin.v2.ColumnFamily value) { } else { if (modCase_ == 2) { createBuilder_.mergeFrom(value); + } else { + createBuilder_.setMessage(value); } - createBuilder_.setMessage(value); } modCase_ = 2; return this; } + /** * * @@ -1340,6 +1390,7 @@ public Builder clearCreate() { } return this; } + /** * * @@ -1351,8 +1402,9 @@ public Builder clearCreate() { * .google.bigtable.admin.v2.ColumnFamily create = 2; */ public com.google.bigtable.admin.v2.ColumnFamily.Builder getCreateBuilder() { - return getCreateFieldBuilder().getBuilder(); + return internalGetCreateFieldBuilder().getBuilder(); } + /** * * @@ -1374,6 +1426,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } } + /** * * @@ -1384,17 +1437,17 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { * * .google.bigtable.admin.v2.ColumnFamily create = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.ColumnFamily, com.google.bigtable.admin.v2.ColumnFamily.Builder, com.google.bigtable.admin.v2.ColumnFamilyOrBuilder> - getCreateFieldBuilder() { + internalGetCreateFieldBuilder() { if (createBuilder_ == null) { if (!(modCase_ == 2)) { mod_ = com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } createBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.ColumnFamily, com.google.bigtable.admin.v2.ColumnFamily.Builder, com.google.bigtable.admin.v2.ColumnFamilyOrBuilder>( @@ -1405,15 +1458,15 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { } modCase_ = 2; onChanged(); - ; return createBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -1430,6 +1483,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { public boolean hasUpdate() { return modCase_ == 3; } + /** * * @@ -1456,6 +1510,7 @@ public com.google.bigtable.admin.v2.ColumnFamily getUpdate() { return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } } + /** * * @@ -1479,6 +1534,7 @@ public Builder setUpdate(com.google.bigtable.admin.v2.ColumnFamily value) { modCase_ = 3; return this; } + /** * * @@ -1499,6 +1555,7 @@ public Builder setUpdate(com.google.bigtable.admin.v2.ColumnFamily.Builder build modCase_ = 3; return this; } + /** * * @@ -1525,12 +1582,14 @@ public Builder mergeUpdate(com.google.bigtable.admin.v2.ColumnFamily value) { } else { if (modCase_ == 3) { updateBuilder_.mergeFrom(value); + } else { + updateBuilder_.setMessage(value); } - updateBuilder_.setMessage(value); } modCase_ = 3; return this; } + /** * * @@ -1557,6 +1616,7 @@ public Builder clearUpdate() { } return this; } + /** * * @@ -1568,8 +1628,9 @@ public Builder clearUpdate() { * .google.bigtable.admin.v2.ColumnFamily update = 3; */ public com.google.bigtable.admin.v2.ColumnFamily.Builder getUpdateBuilder() { - return getUpdateFieldBuilder().getBuilder(); + return internalGetUpdateFieldBuilder().getBuilder(); } + /** * * @@ -1591,6 +1652,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { return com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } } + /** * * @@ -1601,17 +1663,17 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { * * .google.bigtable.admin.v2.ColumnFamily update = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.ColumnFamily, com.google.bigtable.admin.v2.ColumnFamily.Builder, com.google.bigtable.admin.v2.ColumnFamilyOrBuilder> - getUpdateFieldBuilder() { + internalGetUpdateFieldBuilder() { if (updateBuilder_ == null) { if (!(modCase_ == 3)) { mod_ = com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance(); } updateBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.ColumnFamily, com.google.bigtable.admin.v2.ColumnFamily.Builder, com.google.bigtable.admin.v2.ColumnFamilyOrBuilder>( @@ -1622,7 +1684,6 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { } modCase_ = 3; onChanged(); - ; return updateBuilder_; } @@ -1641,6 +1702,7 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { public boolean hasDrop() { return modCase_ == 4; } + /** * * @@ -1659,6 +1721,7 @@ public boolean getDrop() { } return false; } + /** * * @@ -1673,11 +1736,13 @@ public boolean getDrop() { * @return This builder for chaining. */ public Builder setDrop(boolean value) { + modCase_ = 4; mod_ = value; onChanged(); return this; } + /** * * @@ -1699,16 +1764,225 @@ public Builder clearDrop() { return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +       * 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) @@ -1735,7 +2009,19 @@ public Modification parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Modification(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1756,7 +2042,10 @@ public com.google.protobuf.Parser getParserForType() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -1784,6 +2073,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -1813,16 +2103,19 @@ public com.google.protobuf.ByteString getNameBytes() { } 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).
    +   * 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).
        * 
    * * @@ -1834,14 +2127,15 @@ public com.google.protobuf.ByteString getNameBytes() { 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).
    +   * 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).
        * 
    * * @@ -1854,14 +2148,15 @@ public com.google.protobuf.ByteString getNameBytes() { 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).
    +   * 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).
        * 
    * * @@ -1872,14 +2167,15 @@ public com.google.protobuf.ByteString getNameBytes() { 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).
    +   * 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).
        * 
    * * @@ -1891,14 +2187,15 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification get 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).
    +   * 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).
        * 
    * * @@ -1911,6 +2208,25 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification get 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 @@ -1925,13 +2241,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + 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)); } - unknownFields.writeTo(output); + if (ignoreWarnings_ != false) { + output.writeBool(3, ignoreWarnings_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1940,13 +2259,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + 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)); } - size += unknownFields.getSerializedSize(); + if (ignoreWarnings_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1964,7 +2286,8 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getModificationsList().equals(other.getModificationsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1981,7 +2304,9 @@ public int hashCode() { hash = (37 * hash) + MODIFICATIONS_FIELD_NUMBER; hash = (53 * hash) + getModificationsList().hashCode(); } - hash = (29 * hash) + unknownFields.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; } @@ -2023,38 +2348,38 @@ public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom public static com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2078,10 +2403,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -2092,7 +2418,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.ModifyColumnFamiliesRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -2102,7 +2428,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_ModifyColumnFamiliesRequest_fieldAccessorTable @@ -2112,32 +2438,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getModificationsFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - if (modificationsBuilder_ == null) { modifications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + modifications_ = null; modificationsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); + ignoreWarnings_ = false; return this; } @@ -2165,52 +2484,35 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest build() { public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest buildPartial() { com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest result = new com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; + 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_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { modifications_ = java.util.Collections.unmodifiableList(modifications_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.modifications_ = modifications_; } else { result.modifications_ = modificationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -2228,13 +2530,14 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ModifyColumnFamiliesReques 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_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureModificationsIsMutable(); modifications_.addAll(other.modifications_); @@ -2247,17 +2550,20 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ModifyColumnFamiliesReques modificationsBuilder_.dispose(); modificationsBuilder_ = null; modifications_ = other.modifications_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); modificationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getModificationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetModificationsFieldBuilder() : null; } else { modificationsBuilder_.addAllMessages(other.modifications_); } } } - this.mergeUnknownFields(other.unknownFields); + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2272,24 +2578,65 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -2316,6 +2663,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -2342,6 +2690,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2362,11 +2711,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -2383,11 +2733,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -2409,8 +2760,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2419,16 +2770,16 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { modifications_ = java.util.Collections.emptyList(); private void ensureModificationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { modifications_ = new java.util.ArrayList< com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification>( modifications_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + 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> @@ -2438,10 +2789,10 @@ private void ensureModificationsIsMutable() { * * *
    -     * 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).
    +     * 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).
          * 
    * * @@ -2456,14 +2807,15 @@ private void ensureModificationsIsMutable() { 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).
    +     * 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).
          * 
    * * @@ -2477,14 +2829,15 @@ public int getModificationsCount() { 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).
    +     * 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).
          * 
    * * @@ -2499,14 +2852,15 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification get 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).
    +     * 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).
          * 
    * * @@ -2527,14 +2881,15 @@ public Builder setModifications( } 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).
    +     * 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).
          * 
    * * @@ -2554,14 +2909,15 @@ public Builder setModifications( } 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).
    +     * 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).
          * 
    * * @@ -2582,14 +2938,15 @@ public Builder addModifications( } 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).
    +     * 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).
          * 
    * * @@ -2610,14 +2967,15 @@ public Builder addModifications( } 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).
    +     * 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).
          * 
    * * @@ -2636,14 +2994,15 @@ public Builder addModifications( } 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).
    +     * 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).
          * 
    * * @@ -2663,14 +3022,15 @@ public Builder addModifications( } 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).
    +     * 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).
          * 
    * * @@ -2690,14 +3050,15 @@ public Builder addAllModifications( } 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).
    +     * 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).
          * 
    * * @@ -2707,21 +3068,22 @@ public Builder addAllModifications( public Builder clearModifications() { if (modificationsBuilder_ == null) { modifications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + 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).
    +     * 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).
          * 
    * * @@ -2738,14 +3100,15 @@ public Builder removeModifications(int 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).
    +     * 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).
          * 
    * * @@ -2754,16 +3117,17 @@ public Builder removeModifications(int index) { */ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder getModificationsBuilder(int index) { - return getModificationsFieldBuilder().getBuilder(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).
    +     * 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).
          * 
    * * @@ -2778,14 +3142,15 @@ public Builder removeModifications(int index) { 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).
    +     * 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).
          * 
    * * @@ -2802,14 +3167,15 @@ public Builder removeModifications(int index) { 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).
    +     * 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).
          * 
    * * @@ -2818,19 +3184,20 @@ public Builder removeModifications(int index) { */ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder addModificationsBuilder() { - return getModificationsFieldBuilder() + 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).
    +     * 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).
          * 
    * * @@ -2839,20 +3206,21 @@ public Builder removeModifications(int index) { */ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder addModificationsBuilder(int index) { - return getModificationsFieldBuilder() + 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).
    +     * 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).
          * 
    * * @@ -2862,22 +3230,22 @@ public Builder removeModifications(int index) { public java.util.List< com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification.Builder> getModificationsBuilderList() { - return getModificationsFieldBuilder().getBuilderList(); + return internalGetModificationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + 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> - getModificationsFieldBuilder() { + internalGetModificationsFieldBuilder() { if (modificationsBuilder_ == null) { modificationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + 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_ & 0x00000001) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); modifications_ = null; @@ -2885,15 +3253,60 @@ public Builder removeModifications(int index) { 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 final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public boolean getIgnoreWarnings() { + return ignoreWarnings_; } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -2917,7 +3330,18 @@ public ModifyColumnFamiliesRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ModifyColumnFamiliesRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java index 374bbc2440..c096a2992a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ModifyColumnFamiliesRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -39,6 +42,7 @@ public interface ModifyColumnFamiliesRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,10 +64,10 @@ public interface ModifyColumnFamiliesRequestOrBuilder * * *
    -   * 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).
    +   * 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).
        * 
    * * @@ -72,14 +76,15 @@ public interface ModifyColumnFamiliesRequestOrBuilder */ 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).
    +   * 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).
        * 
    * * @@ -87,14 +92,15 @@ public interface ModifyColumnFamiliesRequestOrBuilder * */ 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).
    +   * 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).
        * 
    * * @@ -102,14 +108,15 @@ public interface ModifyColumnFamiliesRequestOrBuilder * */ 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).
    +   * 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).
        * 
    * * @@ -119,14 +126,15 @@ public interface ModifyColumnFamiliesRequestOrBuilder 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).
    +   * 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).
        * 
    * * @@ -135,4 +143,17 @@ public interface ModifyColumnFamiliesRequestOrBuilder */ 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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java index b8bcf11a6b..36b3af1b9c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgress.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,100 +30,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.OperationProgress} */ -public final class OperationProgress extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use OperationProgress.newBuilder() to construct. - private OperationProgress(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private OperationProgress() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new OperationProgress(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "OperationProgress"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use OperationProgress.newBuilder() to construct. + private OperationProgress(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private OperationProgress( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - progressPercent_ = input.readInt32(); - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private OperationProgress() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.CommonProto @@ -129,7 +60,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.CommonProto .internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable @@ -138,8 +69,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.OperationProgress.Builder.class); } + private int bitField0_; public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; - private int progressPercent_; + private int progressPercent_ = 0; + /** * * @@ -159,6 +92,7 @@ public int getProgressPercent() { public static final int START_TIME_FIELD_NUMBER = 2; private com.google.protobuf.Timestamp startTime_; + /** * * @@ -172,8 +106,9 @@ public int getProgressPercent() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -189,6 +124,7 @@ public boolean hasStartTime() { public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } + /** * * @@ -200,11 +136,12 @@ public com.google.protobuf.Timestamp getStartTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp endTime_; + /** * * @@ -219,8 +156,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -237,6 +175,7 @@ public boolean hasEndTime() { public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } + /** * * @@ -249,7 +188,7 @@ public com.google.protobuf.Timestamp getEndTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { - return getEndTime(); + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } private byte memoizedIsInitialized = -1; @@ -269,13 +208,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (progressPercent_ != 0) { output.writeInt32(1, progressPercent_); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getEndTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -287,13 +226,13 @@ public int getSerializedSize() { if (progressPercent_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, progressPercent_); } - if (startTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); } - if (endTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -318,7 +257,7 @@ public boolean equals(final java.lang.Object obj) { if (hasEndTime()) { if (!getEndTime().equals(other.getEndTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -339,7 +278,7 @@ public int hashCode() { hash = (37 * hash) + END_TIME_FIELD_NUMBER; hash = (53 * hash) + getEndTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -381,38 +320,38 @@ public static com.google.bigtable.admin.v2.OperationProgress parseFrom( public static com.google.bigtable.admin.v2.OperationProgress parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -435,10 +374,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -449,7 +389,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.OperationProgress} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -459,7 +399,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.CommonProto .internal_static_google_bigtable_admin_v2_OperationProgress_fieldAccessorTable @@ -473,30 +413,31 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStartTimeFieldBuilder(); + internalGetEndTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; progressPercent_ = 0; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } return this; @@ -526,52 +467,28 @@ public com.google.bigtable.admin.v2.OperationProgress build() { public com.google.bigtable.admin.v2.OperationProgress buildPartial() { com.google.bigtable.admin.v2.OperationProgress result = new com.google.bigtable.admin.v2.OperationProgress(this); - result.progressPercent_ = progressPercent_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -595,7 +512,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.OperationProgress other) { if (other.hasEndTime()) { mergeEndTime(other.getEndTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -610,21 +527,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.OperationProgress parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.OperationProgress) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private int progressPercent_; + /** * * @@ -641,6 +594,7 @@ public Builder mergeFrom( public int getProgressPercent() { return progressPercent_; } + /** * * @@ -657,9 +611,11 @@ public int getProgressPercent() { public Builder setProgressPercent(int value) { progressPercent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -673,18 +629,19 @@ public Builder setProgressPercent(int value) { * @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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** * * @@ -697,8 +654,9 @@ public Builder clearProgressPercent() { * @return Whether the startTime field is set. */ public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -717,6 +675,7 @@ public com.google.protobuf.Timestamp getStartTime() { return startTimeBuilder_.getMessage(); } } + /** * * @@ -732,13 +691,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -751,13 +711,14 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); - onChanged(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -769,19 +730,23 @@ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } - onChanged(); } else { startTimeBuilder_.mergeFrom(value); } - + if (startTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -792,16 +757,16 @@ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp start_time = 2; */ public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); startTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -812,10 +777,11 @@ public Builder clearStartTime() { * .google.protobuf.Timestamp start_time = 2; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getStartTimeFieldBuilder().getBuilder(); + return internalGetStartTimeFieldBuilder().getBuilder(); } + /** * * @@ -832,6 +798,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } + /** * * @@ -841,14 +808,14 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * * .google.protobuf.Timestamp start_time = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { + internalGetStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -859,11 +826,12 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { } private com.google.protobuf.Timestamp endTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** * * @@ -877,8 +845,9 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { * @return Whether the endTime field is set. */ public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -898,6 +867,7 @@ public com.google.protobuf.Timestamp getEndTime() { return endTimeBuilder_.getMessage(); } } + /** * * @@ -914,13 +884,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -934,13 +905,14 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); - onChanged(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -953,19 +925,23 @@ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } - onChanged(); } else { endTimeBuilder_.mergeFrom(value); } - + if (endTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -977,16 +953,16 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp end_time = 3; */ public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); endTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -998,10 +974,11 @@ public Builder clearEndTime() { * .google.protobuf.Timestamp end_time = 3; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getEndTimeFieldBuilder().getBuilder(); + return internalGetEndTimeFieldBuilder().getBuilder(); } + /** * * @@ -1019,6 +996,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } + /** * * @@ -1029,14 +1007,14 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { * * .google.protobuf.Timestamp end_time = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getEndTimeFieldBuilder() { + internalGetEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1046,17 +1024,6 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTimeBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.OperationProgress) } @@ -1078,7 +1045,18 @@ public OperationProgress parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new OperationProgress(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java index 6b558fc107..1ce9fdfd95 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -49,6 +52,7 @@ public interface OperationProgressOrBuilder * @return Whether the startTime field is set. */ boolean hasStartTime(); + /** * * @@ -61,6 +65,7 @@ public interface OperationProgressOrBuilder * @return The startTime. */ com.google.protobuf.Timestamp getStartTime(); + /** * * @@ -85,6 +90,7 @@ public interface OperationProgressOrBuilder * @return Whether the endTime field is set. */ boolean hasEndTime(); + /** * * @@ -98,6 +104,7 @@ public interface OperationProgressOrBuilder * @return The endTime. */ com.google.protobuf.Timestamp getEndTime(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java index 54dbf0b734..2212e8aaa6 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -30,13 +32,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.OptimizeRestoredTableMetadata} */ -public final class OptimizeRestoredTableMetadata extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private OptimizeRestoredTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,84 +58,13 @@ private OptimizeRestoredTableMetadata() { name_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new OptimizeRestoredTableMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private OptimizeRestoredTableMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - com.google.bigtable.admin.v2.OperationProgress.Builder subBuilder = null; - if (progress_ != null) { - subBuilder = progress_.toBuilder(); - } - progress_ = - input.readMessage( - com.google.bigtable.admin.v2.OperationProgress.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(progress_); - progress_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable @@ -130,8 +73,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.Builder.class); } + private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -155,6 +102,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -181,6 +129,7 @@ public com.google.protobuf.ByteString getNameBytes() { public static final int PROGRESS_FIELD_NUMBER = 2; private com.google.bigtable.admin.v2.OperationProgress progress_; + /** * * @@ -194,8 +143,9 @@ public com.google.protobuf.ByteString getNameBytes() { */ @java.lang.Override public boolean hasProgress() { - return progress_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -213,6 +163,7 @@ public com.google.bigtable.admin.v2.OperationProgress getProgress() { ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() : progress_; } + /** * * @@ -224,7 +175,9 @@ public com.google.bigtable.admin.v2.OperationProgress getProgress() { */ @java.lang.Override public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { - return getProgress(); + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; } private byte memoizedIsInitialized = -1; @@ -241,13 +194,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (progress_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getProgress()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -256,13 +209,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (progress_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgress()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -283,7 +236,7 @@ public boolean equals(final java.lang.Object obj) { if (hasProgress()) { if (!getProgress().equals(other.getProgress())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -300,7 +253,7 @@ public int hashCode() { hash = (37 * hash) + PROGRESS_FIELD_NUMBER; hash = (53 * hash) + getProgress().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -342,38 +295,38 @@ public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFr public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -397,10 +350,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -413,7 +367,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.OptimizeRestoredTableMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -423,7 +377,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable @@ -437,24 +391,25 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetProgressFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - - if (progressBuilder_ == null) { - progress_ = null; - } else { - progress_ = null; + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); progressBuilder_ = null; } return this; @@ -484,47 +439,24 @@ public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata build() { public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata buildPartial() { com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result = new com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(this); - result.name_ = name_; - if (progressBuilder_ == null) { - result.progress_ = progress_; - } else { - result.progress_ = progressBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -542,12 +474,13 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.OptimizeRestoredTableMetad return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (other.hasProgress()) { mergeProgress(other.getProgress()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -562,22 +495,51 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -600,6 +562,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -622,6 +585,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -638,11 +602,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -655,11 +620,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -677,18 +643,19 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.bigtable.admin.v2.OperationProgress progress_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -701,8 +668,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * @return Whether the progress field is set. */ public boolean hasProgress() { - return progressBuilder_ != null || progress_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -723,6 +691,7 @@ public com.google.bigtable.admin.v2.OperationProgress getProgress() { return progressBuilder_.getMessage(); } } + /** * * @@ -738,13 +707,14 @@ public Builder setProgress(com.google.bigtable.admin.v2.OperationProgress value) throw new NullPointerException(); } progress_ = value; - onChanged(); } else { progressBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -758,13 +728,14 @@ public Builder setProgress( com.google.bigtable.admin.v2.OperationProgress.Builder builderForValue) { if (progressBuilder_ == null) { progress_ = builderForValue.build(); - onChanged(); } else { progressBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -776,21 +747,23 @@ public Builder setProgress( */ public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress value) { if (progressBuilder_ == null) { - if (progress_ != null) { - progress_ = - com.google.bigtable.admin.v2.OperationProgress.newBuilder(progress_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && progress_ != null + && progress_ != com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()) { + getProgressBuilder().mergeFrom(value); } else { progress_ = value; } - onChanged(); } else { progressBuilder_.mergeFrom(value); } - + if (progress_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -801,16 +774,16 @@ public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress valu * .google.bigtable.admin.v2.OperationProgress progress = 2; */ public Builder clearProgress() { - if (progressBuilder_ == null) { - progress_ = null; - onChanged(); - } else { - progress_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); progressBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -821,10 +794,11 @@ public Builder clearProgress() { * .google.bigtable.admin.v2.OperationProgress progress = 2; */ public com.google.bigtable.admin.v2.OperationProgress.Builder getProgressBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getProgressFieldBuilder().getBuilder(); + return internalGetProgressFieldBuilder().getBuilder(); } + /** * * @@ -843,6 +817,7 @@ public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuil : progress_; } } + /** * * @@ -852,14 +827,14 @@ public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuil * * .google.bigtable.admin.v2.OperationProgress progress = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.OperationProgress, com.google.bigtable.admin.v2.OperationProgress.Builder, com.google.bigtable.admin.v2.OperationProgressOrBuilder> - getProgressFieldBuilder() { + internalGetProgressFieldBuilder() { if (progressBuilder_ == null) { progressBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.OperationProgress, com.google.bigtable.admin.v2.OperationProgress.Builder, com.google.bigtable.admin.v2.OperationProgressOrBuilder>( @@ -869,17 +844,6 @@ public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuil return progressBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.OptimizeRestoredTableMetadata) } @@ -901,7 +865,18 @@ public OptimizeRestoredTableMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new OptimizeRestoredTableMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java index 3ba07f028d..bddb1ee77d 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface OptimizeRestoredTableMetadataOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,6 +64,7 @@ public interface OptimizeRestoredTableMetadataOrBuilder * @return Whether the progress field is set. */ boolean hasProgress(); + /** * * @@ -72,6 +77,7 @@ public interface OptimizeRestoredTableMetadataOrBuilder * @return The progress. */ com.google.bigtable.admin.v2.OperationProgress getProgress(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadata.java new file mode 100644 index 0000000000..928b10c2c1 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java new file mode 100644 index 0000000000..0d650f5e16 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequest.java new file mode 100644 index 0000000000..61096bc7f0 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java new file mode 100644 index 0000000000..e4fcb7e063 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java index bd7318a6fa..23753169b2 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,96 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateInstanceRequest} */ -public final class PartialUpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use PartialUpdateInstanceRequest.newBuilder() to construct. - private PartialUpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PartialUpdateInstanceRequest() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PartialUpdateInstanceRequest(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "PartialUpdateInstanceRequest"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use PartialUpdateInstanceRequest.newBuilder() to construct. + private PartialUpdateInstanceRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private PartialUpdateInstanceRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.Instance.Builder subBuilder = null; - if (instance_ != null) { - subBuilder = instance_.toBuilder(); - } - instance_ = - input.readMessage( - com.google.bigtable.admin.v2.Instance.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(instance_); - instance_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private PartialUpdateInstanceRequest() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto @@ -124,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable @@ -133,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -150,8 +87,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasInstance() { - return instance_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -171,6 +109,7 @@ public com.google.bigtable.admin.v2.Instance getInstance() { ? com.google.bigtable.admin.v2.Instance.getDefaultInstance() : instance_; } + /** * * @@ -184,11 +123,14 @@ public com.google.bigtable.admin.v2.Instance getInstance() { */ @java.lang.Override public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { - return getInstance(); + 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_; + /** * * @@ -204,8 +146,9 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -223,6 +166,7 @@ public boolean hasUpdateMask() { public com.google.protobuf.FieldMask getUpdateMask() { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } + /** * * @@ -236,7 +180,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { */ @java.lang.Override public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } private byte memoizedIsInitialized = -1; @@ -253,13 +197,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (instance_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getInstance()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -268,13 +212,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (instance_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInstance()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -298,7 +242,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -317,7 +261,7 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -359,38 +303,38 @@ public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFro public static com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -414,10 +358,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -427,7 +372,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.PartialUpdateInstanceRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -437,7 +382,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_fieldAccessorTable @@ -451,28 +396,30 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInstanceFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (instanceBuilder_ == null) { - instance_ = null; - } else { - instance_ = null; + bitField0_ = 0; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); instanceBuilder_ = null; } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } return this; @@ -502,51 +449,25 @@ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest build() { public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest buildPartial() { com.google.bigtable.admin.v2.PartialUpdateInstanceRequest result = new com.google.bigtable.admin.v2.PartialUpdateInstanceRequest(this); - if (instanceBuilder_ == null) { - result.instance_ = instance_; - } else { - result.instance_ = instanceBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -568,7 +489,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.PartialUpdateInstanceReque if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -583,27 +504,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.PartialUpdateInstanceRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.Instance instance_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -618,8 +569,9 @@ public Builder mergeFrom( * @return Whether the instance field is set. */ public boolean hasInstance() { - return instanceBuilder_ != null || instance_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -642,6 +594,7 @@ public com.google.bigtable.admin.v2.Instance getInstance() { return instanceBuilder_.getMessage(); } } + /** * * @@ -659,13 +612,14 @@ public Builder setInstance(com.google.bigtable.admin.v2.Instance value) { throw new NullPointerException(); } instance_ = value; - onChanged(); } else { instanceBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -680,13 +634,14 @@ public Builder setInstance(com.google.bigtable.admin.v2.Instance value) { public Builder setInstance(com.google.bigtable.admin.v2.Instance.Builder builderForValue) { if (instanceBuilder_ == null) { instance_ = builderForValue.build(); - onChanged(); } else { instanceBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -700,21 +655,23 @@ public Builder setInstance(com.google.bigtable.admin.v2.Instance.Builder builder */ public Builder mergeInstance(com.google.bigtable.admin.v2.Instance value) { if (instanceBuilder_ == null) { - if (instance_ != null) { - instance_ = - com.google.bigtable.admin.v2.Instance.newBuilder(instance_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && instance_ != null + && instance_ != com.google.bigtable.admin.v2.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); } else { instance_ = value; } - onChanged(); } else { instanceBuilder_.mergeFrom(value); } - + if (instance_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -727,16 +684,16 @@ public Builder mergeInstance(com.google.bigtable.admin.v2.Instance value) { *
    */ public Builder clearInstance() { - if (instanceBuilder_ == null) { - instance_ = null; - onChanged(); - } else { - instance_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); instanceBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -749,10 +706,11 @@ public Builder clearInstance() { *
    */ public com.google.bigtable.admin.v2.Instance.Builder getInstanceBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getInstanceFieldBuilder().getBuilder(); + return internalGetInstanceFieldBuilder().getBuilder(); } + /** * * @@ -773,6 +731,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { : instance_; } } + /** * * @@ -784,14 +743,14 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { * .google.bigtable.admin.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder> - getInstanceFieldBuilder() { + internalGetInstanceFieldBuilder() { if (instanceBuilder_ == null) { instanceBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance.Builder, com.google.bigtable.admin.v2.InstanceOrBuilder>( @@ -802,11 +761,12 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { } private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** * * @@ -821,8 +781,9 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { * @return Whether the updateMask field is set. */ public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -845,6 +806,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { return updateMaskBuilder_.getMessage(); } } + /** * * @@ -862,13 +824,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -883,13 +846,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { updateMask_ = builderForValue.build(); - onChanged(); } else { updateMaskBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -903,19 +867,23 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); } else { updateMask_ = value; } - onChanged(); } else { updateMaskBuilder_.mergeFrom(value); } - + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -928,16 +896,16 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * */ public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -950,10 +918,11 @@ public Builder clearUpdateMask() { * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); } + /** * * @@ -974,6 +943,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { : updateMask_; } } + /** * * @@ -985,14 +955,14 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { + internalGetUpdateMaskFieldBuilder() { if (updateMaskBuilder_ == null) { updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( @@ -1002,17 +972,6 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return updateMaskBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.PartialUpdateInstanceRequest) } @@ -1034,7 +993,18 @@ public PartialUpdateInstanceRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PartialUpdateInstanceRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java index 3b3bde4012..52250b188a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -37,6 +40,7 @@ public interface PartialUpdateInstanceRequestOrBuilder * @return Whether the instance field is set. */ boolean hasInstance(); + /** * * @@ -51,6 +55,7 @@ public interface PartialUpdateInstanceRequestOrBuilder * @return The instance. */ com.google.bigtable.admin.v2.Instance getInstance(); + /** * * @@ -78,6 +83,7 @@ public interface PartialUpdateInstanceRequestOrBuilder * @return Whether the updateMask field is set. */ boolean hasUpdateMask(); + /** * * @@ -92,6 +98,7 @@ public interface PartialUpdateInstanceRequestOrBuilder * @return The updateMask. */ com.google.protobuf.FieldMask getUpdateMask(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java index 51b646e7e5..b90dd1f26a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,7 +127,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { ProjectName that = ((ProjectName) o); return Objects.equals(this.project, that.project); } @@ -158,7 +158,7 @@ public Builder setProject(String project) { } private Builder(ProjectName projectName) { - project = projectName.project; + this.project = projectName.project; } public ProjectName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchema.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchema.java new file mode 100644 index 0000000000..bdd6976f56 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchemaOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProtoSchemaOrBuilder.java new file mode 100644 index 0000000000..4fed01de13 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java index 8767f18aba..d47d28bedc 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.RestoreInfo} */ -public final class RestoreInfo extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private RestoreInfo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,84 +55,13 @@ private RestoreInfo() { sourceType_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RestoreInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RestoreInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - sourceType_ = rawValue; - break; - } - case 18: - { - com.google.bigtable.admin.v2.BackupInfo.Builder subBuilder = null; - if (sourceInfoCase_ == 2) { - subBuilder = ((com.google.bigtable.admin.v2.BackupInfo) sourceInfo_).toBuilder(); - } - sourceInfo_ = - input.readMessage( - com.google.bigtable.admin.v2.BackupInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); - sourceInfo_ = subBuilder.buildPartial(); - } - sourceInfoCase_ = 2; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable @@ -128,6 +71,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int sourceInfoCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object sourceInfo_; public enum SourceInfoCase @@ -141,6 +86,7 @@ public enum SourceInfoCase 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. @@ -172,7 +118,8 @@ public SourceInfoCase getSourceInfoCase() { } public static final int SOURCE_TYPE_FIELD_NUMBER = 1; - private int sourceType_; + private int sourceType_ = 0; + /** * * @@ -188,6 +135,7 @@ public SourceInfoCase getSourceInfoCase() { public int getSourceTypeValue() { return sourceType_; } + /** * * @@ -201,13 +149,13 @@ public int getSourceTypeValue() { */ @java.lang.Override public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.RestoreSourceType result = - com.google.bigtable.admin.v2.RestoreSourceType.valueOf(sourceType_); + 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; + /** * * @@ -224,6 +172,7 @@ public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { public boolean hasBackupInfo() { return sourceInfoCase_ == 2; } + /** * * @@ -243,6 +192,7 @@ public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { } return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); } + /** * * @@ -283,7 +233,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceInfoCase_ == 2) { output.writeMessage(2, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -302,7 +252,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -326,7 +276,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -347,7 +297,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -389,38 +339,38 @@ public static com.google.bigtable.admin.v2.RestoreInfo parseFrom( public static com.google.bigtable.admin.v2.RestoreInfo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -443,10 +393,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -456,7 +407,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.RestoreInfo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -466,7 +417,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable @@ -476,24 +427,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.RestoreInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; sourceType_ = 0; - + if (backupInfoBuilder_ != null) { + backupInfoBuilder_.clear(); + } sourceInfoCase_ = 0; sourceInfo_ = null; return this; @@ -523,50 +470,27 @@ public com.google.bigtable.admin.v2.RestoreInfo build() { public com.google.bigtable.admin.v2.RestoreInfo buildPartial() { com.google.bigtable.admin.v2.RestoreInfo result = new com.google.bigtable.admin.v2.RestoreInfo(this); - result.sourceType_ = sourceType_; - if (sourceInfoCase_ == 2) { - if (backupInfoBuilder_ == null) { - result.sourceInfo_ = sourceInfo_; - } else { - result.sourceInfo_ = backupInfoBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - result.sourceInfoCase_ = sourceInfoCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + private void buildPartial0(com.google.bigtable.admin.v2.RestoreInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sourceType_ = sourceType_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -595,7 +519,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreInfo other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -610,17 +534,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.RestoreInfo parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.RestoreInfo) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -638,7 +589,10 @@ public Builder clearSourceInfo() { return this; } + private int bitField0_; + private int sourceType_ = 0; + /** * * @@ -654,6 +608,7 @@ public Builder clearSourceInfo() { public int getSourceTypeValue() { return sourceType_; } + /** * * @@ -667,11 +622,12 @@ public int getSourceTypeValue() { * @return This builder for chaining. */ public Builder setSourceTypeValue(int value) { - sourceType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -685,11 +641,11 @@ public Builder setSourceTypeValue(int value) { */ @java.lang.Override public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.RestoreSourceType result = - com.google.bigtable.admin.v2.RestoreSourceType.valueOf(sourceType_); + com.google.bigtable.admin.v2.RestoreSourceType.forNumber(sourceType_); return result == null ? com.google.bigtable.admin.v2.RestoreSourceType.UNRECOGNIZED : result; } + /** * * @@ -706,11 +662,12 @@ public Builder setSourceType(com.google.bigtable.admin.v2.RestoreSourceType valu if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; sourceType_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -723,17 +680,18 @@ public Builder setSourceType(com.google.bigtable.admin.v2.RestoreSourceType valu * @return This builder for chaining. */ public Builder clearSourceType() { - + bitField0_ = (bitField0_ & ~0x00000001); sourceType_ = 0; onChanged(); return this; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -750,6 +708,7 @@ public Builder clearSourceType() { public boolean hasBackupInfo() { return sourceInfoCase_ == 2; } + /** * * @@ -776,6 +735,7 @@ public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); } } + /** * * @@ -799,6 +759,7 @@ public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { sourceInfoCase_ = 2; return this; } + /** * * @@ -819,6 +780,7 @@ public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo.Builder bui sourceInfoCase_ = 2; return this; } + /** * * @@ -845,12 +807,14 @@ public Builder mergeBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { } else { if (sourceInfoCase_ == 2) { backupInfoBuilder_.mergeFrom(value); + } else { + backupInfoBuilder_.setMessage(value); } - backupInfoBuilder_.setMessage(value); } sourceInfoCase_ = 2; return this; } + /** * * @@ -877,6 +841,7 @@ public Builder clearBackupInfo() { } return this; } + /** * * @@ -888,8 +853,9 @@ public Builder clearBackupInfo() { * .google.bigtable.admin.v2.BackupInfo backup_info = 2; */ public com.google.bigtable.admin.v2.BackupInfo.Builder getBackupInfoBuilder() { - return getBackupInfoFieldBuilder().getBuilder(); + return internalGetBackupInfoFieldBuilder().getBuilder(); } + /** * * @@ -911,6 +877,7 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); } } + /** * * @@ -921,17 +888,17 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() * * .google.bigtable.admin.v2.BackupInfo backup_info = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.BackupInfo, com.google.bigtable.admin.v2.BackupInfo.Builder, com.google.bigtable.admin.v2.BackupInfoOrBuilder> - getBackupInfoFieldBuilder() { + internalGetBackupInfoFieldBuilder() { if (backupInfoBuilder_ == null) { if (!(sourceInfoCase_ == 2)) { sourceInfo_ = com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); } backupInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.BackupInfo, com.google.bigtable.admin.v2.BackupInfo.Builder, com.google.bigtable.admin.v2.BackupInfoOrBuilder>( @@ -942,21 +909,9 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() } sourceInfoCase_ = 2; onChanged(); - ; return backupInfoBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.RestoreInfo) } @@ -978,7 +933,18 @@ public RestoreInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RestoreInfo(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java index fdcf4a0c1e..dd83ac54b2 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreInfoOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface RestoreInfoOrBuilder * @return The enum numeric value on the wire for sourceType. */ int getSourceTypeValue(); + /** * * @@ -61,6 +65,7 @@ public interface RestoreInfoOrBuilder * @return Whether the backupInfo field is set. */ boolean hasBackupInfo(); + /** * * @@ -74,6 +79,7 @@ public interface RestoreInfoOrBuilder * @return The backupInfo. */ com.google.bigtable.admin.v2.BackupInfo getBackupInfo(); + /** * * @@ -86,5 +92,5 @@ public interface RestoreInfoOrBuilder */ com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder(); - public com.google.bigtable.admin.v2.RestoreInfo.SourceInfoCase getSourceInfoCase(); + com.google.bigtable.admin.v2.RestoreInfo.SourceInfoCase getSourceInfoCase(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java index 3a3567dc61..3ce2642b54 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreSourceType.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,6 +29,7 @@ * * Protobuf enum {@code google.bigtable.admin.v2.RestoreSourceType} */ +@com.google.protobuf.Generated public enum RestoreSourceType implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -51,6 +54,16 @@ public enum RestoreSourceType implements com.google.protobuf.ProtocolMessageEnum UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RestoreSourceType"); + } + /** * * @@ -61,6 +74,7 @@ public enum RestoreSourceType implements com.google.protobuf.ProtocolMessageEnum * RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; */ public static final int RESTORE_SOURCE_TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -129,7 +143,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto.getDescriptor().getEnumTypes().get(0); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java index 61980e5447..fd48902b00 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.RestoreTableMetadata} */ -public final class RestoreTableMetadata extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private RestoreTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,114 +58,13 @@ private RestoreTableMetadata() { optimizeTableOperationName_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RestoreTableMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RestoreTableMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: - { - int rawValue = input.readEnum(); - - sourceType_ = rawValue; - break; - } - case 26: - { - com.google.bigtable.admin.v2.BackupInfo.Builder subBuilder = null; - if (sourceInfoCase_ == 3) { - subBuilder = ((com.google.bigtable.admin.v2.BackupInfo) sourceInfo_).toBuilder(); - } - sourceInfo_ = - input.readMessage( - com.google.bigtable.admin.v2.BackupInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); - sourceInfo_ = subBuilder.buildPartial(); - } - sourceInfoCase_ = 3; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - optimizeTableOperationName_ = s; - break; - } - case 42: - { - com.google.bigtable.admin.v2.OperationProgress.Builder subBuilder = null; - if (progress_ != null) { - subBuilder = progress_.toBuilder(); - } - progress_ = - input.readMessage( - com.google.bigtable.admin.v2.OperationProgress.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(progress_); - progress_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_fieldAccessorTable @@ -160,7 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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 @@ -174,6 +90,7 @@ public enum SourceInfoCase 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. @@ -205,7 +122,10 @@ public SourceInfoCase getSourceInfoCase() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -229,6 +149,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -254,7 +175,8 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int SOURCE_TYPE_FIELD_NUMBER = 2; - private int sourceType_; + private int sourceType_ = 0; + /** * * @@ -270,6 +192,7 @@ public com.google.protobuf.ByteString getNameBytes() { public int getSourceTypeValue() { return sourceType_; } + /** * * @@ -283,13 +206,13 @@ public int getSourceTypeValue() { */ @java.lang.Override public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.RestoreSourceType result = - com.google.bigtable.admin.v2.RestoreSourceType.valueOf(sourceType_); + 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; * @@ -299,6 +222,7 @@ public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { public boolean hasBackupInfo() { return sourceInfoCase_ == 3; } + /** * .google.bigtable.admin.v2.BackupInfo backup_info = 3; * @@ -311,6 +235,7 @@ public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { } 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() { @@ -321,7 +246,10 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() } public static final int OPTIMIZE_TABLE_OPERATION_NAME_FIELD_NUMBER = 4; - private volatile java.lang.Object optimizeTableOperationName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object optimizeTableOperationName_ = ""; + /** * * @@ -353,6 +281,7 @@ public java.lang.String getOptimizeTableOperationName() { return s; } } + /** * * @@ -387,11 +316,13 @@ public com.google.protobuf.ByteString getOptimizeTableOperationNameBytes() { 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]
    +   * The progress of the
    +   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
        * operation.
        * 
    * @@ -401,13 +332,15 @@ public com.google.protobuf.ByteString getOptimizeTableOperationNameBytes() { */ @java.lang.Override public boolean hasProgress() { - return progress_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * *
    -   * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +   * The progress of the
    +   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
        * operation.
        * 
    * @@ -421,11 +354,13 @@ public com.google.bigtable.admin.v2.OperationProgress getProgress() { ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() : progress_; } + /** * * *
    -   * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +   * The progress of the
    +   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
        * operation.
        * 
    * @@ -433,7 +368,9 @@ public com.google.bigtable.admin.v2.OperationProgress getProgress() { */ @java.lang.Override public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() { - return getProgress(); + return progress_ == null + ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance() + : progress_; } private byte memoizedIsInitialized = -1; @@ -450,8 +387,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + 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 @@ -461,13 +398,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceInfoCase_ == 3) { output.writeMessage(3, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); } - if (!getOptimizeTableOperationNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, optimizeTableOperationName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(optimizeTableOperationName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, optimizeTableOperationName_); } - if (progress_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getProgress()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -476,8 +413,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + 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 @@ -489,14 +426,14 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 3, (com.google.bigtable.admin.v2.BackupInfo) sourceInfo_); } - if (!getOptimizeTableOperationNameBytes().isEmpty()) { + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(optimizeTableOperationName_)) { size += - com.google.protobuf.GeneratedMessageV3.computeStringSize(4, optimizeTableOperationName_); + com.google.protobuf.GeneratedMessage.computeStringSize(4, optimizeTableOperationName_); } - if (progress_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getProgress()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -528,7 +465,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -557,7 +494,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -599,38 +536,38 @@ public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( public static com.google.bigtable.admin.v2.RestoreTableMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -653,10 +590,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -667,7 +605,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.RestoreTableMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -677,7 +615,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_RestoreTableMetadata_fieldAccessorTable @@ -691,28 +629,30 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + 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_ = ""; - - if (progressBuilder_ == null) { - progress_ = null; - } else { - progress_ = null; + progress_ = null; + if (progressBuilder_ != null) { + progressBuilder_.dispose(); progressBuilder_ = null; } sourceInfoCase_ = 0; @@ -744,57 +684,39 @@ public com.google.bigtable.admin.v2.RestoreTableMetadata build() { public com.google.bigtable.admin.v2.RestoreTableMetadata buildPartial() { com.google.bigtable.admin.v2.RestoreTableMetadata result = new com.google.bigtable.admin.v2.RestoreTableMetadata(this); - result.name_ = name_; - result.sourceType_ = sourceType_; - if (sourceInfoCase_ == 3) { - if (backupInfoBuilder_ == null) { - result.sourceInfo_ = sourceInfo_; - } else { - result.sourceInfo_ = backupInfoBuilder_.build(); - } + if (bitField0_ != 0) { + buildPartial0(result); } - result.optimizeTableOperationName_ = optimizeTableOperationName_; - if (progressBuilder_ == null) { - result.progress_ = progress_; - } else { - result.progress_ = progressBuilder_.build(); - } - result.sourceInfoCase_ = sourceInfoCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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_; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -812,6 +734,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableMetadata other return this; if (!other.getName().isEmpty()) { name_ = other.name_; + bitField0_ |= 0x00000001; onChanged(); } if (other.sourceType_ != 0) { @@ -819,6 +742,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableMetadata other } if (!other.getOptimizeTableOperationName().isEmpty()) { optimizeTableOperationName_ = other.optimizeTableOperationName_; + bitField0_ |= 0x00000008; onChanged(); } if (other.hasProgress()) { @@ -835,7 +759,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableMetadata other break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -850,18 +774,63 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.RestoreTableMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.RestoreTableMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -879,7 +848,10 @@ public Builder clearSourceInfo() { return this; } + private int bitField0_; + private java.lang.Object name_ = ""; + /** * * @@ -902,6 +874,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -924,6 +897,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -940,11 +914,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -957,11 +932,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -979,13 +955,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private int sourceType_ = 0; + /** * * @@ -1001,6 +978,7 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { public int getSourceTypeValue() { return sourceType_; } + /** * * @@ -1014,11 +992,12 @@ public int getSourceTypeValue() { * @return This builder for chaining. */ public Builder setSourceTypeValue(int value) { - sourceType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -1032,11 +1011,11 @@ public Builder setSourceTypeValue(int value) { */ @java.lang.Override public com.google.bigtable.admin.v2.RestoreSourceType getSourceType() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.RestoreSourceType result = - com.google.bigtable.admin.v2.RestoreSourceType.valueOf(sourceType_); + com.google.bigtable.admin.v2.RestoreSourceType.forNumber(sourceType_); return result == null ? com.google.bigtable.admin.v2.RestoreSourceType.UNRECOGNIZED : result; } + /** * * @@ -1053,11 +1032,12 @@ public Builder setSourceType(com.google.bigtable.admin.v2.RestoreSourceType valu if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000002; sourceType_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -1070,17 +1050,18 @@ public Builder setSourceType(com.google.bigtable.admin.v2.RestoreSourceType valu * @return This builder for chaining. */ public Builder clearSourceType() { - + bitField0_ = (bitField0_ & ~0x00000002); sourceType_ = 0; onChanged(); return this; } - private com.google.protobuf.SingleFieldBuilderV3< + 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; * @@ -1090,6 +1071,7 @@ public Builder clearSourceType() { public boolean hasBackupInfo() { return sourceInfoCase_ == 3; } + /** * .google.bigtable.admin.v2.BackupInfo backup_info = 3; * @@ -1109,6 +1091,7 @@ public com.google.bigtable.admin.v2.BackupInfo getBackupInfo() { 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) { @@ -1123,6 +1106,7 @@ public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo 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) { @@ -1134,6 +1118,7 @@ public Builder setBackupInfo(com.google.bigtable.admin.v2.BackupInfo.Builder bui 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) { @@ -1151,12 +1136,14 @@ public Builder mergeBackupInfo(com.google.bigtable.admin.v2.BackupInfo value) { } else { if (sourceInfoCase_ == 3) { backupInfoBuilder_.mergeFrom(value); + } else { + backupInfoBuilder_.setMessage(value); } - backupInfoBuilder_.setMessage(value); } sourceInfoCase_ = 3; return this; } + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ public Builder clearBackupInfo() { if (backupInfoBuilder_ == null) { @@ -1174,10 +1161,12 @@ public Builder clearBackupInfo() { } return this; } + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ public com.google.bigtable.admin.v2.BackupInfo.Builder getBackupInfoBuilder() { - return getBackupInfoFieldBuilder().getBuilder(); + return internalGetBackupInfoFieldBuilder().getBuilder(); } + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ @java.lang.Override public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() { @@ -1190,18 +1179,19 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() return com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); } } + /** .google.bigtable.admin.v2.BackupInfo backup_info = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.BackupInfo, com.google.bigtable.admin.v2.BackupInfo.Builder, com.google.bigtable.admin.v2.BackupInfoOrBuilder> - getBackupInfoFieldBuilder() { + internalGetBackupInfoFieldBuilder() { if (backupInfoBuilder_ == null) { if (!(sourceInfoCase_ == 3)) { sourceInfo_ = com.google.bigtable.admin.v2.BackupInfo.getDefaultInstance(); } backupInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.BackupInfo, com.google.bigtable.admin.v2.BackupInfo.Builder, com.google.bigtable.admin.v2.BackupInfoOrBuilder>( @@ -1212,11 +1202,11 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() } sourceInfoCase_ = 3; onChanged(); - ; return backupInfoBuilder_; } private java.lang.Object optimizeTableOperationName_ = ""; + /** * * @@ -1247,6 +1237,7 @@ public java.lang.String getOptimizeTableOperationName() { return (java.lang.String) ref; } } + /** * * @@ -1277,6 +1268,7 @@ public com.google.protobuf.ByteString getOptimizeTableOperationNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1301,11 +1293,12 @@ public Builder setOptimizeTableOperationName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - optimizeTableOperationName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1326,11 +1319,12 @@ public Builder setOptimizeTableOperationName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearOptimizeTableOperationName() { - optimizeTableOperationName_ = getDefaultInstance().getOptimizeTableOperationName(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1356,23 +1350,25 @@ public Builder setOptimizeTableOperationNameBytes(com.google.protobuf.ByteString throw new NullPointerException(); } checkByteStringIsUtf8(value); - optimizeTableOperationName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private com.google.bigtable.admin.v2.OperationProgress progress_; - private com.google.protobuf.SingleFieldBuilderV3< + 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]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1381,13 +1377,15 @@ public Builder setOptimizeTableOperationNameBytes(com.google.protobuf.ByteString * @return Whether the progress field is set. */ public boolean hasProgress() { - return progressBuilder_ != null || progress_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1404,11 +1402,13 @@ public com.google.bigtable.admin.v2.OperationProgress getProgress() { return progressBuilder_.getMessage(); } } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1420,18 +1420,20 @@ public Builder setProgress(com.google.bigtable.admin.v2.OperationProgress value) throw new NullPointerException(); } progress_ = value; - onChanged(); } else { progressBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1441,18 +1443,20 @@ public Builder setProgress( com.google.bigtable.admin.v2.OperationProgress.Builder builderForValue) { if (progressBuilder_ == null) { progress_ = builderForValue.build(); - onChanged(); } else { progressBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1460,62 +1464,68 @@ public Builder setProgress( */ public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress value) { if (progressBuilder_ == null) { - if (progress_ != null) { - progress_ = - com.google.bigtable.admin.v2.OperationProgress.newBuilder(progress_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && progress_ != null + && progress_ != com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()) { + getProgressBuilder().mergeFrom(value); } else { progress_ = value; } - onChanged(); } else { progressBuilder_.mergeFrom(value); } - + if (progress_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * * .google.bigtable.admin.v2.OperationProgress progress = 5; */ public Builder clearProgress() { - if (progressBuilder_ == null) { - progress_ = null; - onChanged(); - } else { - progress_ = null; + 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]
    +     * 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 getProgressFieldBuilder().getBuilder(); + return internalGetProgressFieldBuilder().getBuilder(); } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1530,24 +1540,26 @@ public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuil : progress_; } } + /** * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * * .google.bigtable.admin.v2.OperationProgress progress = 5; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.OperationProgress, com.google.bigtable.admin.v2.OperationProgress.Builder, com.google.bigtable.admin.v2.OperationProgressOrBuilder> - getProgressFieldBuilder() { + internalGetProgressFieldBuilder() { if (progressBuilder_ == null) { progressBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.OperationProgress, com.google.bigtable.admin.v2.OperationProgress.Builder, com.google.bigtable.admin.v2.OperationProgressOrBuilder>( @@ -1557,17 +1569,6 @@ public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuil return progressBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.RestoreTableMetadata) } @@ -1589,7 +1590,18 @@ public RestoreTableMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RestoreTableMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java index 514e02881e..1dde37589c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface RestoreTableMetadataOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -60,6 +64,7 @@ public interface RestoreTableMetadataOrBuilder * @return The enum numeric value on the wire for sourceType. */ int getSourceTypeValue(); + /** * * @@ -79,12 +84,14 @@ public interface RestoreTableMetadataOrBuilder * @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(); @@ -108,6 +115,7 @@ public interface RestoreTableMetadataOrBuilder * @return The optimizeTableOperationName. */ java.lang.String getOptimizeTableOperationName(); + /** * * @@ -133,7 +141,8 @@ public interface RestoreTableMetadataOrBuilder * * *
    -   * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +   * The progress of the
    +   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
        * operation.
        * 
    * @@ -142,11 +151,13 @@ public interface RestoreTableMetadataOrBuilder * @return Whether the progress field is set. */ boolean hasProgress(); + /** * * *
    -   * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +   * The progress of the
    +   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
        * operation.
        * 
    * @@ -155,11 +166,13 @@ public interface RestoreTableMetadataOrBuilder * @return The progress. */ com.google.bigtable.admin.v2.OperationProgress getProgress(); + /** * * *
    -   * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +   * The progress of the
    +   * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
        * operation.
        * 
    * @@ -167,5 +180,5 @@ public interface RestoreTableMetadataOrBuilder */ com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder(); - public com.google.bigtable.admin.v2.RestoreTableMetadata.SourceInfoCase getSourceInfoCase(); + com.google.bigtable.admin.v2.RestoreTableMetadata.SourceInfoCase getSourceInfoCase(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java index 6025af320c..dc3b557a57 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.RestoreTableRequest} */ -public final class RestoreTableRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private RestoreTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,82 +57,13 @@ private RestoreTableRequest() { tableId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RestoreTableRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RestoreTableRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableId_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - sourceCase_ = 3; - source_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_RestoreTableRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_RestoreTableRequest_fieldAccessorTable @@ -128,6 +73,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int sourceCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object source_; public enum SourceCase @@ -141,6 +88,7 @@ public enum SourceCase 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. @@ -172,14 +120,16 @@ public SourceCase getSourceCase() { } public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** * * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be the parent of the source backup. Values are
    -   * of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -200,13 +150,13 @@ public java.lang.String getParent() { return s; } } + /** * * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be the parent of the source backup. Values are
    -   * of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -229,7 +179,10 @@ public com.google.protobuf.ByteString getParentBytes() { } public static final int TABLE_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object tableId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableId_ = ""; + /** * * @@ -256,6 +209,7 @@ public java.lang.String getTableId() { return s; } } + /** * * @@ -284,6 +238,7 @@ public com.google.protobuf.ByteString getTableIdBytes() { } public static final int BACKUP_FIELD_NUMBER = 3; + /** * * @@ -299,6 +254,7 @@ public com.google.protobuf.ByteString getTableIdBytes() { public boolean hasBackup() { return sourceCase_ == 3; } + /** * * @@ -327,6 +283,7 @@ public java.lang.String getBackup() { return s; } } + /** * * @@ -370,16 +327,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getParentBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, parent_); } - if (!getTableIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, tableId_); } if (sourceCase_ == 3) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_); + com.google.protobuf.GeneratedMessage.writeString(output, 3, source_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -388,16 +345,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getParentBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, parent_); } - if (!getTableIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, tableId_); } if (sourceCase_ == 3) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, source_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -423,7 +380,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -446,7 +403,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -488,38 +445,38 @@ public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( public static com.google.bigtable.admin.v2.RestoreTableRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -542,10 +499,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -556,7 +514,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.RestoreTableRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -566,7 +524,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_RestoreTableRequest_fieldAccessorTable @@ -576,26 +534,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.RestoreTableRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; parent_ = ""; - tableId_ = ""; - sourceCase_ = 0; source_ = null; return this; @@ -625,47 +575,27 @@ public com.google.bigtable.admin.v2.RestoreTableRequest build() { public com.google.bigtable.admin.v2.RestoreTableRequest buildPartial() { com.google.bigtable.admin.v2.RestoreTableRequest result = new com.google.bigtable.admin.v2.RestoreTableRequest(this); - result.parent_ = parent_; - result.tableId_ = tableId_; - if (sourceCase_ == 3) { - result.source_ = source_; + if (bitField0_ != 0) { + buildPartial0(result); } - result.sourceCase_ = sourceCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreTableRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; } @java.lang.Override @@ -683,10 +613,12 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableRequest other) 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()) { @@ -702,7 +634,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.RestoreTableRequest other) break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -717,17 +649,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.RestoreTableRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.RestoreTableRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -745,14 +710,16 @@ public Builder clearSource() { return this; } + private int bitField0_; + private java.lang.Object parent_ = ""; + /** * * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be the parent of the source backup. Values are
    -     * of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -772,13 +739,13 @@ public java.lang.String getParent() { return (java.lang.String) ref; } } + /** * * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be the parent of the source backup. Values are
    -     * of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -798,13 +765,13 @@ public com.google.protobuf.ByteString getParentBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be the parent of the source backup. Values are
    -     * of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -818,18 +785,18 @@ 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. This instance must be the parent of the source backup. Values are
    -     * of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -839,18 +806,18 @@ public Builder setParent(java.lang.String value) { * @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. This instance must be the parent of the source backup. Values are
    -     * of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -865,13 +832,14 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object tableId_ = ""; + /** * * @@ -897,6 +865,7 @@ public java.lang.String getTableId() { return (java.lang.String) ref; } } + /** * * @@ -922,6 +891,7 @@ public com.google.protobuf.ByteString getTableIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -941,11 +911,12 @@ public Builder setTableId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -961,11 +932,12 @@ public Builder setTableId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearTableId() { - tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } + /** * * @@ -986,8 +958,8 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1008,6 +980,7 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { public boolean hasBackup() { return sourceCase_ == 3; } + /** * * @@ -1037,6 +1010,7 @@ public java.lang.String getBackup() { return (java.lang.String) ref; } } + /** * * @@ -1066,6 +1040,7 @@ public com.google.protobuf.ByteString getBackupBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1088,6 +1063,7 @@ public Builder setBackup(java.lang.String value) { onChanged(); return this; } + /** * * @@ -1108,6 +1084,7 @@ public Builder clearBackup() { } return this; } + /** * * @@ -1132,17 +1109,6 @@ public Builder setBackupBytes(com.google.protobuf.ByteString value) { return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.RestoreTableRequest) } @@ -1164,7 +1130,18 @@ public RestoreTableRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RestoreTableRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java index 38df514193..d078b0fef4 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/RestoreTableRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -28,8 +31,7 @@ public interface RestoreTableRequestOrBuilder * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be the parent of the source backup. Values are
    -   * of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -39,13 +41,13 @@ public interface RestoreTableRequestOrBuilder * @return The parent. */ java.lang.String getParent(); + /** * * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be the parent of the source backup. Values are
    -   * of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -71,6 +73,7 @@ public interface RestoreTableRequestOrBuilder * @return The tableId. */ java.lang.String getTableId(); + /** * * @@ -100,6 +103,7 @@ public interface RestoreTableRequestOrBuilder * @return Whether the backup field is set. */ boolean hasBackup(); + /** * * @@ -113,6 +117,7 @@ public interface RestoreTableRequestOrBuilder * @return The backup. */ java.lang.String getBackup(); + /** * * @@ -127,5 +132,5 @@ public interface RestoreTableRequestOrBuilder */ com.google.protobuf.ByteString getBackupBytes(); - public com.google.bigtable.admin.v2.RestoreTableRequest.SourceCase getSourceCase(); + com.google.bigtable.admin.v2.RestoreTableRequest.SourceCase getSourceCase(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundle.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundle.java new file mode 100644 index 0000000000..ae18eb985f --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleName.java new file mode 100644 index 0000000000..01ffe0e433 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SchemaBundleOrBuilder.java new file mode 100644 index 0000000000..5b433ff344 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java index 4d6db1d7a0..1366ac6e3a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -24,6 +26,7 @@ *
      * 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
    @@ -32,13 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.Snapshot}
      */
    -public final class Snapshot extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private Snapshot(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -48,132 +63,13 @@ private Snapshot() {
         description_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new Snapshot();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private Snapshot(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          case 18:
    -            {
    -              com.google.bigtable.admin.v2.Table.Builder subBuilder = null;
    -              if (sourceTable_ != null) {
    -                subBuilder = sourceTable_.toBuilder();
    -              }
    -              sourceTable_ =
    -                  input.readMessage(com.google.bigtable.admin.v2.Table.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(sourceTable_);
    -                sourceTable_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 24:
    -            {
    -              dataSizeBytes_ = input.readInt64();
    -              break;
    -            }
    -          case 34:
    -            {
    -              com.google.protobuf.Timestamp.Builder subBuilder = null;
    -              if (createTime_ != null) {
    -                subBuilder = createTime_.toBuilder();
    -              }
    -              createTime_ =
    -                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(createTime_);
    -                createTime_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 42:
    -            {
    -              com.google.protobuf.Timestamp.Builder subBuilder = null;
    -              if (deleteTime_ != null) {
    -                subBuilder = deleteTime_.toBuilder();
    -              }
    -              deleteTime_ =
    -                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(deleteTime_);
    -                deleteTime_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 48:
    -            {
    -              int rawValue = input.readEnum();
    -
    -              state_ = rawValue;
    -              break;
    -            }
    -          case 58:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              description_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.TableProto
             .internal_static_google_bigtable_admin_v2_Snapshot_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.TableProto
             .internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable
    @@ -227,6 +123,16 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum {
         UNRECOGNIZED(-1),
         ;
     
    +    static {
    +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +          /* major= */ 4,
    +          /* minor= */ 33,
    +          /* patch= */ 2,
    +          /* suffix= */ "",
    +          "State");
    +    }
    +
         /**
          *
          *
    @@ -237,6 +143,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum {
          * STATE_NOT_KNOWN = 0;
          */
         public static final int STATE_NOT_KNOWN_VALUE = 0;
    +
         /**
          *
          *
    @@ -247,6 +154,7 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum {
          * READY = 1;
          */
         public static final int READY_VALUE = 1;
    +
         /**
          *
          *
    @@ -318,7 +226,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType
           return getDescriptor();
         }
     
    -    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
    +    public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
           return com.google.bigtable.admin.v2.Snapshot.getDescriptor().getEnumTypes().get(0);
         }
     
    @@ -343,13 +251,17 @@ private State(int value) {
         // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Snapshot.State)
       }
     
    +  private int bitField0_;
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
        * 
    -   * Output only. The unique name of the snapshot.
    +   * The unique name of the snapshot.
        * Values are of the form
        * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
        * 
    @@ -370,11 +282,12 @@ public java.lang.String getName() { return s; } } + /** * * *
    -   * Output only. The unique name of the snapshot.
    +   * The unique name of the snapshot.
        * Values are of the form
        * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
        * 
    @@ -398,6 +311,7 @@ public com.google.protobuf.ByteString getNameBytes() { public static final int SOURCE_TABLE_FIELD_NUMBER = 2; private com.google.bigtable.admin.v2.Table sourceTable_; + /** * * @@ -405,14 +319,17 @@ public 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.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 sourceTable_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -420,7 +337,9 @@ public boolean hasSourceTable() { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The sourceTable. */ @@ -430,6 +349,7 @@ public com.google.bigtable.admin.v2.Table getSourceTable() { ? com.google.bigtable.admin.v2.Table.getDefaultInstance() : sourceTable_; } + /** * * @@ -437,15 +357,20 @@ public 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.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 getSourceTable(); + return sourceTable_ == null + ? com.google.bigtable.admin.v2.Table.getDefaultInstance() + : sourceTable_; } public static final int DATA_SIZE_BYTES_FIELD_NUMBER = 3; - private long dataSizeBytes_; + private long dataSizeBytes_ = 0L; + /** * * @@ -456,7 +381,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { * in the meantime. *
    * - * int64 data_size_bytes = 3; + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The dataSizeBytes. */ @@ -467,6 +392,7 @@ public long getDataSizeBytes() { public static final int CREATE_TIME_FIELD_NUMBER = 4; private com.google.protobuf.Timestamp createTime_; + /** * * @@ -474,14 +400,16 @@ public long getDataSizeBytes() { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * .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 createTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -489,7 +417,8 @@ public boolean hasCreateTime() { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -497,6 +426,7 @@ public boolean hasCreateTime() { public com.google.protobuf.Timestamp getCreateTime() { return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } + /** * * @@ -504,21 +434,23 @@ public com.google.protobuf.Timestamp getCreateTime() { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; } public static final int DELETE_TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp deleteTime_; + /** * * *
    -   * 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 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.
        * 
    * @@ -528,14 +460,15 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { */ @java.lang.Override public boolean hasDeleteTime() { - return deleteTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * *
    -   * 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 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.
        * 
    * @@ -547,12 +480,13 @@ public boolean hasDeleteTime() { public com.google.protobuf.Timestamp getDeleteTime() { return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } + /** * * *
    -   * 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 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.
        * 
    * @@ -560,11 +494,12 @@ public com.google.protobuf.Timestamp getDeleteTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { - return getDeleteTime(); + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; } public static final int STATE_FIELD_NUMBER = 6; - private int state_; + private int state_ = 0; + /** * * @@ -572,7 +507,9 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * Output only. The current state of the snapshot. *
    * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -580,6 +517,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { public int getStateValue() { return state_; } + /** * * @@ -587,25 +525,29 @@ public int getStateValue() { * Output only. The current state of the snapshot. *
    * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Snapshot.State result = - com.google.bigtable.admin.v2.Snapshot.State.valueOf(state_); + 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; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * *
    -   * Output only. Description of the snapshot.
    +   * Description of the snapshot.
        * 
    * * string description = 7; @@ -624,11 +566,12 @@ public java.lang.String getDescription() { return s; } } + /** * * *
    -   * Output only. Description of the snapshot.
    +   * Description of the snapshot.
        * 
    * * string description = 7; @@ -662,28 +605,28 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (sourceTable_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getSourceTable()); } if (dataSizeBytes_ != 0L) { output.writeInt64(3, dataSizeBytes_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(4, getCreateTime()); } - if (deleteTime_ != null) { + 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 (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 7, description_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -692,28 +635,28 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (sourceTable_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSourceTable()); } if (dataSizeBytes_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, dataSizeBytes_); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); } - if (deleteTime_ != null) { + 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 (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, description_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -744,7 +687,7 @@ public boolean equals(final java.lang.Object obj) { } if (state_ != other.state_) return false; if (!getDescription().equals(other.getDescription())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -775,7 +718,7 @@ public int hashCode() { hash = (53 * hash) + state_; hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -816,38 +759,38 @@ public static com.google.bigtable.admin.v2.Snapshot parseFrom( public static com.google.bigtable.admin.v2.Snapshot parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -870,16 +813,18 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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
    @@ -888,7 +833,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.Snapshot}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -898,7 +843,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.TableProto
               .internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable
    @@ -912,44 +857,42 @@ private Builder() {
           maybeForceBuilderInitialization();
         }
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
           maybeForceBuilderInitialization();
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
    +        internalGetSourceTableFieldBuilder();
    +        internalGetCreateTimeFieldBuilder();
    +        internalGetDeleteTimeFieldBuilder();
    +      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
    -      if (sourceTableBuilder_ == null) {
    -        sourceTable_ = null;
    -      } else {
    -        sourceTable_ = null;
    +      sourceTable_ = null;
    +      if (sourceTableBuilder_ != null) {
    +        sourceTableBuilder_.dispose();
             sourceTableBuilder_ = null;
           }
           dataSizeBytes_ = 0L;
    -
    -      if (createTimeBuilder_ == null) {
    -        createTime_ = null;
    -      } else {
    -        createTime_ = null;
    +      createTime_ = null;
    +      if (createTimeBuilder_ != null) {
    +        createTimeBuilder_.dispose();
             createTimeBuilder_ = null;
           }
    -      if (deleteTimeBuilder_ == null) {
    -        deleteTime_ = null;
    -      } else {
    -        deleteTime_ = null;
    +      deleteTime_ = null;
    +      if (deleteTimeBuilder_ != null) {
    +        deleteTimeBuilder_.dispose();
             deleteTimeBuilder_ = null;
           }
           state_ = 0;
    -
           description_ = "";
    -
           return this;
         }
     
    @@ -977,60 +920,42 @@ public com.google.bigtable.admin.v2.Snapshot build() {
         public com.google.bigtable.admin.v2.Snapshot buildPartial() {
           com.google.bigtable.admin.v2.Snapshot result =
               new com.google.bigtable.admin.v2.Snapshot(this);
    -      result.name_ = name_;
    -      if (sourceTableBuilder_ == null) {
    -        result.sourceTable_ = sourceTable_;
    -      } else {
    -        result.sourceTable_ = sourceTableBuilder_.build();
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
    -      result.dataSizeBytes_ = dataSizeBytes_;
    -      if (createTimeBuilder_ == null) {
    -        result.createTime_ = createTime_;
    -      } else {
    -        result.createTime_ = createTimeBuilder_.build();
    -      }
    -      if (deleteTimeBuilder_ == null) {
    -        result.deleteTime_ = deleteTime_;
    -      } else {
    -        result.deleteTime_ = deleteTimeBuilder_.build();
    -      }
    -      result.state_ = state_;
    -      result.description_ = description_;
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -1047,6 +972,7 @@ 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()) {
    @@ -1066,9 +992,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Snapshot other) {
           }
           if (!other.getDescription().isEmpty()) {
             description_ = other.description_;
    +        bitField0_ |= 0x00000040;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -1083,26 +1010,88 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.Snapshot parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage = (com.google.bigtable.admin.v2.Snapshot) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
          * 
    -     * Output only. The unique name of the snapshot.
    +     * The unique name of the snapshot.
          * Values are of the form
          * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
          * 
    @@ -1122,11 +1111,12 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * *
    -     * Output only. The unique name of the snapshot.
    +     * The unique name of the snapshot.
          * Values are of the form
          * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
          * 
    @@ -1146,11 +1136,12 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Output only. The unique name of the snapshot.
    +     * The unique name of the snapshot.
          * Values are of the form
          * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
          * 
    @@ -1164,16 +1155,17 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * *
    -     * Output only. The unique name of the snapshot.
    +     * The unique name of the snapshot.
          * Values are of the form
          * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
          * 
    @@ -1183,16 +1175,17 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * *
    -     * Output only. The unique name of the snapshot.
    +     * The unique name of the snapshot.
          * Values are of the form
          * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
          * 
    @@ -1207,18 +1200,19 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.bigtable.admin.v2.Table sourceTable_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -1226,13 +1220,16 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .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 sourceTableBuilder_ != null || sourceTable_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -1240,7 +1237,9 @@ public boolean hasSourceTable() { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The sourceTable. */ @@ -1253,6 +1252,7 @@ public com.google.bigtable.admin.v2.Table getSourceTable() { return sourceTableBuilder_.getMessage(); } } + /** * * @@ -1260,7 +1260,9 @@ public 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.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) { @@ -1268,13 +1270,14 @@ public Builder setSourceTable(com.google.bigtable.admin.v2.Table value) { throw new NullPointerException(); } sourceTable_ = value; - onChanged(); } else { sourceTableBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -1282,18 +1285,21 @@ public Builder setSourceTable(com.google.bigtable.admin.v2.Table value) { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .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(); - onChanged(); } else { sourceTableBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -1301,25 +1307,29 @@ public Builder setSourceTable(com.google.bigtable.admin.v2.Table.Builder builder * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .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 (sourceTable_ != null) { - sourceTable_ = - com.google.bigtable.admin.v2.Table.newBuilder(sourceTable_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && sourceTable_ != null + && sourceTable_ != com.google.bigtable.admin.v2.Table.getDefaultInstance()) { + getSourceTableBuilder().mergeFrom(value); } else { sourceTable_ = value; } - onChanged(); } else { sourceTableBuilder_.mergeFrom(value); } - + if (sourceTable_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -1327,19 +1337,21 @@ public Builder mergeSourceTable(com.google.bigtable.admin.v2.Table value) { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearSourceTable() { - if (sourceTableBuilder_ == null) { - sourceTable_ = null; - onChanged(); - } else { - sourceTable_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + sourceTable_ = null; + if (sourceTableBuilder_ != null) { + sourceTableBuilder_.dispose(); sourceTableBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1347,13 +1359,16 @@ public Builder clearSourceTable() { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .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 getSourceTableFieldBuilder().getBuilder(); + return internalGetSourceTableFieldBuilder().getBuilder(); } + /** * * @@ -1361,7 +1376,9 @@ public com.google.bigtable.admin.v2.Table.Builder getSourceTableBuilder() { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .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) { @@ -1372,6 +1389,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { : sourceTable_; } } + /** * * @@ -1379,16 +1397,18 @@ public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { * Output only. The source table at the time the snapshot was taken. *
    * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Table, com.google.bigtable.admin.v2.Table.Builder, com.google.bigtable.admin.v2.TableOrBuilder> - getSourceTableFieldBuilder() { + internalGetSourceTableFieldBuilder() { if (sourceTableBuilder_ == null) { sourceTableBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Table, com.google.bigtable.admin.v2.Table.Builder, com.google.bigtable.admin.v2.TableOrBuilder>( @@ -1399,6 +1419,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { } private long dataSizeBytes_; + /** * * @@ -1409,7 +1430,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { * in the meantime. *
    * - * int64 data_size_bytes = 3; + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The dataSizeBytes. */ @@ -1417,6 +1438,7 @@ public com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder() { public long getDataSizeBytes() { return dataSizeBytes_; } + /** * * @@ -1427,7 +1449,7 @@ public long getDataSizeBytes() { * in the meantime. *
    * - * int64 data_size_bytes = 3; + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @param value The dataSizeBytes to set. * @return This builder for chaining. @@ -1435,9 +1457,11 @@ public long getDataSizeBytes() { public Builder setDataSizeBytes(long value) { dataSizeBytes_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1448,23 +1472,24 @@ public Builder setDataSizeBytes(long value) { * in the meantime. *
    * - * int64 data_size_bytes = 3; + * 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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** * * @@ -1472,13 +1497,16 @@ public Builder clearDataSizeBytes() { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1486,7 +1514,9 @@ public boolean hasCreateTime() { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ @@ -1499,6 +1529,7 @@ public com.google.protobuf.Timestamp getCreateTime() { return createTimeBuilder_.getMessage(); } } + /** * * @@ -1506,7 +1537,9 @@ public com.google.protobuf.Timestamp getCreateTime() { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder setCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { @@ -1514,13 +1547,14 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1528,18 +1562,21 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { * Output only. The time when the snapshot is created. *
    * - * .google.protobuf.Timestamp create_time = 4; + * + * .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(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1547,23 +1584,29 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { if (createTimeBuilder_ == null) { - if (createTime_ != null) { - createTime_ = - com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1571,19 +1614,21 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1591,13 +1636,16 @@ public Builder clearCreateTime() { * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getCreateTimeFieldBuilder().getBuilder(); + return internalGetCreateTimeFieldBuilder().getBuilder(); } + /** * * @@ -1605,7 +1653,9 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { if (createTimeBuilder_ != null) { @@ -1616,6 +1666,7 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { : createTime_; } } + /** * * @@ -1623,16 +1674,18 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getCreateTimeFieldBuilder() { + internalGetCreateTimeFieldBuilder() { if (createTimeBuilder_ == null) { createTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1643,17 +1696,18 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { } private com.google.protobuf.Timestamp deleteTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> deleteTimeBuilder_; + /** * * *
    -     * 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 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.
          * 
    * @@ -1662,14 +1716,15 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * @return Whether the deleteTime field is set. */ public boolean hasDeleteTime() { - return deleteTimeBuilder_ != null || deleteTime_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * *
    -     * 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 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.
          * 
    * @@ -1686,12 +1741,13 @@ public com.google.protobuf.Timestamp getDeleteTime() { return deleteTimeBuilder_.getMessage(); } } + /** * * *
    -     * 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 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.
          * 
    * @@ -1703,19 +1759,20 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } deleteTime_ = value; - onChanged(); } else { deleteTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * *
    -     * 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 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.
          * 
    * @@ -1724,19 +1781,20 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp value) { public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (deleteTimeBuilder_ == null) { deleteTime_ = builderForValue.build(); - onChanged(); } else { deleteTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * *
    -     * 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 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.
          * 
    * @@ -1744,63 +1802,68 @@ public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { if (deleteTimeBuilder_ == null) { - if (deleteTime_ != null) { - deleteTime_ = - com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && deleteTime_ != null + && deleteTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getDeleteTimeBuilder().mergeFrom(value); } else { deleteTime_ = value; } - onChanged(); } else { deleteTimeBuilder_.mergeFrom(value); } - + if (deleteTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * *
    -     * 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 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() { - if (deleteTimeBuilder_ == null) { - deleteTime_ = null; - onChanged(); - } else { - deleteTime_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + deleteTime_ = null; + if (deleteTimeBuilder_ != null) { + deleteTimeBuilder_.dispose(); deleteTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * *
    -     * 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 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 getDeleteTimeFieldBuilder().getBuilder(); + return internalGetDeleteTimeFieldBuilder().getBuilder(); } + /** * * *
    -     * 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 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.
          * 
    * @@ -1815,25 +1878,26 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { : deleteTime_; } } + /** * * *
    -     * 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 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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getDeleteTimeFieldBuilder() { + internalGetDeleteTimeFieldBuilder() { if (deleteTimeBuilder_ == null) { deleteTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1844,6 +1908,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { } private int state_ = 0; + /** * * @@ -1851,7 +1916,9 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The enum numeric value on the wire for state. */ @@ -1859,6 +1926,7 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { public int getStateValue() { return state_; } + /** * * @@ -1866,17 +1934,20 @@ public int getStateValue() { * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .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; } + /** * * @@ -1884,17 +1955,19 @@ public Builder setStateValue(int value) { * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Snapshot.State result = - com.google.bigtable.admin.v2.Snapshot.State.valueOf(state_); + com.google.bigtable.admin.v2.Snapshot.State.forNumber(state_); return result == null ? com.google.bigtable.admin.v2.Snapshot.State.UNRECOGNIZED : result; } + /** * * @@ -1902,7 +1975,9 @@ public com.google.bigtable.admin.v2.Snapshot.State getState() { * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .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. @@ -1911,11 +1986,12 @@ 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; } + /** * * @@ -1923,23 +1999,26 @@ public Builder setState(com.google.bigtable.admin.v2.Snapshot.State value) { * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .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_ = ""; + /** * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -1957,11 +2036,12 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -1979,11 +2059,12 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -1995,16 +2076,17 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -2012,16 +2094,17 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } + /** * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -2034,23 +2117,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Snapshot) } @@ -2072,7 +2144,18 @@ public Snapshot parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Snapshot(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java index 65dcf87b53..9e0af534fe 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -174,7 +174,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { SnapshotName that = ((SnapshotName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) @@ -246,10 +246,10 @@ public Builder setSnapshot(String snapshot) { } private Builder(SnapshotName snapshotName) { - project = snapshotName.project; - instance = snapshotName.instance; - cluster = snapshotName.cluster; - snapshot = snapshotName.snapshot; + this.project = snapshotName.project; + this.instance = snapshotName.instance; + this.cluster = snapshotName.cluster; + this.snapshot = snapshotName.snapshot; } public SnapshotName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java index 332324988e..c3a3507134 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,7 +30,7 @@ public interface SnapshotOrBuilder * * *
    -   * Output only. The unique name of the snapshot.
    +   * The unique name of the snapshot.
        * Values are of the form
        * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
        * 
    @@ -37,11 +40,12 @@ public interface SnapshotOrBuilder * @return The name. */ java.lang.String getName(); + /** * * *
    -   * Output only. The unique name of the snapshot.
    +   * The unique name of the snapshot.
        * Values are of the form
        * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
        * 
    @@ -59,11 +63,14 @@ public interface SnapshotOrBuilder * Output only. The source table at the time the snapshot was taken. * * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the sourceTable field is set. */ boolean hasSourceTable(); + /** * * @@ -71,11 +78,14 @@ public interface SnapshotOrBuilder * Output only. The source table at the time the snapshot was taken. * * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The sourceTable. */ com.google.bigtable.admin.v2.Table getSourceTable(); + /** * * @@ -83,7 +93,9 @@ public interface SnapshotOrBuilder * Output only. The source table at the time the snapshot was taken. * * - * .google.bigtable.admin.v2.Table source_table = 2; + * + * .google.bigtable.admin.v2.Table source_table = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.bigtable.admin.v2.TableOrBuilder getSourceTableOrBuilder(); @@ -97,7 +109,7 @@ public interface SnapshotOrBuilder * in the meantime. * * - * int64 data_size_bytes = 3; + * int64 data_size_bytes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * @return The dataSizeBytes. */ @@ -110,11 +122,13 @@ public interface SnapshotOrBuilder * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the createTime field is set. */ boolean hasCreateTime(); + /** * * @@ -122,11 +136,13 @@ public interface SnapshotOrBuilder * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The createTime. */ com.google.protobuf.Timestamp getCreateTime(); + /** * * @@ -134,7 +150,8 @@ public interface SnapshotOrBuilder * Output only. The time when the snapshot is created. * * - * .google.protobuf.Timestamp create_time = 4; + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); @@ -142,8 +159,8 @@ public interface SnapshotOrBuilder * * *
    -   * 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 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.
        * 
    * @@ -152,12 +169,13 @@ public interface SnapshotOrBuilder * @return Whether the deleteTime field is set. */ boolean hasDeleteTime(); + /** * * *
    -   * 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 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.
        * 
    * @@ -166,12 +184,13 @@ public interface SnapshotOrBuilder * @return The deleteTime. */ com.google.protobuf.Timestamp getDeleteTime(); + /** * * *
    -   * 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 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.
        * 
    * @@ -186,11 +205,14 @@ public interface SnapshotOrBuilder * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .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(); + /** * * @@ -198,7 +220,9 @@ public interface SnapshotOrBuilder * Output only. The current state of the snapshot. * * - * .google.bigtable.admin.v2.Snapshot.State state = 6; + * + * .google.bigtable.admin.v2.Snapshot.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The state. */ @@ -208,7 +232,7 @@ public interface SnapshotOrBuilder * * *
    -   * Output only. Description of the snapshot.
    +   * Description of the snapshot.
        * 
    * * string description = 7; @@ -216,11 +240,12 @@ public interface SnapshotOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * *
    -   * Output only. Description of the snapshot.
    +   * Description of the snapshot.
        * 
    * * string description = 7; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java index aa6b048e70..f7840fb2a3 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -23,6 +25,7 @@ * *
      * 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
    @@ -31,112 +34,29 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableMetadata}
      */
    -public final class SnapshotTableMetadata extends com.google.protobuf.GeneratedMessageV3
    +@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;
    -  // Use SnapshotTableMetadata.newBuilder() to construct.
    -  private SnapshotTableMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    -    super(builder);
    -  }
    -
    -  private SnapshotTableMetadata() {}
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new SnapshotTableMetadata();
    +  static {
    +    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +        /* major= */ 4,
    +        /* minor= */ 33,
    +        /* patch= */ 2,
    +        /* suffix= */ "",
    +        "SnapshotTableMetadata");
       }
     
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    +  // Use SnapshotTableMetadata.newBuilder() to construct.
    +  private SnapshotTableMetadata(com.google.protobuf.GeneratedMessage.Builder builder) {
    +    super(builder);
       }
     
    -  private SnapshotTableMetadata(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              com.google.bigtable.admin.v2.SnapshotTableRequest.Builder subBuilder = null;
    -              if (originalRequest_ != null) {
    -                subBuilder = originalRequest_.toBuilder();
    -              }
    -              originalRequest_ =
    -                  input.readMessage(
    -                      com.google.bigtable.admin.v2.SnapshotTableRequest.parser(),
    -                      extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(originalRequest_);
    -                originalRequest_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 18:
    -            {
    -              com.google.protobuf.Timestamp.Builder subBuilder = null;
    -              if (requestTime_ != null) {
    -                subBuilder = requestTime_.toBuilder();
    -              }
    -              requestTime_ =
    -                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(requestTime_);
    -                requestTime_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 26:
    -            {
    -              com.google.protobuf.Timestamp.Builder subBuilder = null;
    -              if (finishTime_ != null) {
    -                subBuilder = finishTime_.toBuilder();
    -              }
    -              finishTime_ =
    -                  input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(finishTime_);
    -                finishTime_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    +  private SnapshotTableMetadata() {}
     
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
    @@ -144,7 +64,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_fieldAccessorTable
    @@ -153,8 +73,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                 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_;
    +
       /**
        *
        *
    @@ -168,8 +90,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        */
       @java.lang.Override
       public boolean hasOriginalRequest() {
    -    return originalRequest_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
    +
       /**
        *
        *
    @@ -187,6 +110,7 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest() {
             ? com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance()
             : originalRequest_;
       }
    +
       /**
        *
        *
    @@ -198,11 +122,14 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest() {
        */
       @java.lang.Override
       public com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder getOriginalRequestOrBuilder() {
    -    return getOriginalRequest();
    +    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_;
    +
       /**
        *
        *
    @@ -216,8 +143,9 @@ public com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder getOriginalReq
        */
       @java.lang.Override
       public boolean hasRequestTime() {
    -    return requestTime_ != null;
    +    return ((bitField0_ & 0x00000002) != 0);
       }
    +
       /**
        *
        *
    @@ -233,6 +161,7 @@ public boolean hasRequestTime() {
       public com.google.protobuf.Timestamp getRequestTime() {
         return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_;
       }
    +
       /**
        *
        *
    @@ -244,11 +173,12 @@ public com.google.protobuf.Timestamp getRequestTime() {
        */
       @java.lang.Override
       public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
    -    return getRequestTime();
    +    return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_;
       }
     
       public static final int FINISH_TIME_FIELD_NUMBER = 3;
       private com.google.protobuf.Timestamp finishTime_;
    +
       /**
        *
        *
    @@ -262,8 +192,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
        */
       @java.lang.Override
       public boolean hasFinishTime() {
    -    return finishTime_ != null;
    +    return ((bitField0_ & 0x00000004) != 0);
       }
    +
       /**
        *
        *
    @@ -279,6 +210,7 @@ public boolean hasFinishTime() {
       public com.google.protobuf.Timestamp getFinishTime() {
         return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_;
       }
    +
       /**
        *
        *
    @@ -290,7 +222,7 @@ public com.google.protobuf.Timestamp getFinishTime() {
        */
       @java.lang.Override
       public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
    -    return getFinishTime();
    +    return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_;
       }
     
       private byte memoizedIsInitialized = -1;
    @@ -307,16 +239,16 @@ public final boolean isInitialized() {
     
       @java.lang.Override
       public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -    if (originalRequest_ != null) {
    +    if (((bitField0_ & 0x00000001) != 0)) {
           output.writeMessage(1, getOriginalRequest());
         }
    -    if (requestTime_ != null) {
    +    if (((bitField0_ & 0x00000002) != 0)) {
           output.writeMessage(2, getRequestTime());
         }
    -    if (finishTime_ != null) {
    +    if (((bitField0_ & 0x00000004) != 0)) {
           output.writeMessage(3, getFinishTime());
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -325,16 +257,16 @@ public int getSerializedSize() {
         if (size != -1) return size;
     
         size = 0;
    -    if (originalRequest_ != null) {
    +    if (((bitField0_ & 0x00000001) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest());
         }
    -    if (requestTime_ != null) {
    +    if (((bitField0_ & 0x00000002) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime());
         }
    -    if (finishTime_ != null) {
    +    if (((bitField0_ & 0x00000004) != 0)) {
           size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime());
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -362,7 +294,7 @@ public boolean equals(final java.lang.Object obj) {
         if (hasFinishTime()) {
           if (!getFinishTime().equals(other.getFinishTime())) return false;
         }
    -    if (!unknownFields.equals(other.unknownFields)) return false;
    +    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
         return true;
       }
     
    @@ -385,7 +317,7 @@ public int hashCode() {
           hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER;
           hash = (53 * hash) + getFinishTime().hashCode();
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -427,38 +359,38 @@ public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom(
     
       public static com.google.bigtable.admin.v2.SnapshotTableMetadata parseFrom(
           java.io.InputStream input) throws java.io.IOException {
    -    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseDelimitedWithIOException(
    +    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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +    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.GeneratedMessageV3.parseWithIOException(
    +    return com.google.protobuf.GeneratedMessage.parseWithIOException(
             PARSER, input, extensionRegistry);
       }
     
    @@ -481,15 +413,17 @@ public Builder toBuilder() {
       }
     
       @java.lang.Override
    -  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +  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
    @@ -498,7 +432,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableMetadata}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -508,7 +442,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_fieldAccessorTable
    @@ -522,34 +456,36 @@ private Builder() {
           maybeForceBuilderInitialization();
         }
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
           maybeForceBuilderInitialization();
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
    +        internalGetOriginalRequestFieldBuilder();
    +        internalGetRequestTimeFieldBuilder();
    +        internalGetFinishTimeFieldBuilder();
    +      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    -      if (originalRequestBuilder_ == null) {
    -        originalRequest_ = null;
    -      } else {
    -        originalRequest_ = null;
    +      bitField0_ = 0;
    +      originalRequest_ = null;
    +      if (originalRequestBuilder_ != null) {
    +        originalRequestBuilder_.dispose();
             originalRequestBuilder_ = null;
           }
    -      if (requestTimeBuilder_ == null) {
    -        requestTime_ = null;
    -      } else {
    -        requestTime_ = null;
    +      requestTime_ = null;
    +      if (requestTimeBuilder_ != null) {
    +        requestTimeBuilder_.dispose();
             requestTimeBuilder_ = null;
           }
    -      if (finishTimeBuilder_ == null) {
    -        finishTime_ = null;
    -      } else {
    -        finishTime_ = null;
    +      finishTime_ = null;
    +      if (finishTimeBuilder_ != null) {
    +        finishTimeBuilder_.dispose();
             finishTimeBuilder_ = null;
           }
           return this;
    @@ -579,56 +515,31 @@ public com.google.bigtable.admin.v2.SnapshotTableMetadata build() {
         public com.google.bigtable.admin.v2.SnapshotTableMetadata buildPartial() {
           com.google.bigtable.admin.v2.SnapshotTableMetadata result =
               new com.google.bigtable.admin.v2.SnapshotTableMetadata(this);
    -      if (originalRequestBuilder_ == null) {
    -        result.originalRequest_ = originalRequest_;
    -      } else {
    -        result.originalRequest_ = originalRequestBuilder_.build();
    -      }
    -      if (requestTimeBuilder_ == null) {
    -        result.requestTime_ = requestTime_;
    -      } else {
    -        result.requestTime_ = requestTimeBuilder_.build();
    -      }
    -      if (finishTimeBuilder_ == null) {
    -        result.finishTime_ = finishTime_;
    -      } else {
    -        result.finishTime_ = finishTimeBuilder_.build();
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -653,7 +564,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.SnapshotTableMetadata othe
           if (other.hasFinishTime()) {
             mergeFinishTime(other.getFinishTime());
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -668,27 +579,64 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.SnapshotTableMetadata parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.SnapshotTableMetadata) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private com.google.bigtable.admin.v2.SnapshotTableRequest originalRequest_;
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    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_;
    +
         /**
          *
          *
    @@ -701,8 +649,9 @@ public Builder mergeFrom(
          * @return Whether the originalRequest field is set.
          */
         public boolean hasOriginalRequest() {
    -      return originalRequestBuilder_ != null || originalRequest_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
    +
         /**
          *
          *
    @@ -723,6 +672,7 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest() {
             return originalRequestBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -738,13 +688,14 @@ public Builder setOriginalRequest(com.google.bigtable.admin.v2.SnapshotTableRequ
               throw new NullPointerException();
             }
             originalRequest_ = value;
    -        onChanged();
           } else {
             originalRequestBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000001;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -758,13 +709,14 @@ public Builder setOriginalRequest(
             com.google.bigtable.admin.v2.SnapshotTableRequest.Builder builderForValue) {
           if (originalRequestBuilder_ == null) {
             originalRequest_ = builderForValue.build();
    -        onChanged();
           } else {
             originalRequestBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000001;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -776,21 +728,24 @@ public Builder setOriginalRequest(
          */
         public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.SnapshotTableRequest value) {
           if (originalRequestBuilder_ == null) {
    -        if (originalRequest_ != null) {
    -          originalRequest_ =
    -              com.google.bigtable.admin.v2.SnapshotTableRequest.newBuilder(originalRequest_)
    -                  .mergeFrom(value)
    -                  .buildPartial();
    +        if (((bitField0_ & 0x00000001) != 0)
    +            && originalRequest_ != null
    +            && originalRequest_
    +                != com.google.bigtable.admin.v2.SnapshotTableRequest.getDefaultInstance()) {
    +          getOriginalRequestBuilder().mergeFrom(value);
             } else {
               originalRequest_ = value;
             }
    -        onChanged();
           } else {
             originalRequestBuilder_.mergeFrom(value);
           }
    -
    +      if (originalRequest_ != null) {
    +        bitField0_ |= 0x00000001;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -801,16 +756,16 @@ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.SnapshotTableRe
          * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1;
          */
         public Builder clearOriginalRequest() {
    -      if (originalRequestBuilder_ == null) {
    -        originalRequest_ = null;
    -        onChanged();
    -      } else {
    -        originalRequest_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000001);
    +      originalRequest_ = null;
    +      if (originalRequestBuilder_ != null) {
    +        originalRequestBuilder_.dispose();
             originalRequestBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -821,10 +776,11 @@ public Builder clearOriginalRequest() {
          * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1;
          */
         public com.google.bigtable.admin.v2.SnapshotTableRequest.Builder getOriginalRequestBuilder() {
    -
    +      bitField0_ |= 0x00000001;
           onChanged();
    -      return getOriginalRequestFieldBuilder().getBuilder();
    +      return internalGetOriginalRequestFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -844,6 +800,7 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest.Builder getOriginalRequ
                 : originalRequest_;
           }
         }
    +
         /**
          *
          *
    @@ -853,14 +810,14 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest.Builder getOriginalRequ
          *
          * .google.bigtable.admin.v2.SnapshotTableRequest original_request = 1;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.bigtable.admin.v2.SnapshotTableRequest,
                 com.google.bigtable.admin.v2.SnapshotTableRequest.Builder,
                 com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder>
    -        getOriginalRequestFieldBuilder() {
    +        internalGetOriginalRequestFieldBuilder() {
           if (originalRequestBuilder_ == null) {
             originalRequestBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.bigtable.admin.v2.SnapshotTableRequest,
                     com.google.bigtable.admin.v2.SnapshotTableRequest.Builder,
                     com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder>(
    @@ -871,11 +828,12 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest.Builder getOriginalRequ
         }
     
         private com.google.protobuf.Timestamp requestTime_;
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
             requestTimeBuilder_;
    +
         /**
          *
          *
    @@ -888,8 +846,9 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest.Builder getOriginalRequ
          * @return Whether the requestTime field is set.
          */
         public boolean hasRequestTime() {
    -      return requestTimeBuilder_ != null || requestTime_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
    +
         /**
          *
          *
    @@ -910,6 +869,7 @@ public com.google.protobuf.Timestamp getRequestTime() {
             return requestTimeBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -925,13 +885,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             requestTime_ = value;
    -        onChanged();
           } else {
             requestTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -944,13 +905,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) {
         public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) {
           if (requestTimeBuilder_ == null) {
             requestTime_ = builderForValue.build();
    -        onChanged();
           } else {
             requestTimeBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -962,21 +924,23 @@ public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForVa
          */
         public Builder mergeRequestTime(com.google.protobuf.Timestamp value) {
           if (requestTimeBuilder_ == null) {
    -        if (requestTime_ != null) {
    -          requestTime_ =
    -              com.google.protobuf.Timestamp.newBuilder(requestTime_)
    -                  .mergeFrom(value)
    -                  .buildPartial();
    +        if (((bitField0_ & 0x00000002) != 0)
    +            && requestTime_ != null
    +            && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
    +          getRequestTimeBuilder().mergeFrom(value);
             } else {
               requestTime_ = value;
             }
    -        onChanged();
           } else {
             requestTimeBuilder_.mergeFrom(value);
           }
    -
    +      if (requestTime_ != null) {
    +        bitField0_ |= 0x00000002;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -987,16 +951,16 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) {
          * .google.protobuf.Timestamp request_time = 2;
          */
         public Builder clearRequestTime() {
    -      if (requestTimeBuilder_ == null) {
    -        requestTime_ = null;
    -        onChanged();
    -      } else {
    -        requestTime_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000002);
    +      requestTime_ = null;
    +      if (requestTimeBuilder_ != null) {
    +        requestTimeBuilder_.dispose();
             requestTimeBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1007,10 +971,11 @@ public Builder clearRequestTime() {
          * .google.protobuf.Timestamp request_time = 2;
          */
         public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() {
    -
    +      bitField0_ |= 0x00000002;
           onChanged();
    -      return getRequestTimeFieldBuilder().getBuilder();
    +      return internalGetRequestTimeFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -1029,6 +994,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
                 : requestTime_;
           }
         }
    +
         /**
          *
          *
    @@ -1038,14 +1004,14 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
          *
          * .google.protobuf.Timestamp request_time = 2;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
    -        getRequestTimeFieldBuilder() {
    +        internalGetRequestTimeFieldBuilder() {
           if (requestTimeBuilder_ == null) {
             requestTimeBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Timestamp,
                     com.google.protobuf.Timestamp.Builder,
                     com.google.protobuf.TimestampOrBuilder>(
    @@ -1056,11 +1022,12 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
         }
     
         private com.google.protobuf.Timestamp finishTime_;
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
             finishTimeBuilder_;
    +
         /**
          *
          *
    @@ -1073,8 +1040,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
          * @return Whether the finishTime field is set.
          */
         public boolean hasFinishTime() {
    -      return finishTimeBuilder_ != null || finishTime_ != null;
    +      return ((bitField0_ & 0x00000004) != 0);
         }
    +
         /**
          *
          *
    @@ -1095,6 +1063,7 @@ public com.google.protobuf.Timestamp getFinishTime() {
             return finishTimeBuilder_.getMessage();
           }
         }
    +
         /**
          *
          *
    @@ -1110,13 +1079,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             finishTime_ = value;
    -        onChanged();
           } else {
             finishTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000004;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1129,13 +1099,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) {
         public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) {
           if (finishTimeBuilder_ == null) {
             finishTime_ = builderForValue.build();
    -        onChanged();
           } else {
             finishTimeBuilder_.setMessage(builderForValue.build());
           }
    -
    +      bitField0_ |= 0x00000004;
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1147,19 +1118,23 @@ public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForVal
          */
         public Builder mergeFinishTime(com.google.protobuf.Timestamp value) {
           if (finishTimeBuilder_ == null) {
    -        if (finishTime_ != null) {
    -          finishTime_ =
    -              com.google.protobuf.Timestamp.newBuilder(finishTime_).mergeFrom(value).buildPartial();
    +        if (((bitField0_ & 0x00000004) != 0)
    +            && finishTime_ != null
    +            && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
    +          getFinishTimeBuilder().mergeFrom(value);
             } else {
               finishTime_ = value;
             }
    -        onChanged();
           } else {
             finishTimeBuilder_.mergeFrom(value);
           }
    -
    +      if (finishTime_ != null) {
    +        bitField0_ |= 0x00000004;
    +        onChanged();
    +      }
           return this;
         }
    +
         /**
          *
          *
    @@ -1170,16 +1145,16 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) {
          * .google.protobuf.Timestamp finish_time = 3;
          */
         public Builder clearFinishTime() {
    -      if (finishTimeBuilder_ == null) {
    -        finishTime_ = null;
    -        onChanged();
    -      } else {
    -        finishTime_ = null;
    +      bitField0_ = (bitField0_ & ~0x00000004);
    +      finishTime_ = null;
    +      if (finishTimeBuilder_ != null) {
    +        finishTimeBuilder_.dispose();
             finishTimeBuilder_ = null;
           }
    -
    +      onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1190,10 +1165,11 @@ public Builder clearFinishTime() {
          * .google.protobuf.Timestamp finish_time = 3;
          */
         public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() {
    -
    +      bitField0_ |= 0x00000004;
           onChanged();
    -      return getFinishTimeFieldBuilder().getBuilder();
    +      return internalGetFinishTimeFieldBuilder().getBuilder();
         }
    +
         /**
          *
          *
    @@ -1212,6 +1188,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
                 : finishTime_;
           }
         }
    +
         /**
          *
          *
    @@ -1221,14 +1198,14 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
          *
          * .google.protobuf.Timestamp finish_time = 3;
          */
    -    private com.google.protobuf.SingleFieldBuilderV3<
    +    private com.google.protobuf.SingleFieldBuilder<
                 com.google.protobuf.Timestamp,
                 com.google.protobuf.Timestamp.Builder,
                 com.google.protobuf.TimestampOrBuilder>
    -        getFinishTimeFieldBuilder() {
    +        internalGetFinishTimeFieldBuilder() {
           if (finishTimeBuilder_ == null) {
             finishTimeBuilder_ =
    -            new com.google.protobuf.SingleFieldBuilderV3<
    +            new com.google.protobuf.SingleFieldBuilder<
                     com.google.protobuf.Timestamp,
                     com.google.protobuf.Timestamp.Builder,
                     com.google.protobuf.TimestampOrBuilder>(
    @@ -1238,17 +1215,6 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() {
           return finishTimeBuilder_;
         }
     
    -    @java.lang.Override
    -    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.setUnknownFields(unknownFields);
    -    }
    -
    -    @java.lang.Override
    -    public final Builder mergeUnknownFields(
    -        final com.google.protobuf.UnknownFieldSet unknownFields) {
    -      return super.mergeUnknownFields(unknownFields);
    -    }
    -
         // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.SnapshotTableMetadata)
       }
     
    @@ -1270,7 +1236,18 @@ public SnapshotTableMetadata parsePartialFrom(
                 com.google.protobuf.CodedInputStream input,
                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                 throws com.google.protobuf.InvalidProtocolBufferException {
    -          return new SnapshotTableMetadata(input, extensionRegistry);
    +          Builder builder = newBuilder();
    +          try {
    +            builder.mergeFrom(input, extensionRegistry);
    +          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +            throw e.setUnfinishedMessage(builder.buildPartial());
    +          } catch (com.google.protobuf.UninitializedMessageException e) {
    +            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
    +          } catch (java.io.IOException e) {
    +            throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                .setUnfinishedMessage(builder.buildPartial());
    +          }
    +          return builder.buildPartial();
             }
           };
     
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java
    index 8a2eeb04bb..bb0f480322 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableMetadataOrBuilder.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,10 +14,13 @@
      * 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)
    @@ -35,6 +38,7 @@ public interface SnapshotTableMetadataOrBuilder
        * @return Whether the originalRequest field is set.
        */
       boolean hasOriginalRequest();
    +
       /**
        *
        *
    @@ -47,6 +51,7 @@ public interface SnapshotTableMetadataOrBuilder
        * @return The originalRequest.
        */
       com.google.bigtable.admin.v2.SnapshotTableRequest getOriginalRequest();
    +
       /**
        *
        *
    @@ -70,6 +75,7 @@ public interface SnapshotTableMetadataOrBuilder
        * @return Whether the requestTime field is set.
        */
       boolean hasRequestTime();
    +
       /**
        *
        *
    @@ -82,6 +88,7 @@ public interface SnapshotTableMetadataOrBuilder
        * @return The requestTime.
        */
       com.google.protobuf.Timestamp getRequestTime();
    +
       /**
        *
        *
    @@ -105,6 +112,7 @@ public interface SnapshotTableMetadataOrBuilder
        * @return Whether the finishTime field is set.
        */
       boolean hasFinishTime();
    +
       /**
        *
        *
    @@ -117,6 +125,7 @@ public interface SnapshotTableMetadataOrBuilder
        * @return The finishTime.
        */
       com.google.protobuf.Timestamp getFinishTime();
    +
       /**
        *
        *
    diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java
    index f031f08158..23b3446913 100644
    --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequest.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2020 Google LLC
    + * Copyright 2026 Google LLC
      *
      * Licensed under the Apache License, Version 2.0 (the "License");
      * you may not use this file except in compliance with the License.
    @@ -14,7 +14,9 @@
      * 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;
     
    @@ -24,6 +26,7 @@
      * 
      * 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
    @@ -32,13 +35,25 @@
      *
      * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableRequest}
      */
    -public final class SnapshotTableRequest extends com.google.protobuf.GeneratedMessageV3
    +@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.GeneratedMessageV3.Builder builder) {
    +  private SnapshotTableRequest(com.google.protobuf.GeneratedMessage.Builder builder) {
         super(builder);
       }
     
    @@ -49,103 +64,13 @@ private SnapshotTableRequest() {
         description_ = "";
       }
     
    -  @java.lang.Override
    -  @SuppressWarnings({"unused"})
    -  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -    return new SnapshotTableRequest();
    -  }
    -
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  private SnapshotTableRequest(
    -      com.google.protobuf.CodedInputStream input,
    -      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -      throws com.google.protobuf.InvalidProtocolBufferException {
    -    this();
    -    if (extensionRegistry == null) {
    -      throw new java.lang.NullPointerException();
    -    }
    -    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -        com.google.protobuf.UnknownFieldSet.newBuilder();
    -    try {
    -      boolean done = false;
    -      while (!done) {
    -        int tag = input.readTag();
    -        switch (tag) {
    -          case 0:
    -            done = true;
    -            break;
    -          case 10:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              name_ = s;
    -              break;
    -            }
    -          case 18:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              cluster_ = s;
    -              break;
    -            }
    -          case 26:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              snapshotId_ = s;
    -              break;
    -            }
    -          case 34:
    -            {
    -              com.google.protobuf.Duration.Builder subBuilder = null;
    -              if (ttl_ != null) {
    -                subBuilder = ttl_.toBuilder();
    -              }
    -              ttl_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry);
    -              if (subBuilder != null) {
    -                subBuilder.mergeFrom(ttl_);
    -                ttl_ = subBuilder.buildPartial();
    -              }
    -
    -              break;
    -            }
    -          case 42:
    -            {
    -              java.lang.String s = input.readStringRequireUtf8();
    -
    -              description_ = s;
    -              break;
    -            }
    -          default:
    -            {
    -              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                done = true;
    -              }
    -              break;
    -            }
    -        }
    -      }
    -    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -      throw e.setUnfinishedMessage(this);
    -    } catch (java.io.IOException e) {
    -      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -    } finally {
    -      this.unknownFields = unknownFields.build();
    -      makeExtensionsImmutable();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_descriptor;
       }
     
       @java.lang.Override
    -  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
           internalGetFieldAccessorTable() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_fieldAccessorTable
    @@ -154,8 +79,12 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                 com.google.bigtable.admin.v2.SnapshotTableRequest.Builder.class);
       }
     
    +  private int bitField0_;
       public static final int NAME_FIELD_NUMBER = 1;
    -  private volatile java.lang.Object name_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object name_ = "";
    +
       /**
        *
        *
    @@ -183,6 +112,7 @@ public java.lang.String getName() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -212,7 +142,10 @@ public com.google.protobuf.ByteString getNameBytes() {
       }
     
       public static final int CLUSTER_FIELD_NUMBER = 2;
    -  private volatile java.lang.Object cluster_;
    +
    +  @SuppressWarnings("serial")
    +  private volatile java.lang.Object cluster_ = "";
    +
       /**
        *
        *
    @@ -240,6 +173,7 @@ public java.lang.String getCluster() {
           return s;
         }
       }
    +
       /**
        *
        *
    @@ -269,14 +203,17 @@ public com.google.protobuf.ByteString getClusterBytes() {
       }
     
       public static final int SNAPSHOT_ID_FIELD_NUMBER = 3;
    -  private volatile java.lang.Object snapshotId_;
    +
    +  @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
    +   * 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`.
        * 
    * @@ -296,13 +233,14 @@ public java.lang.String getSnapshotId() { 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
    +   * 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`.
        * 
    * @@ -325,6 +263,7 @@ public com.google.protobuf.ByteString getSnapshotIdBytes() { public static final int TTL_FIELD_NUMBER = 4; private com.google.protobuf.Duration ttl_; + /** * * @@ -341,8 +280,9 @@ public com.google.protobuf.ByteString getSnapshotIdBytes() { */ @java.lang.Override public boolean hasTtl() { - return ttl_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -361,6 +301,7 @@ public boolean hasTtl() { public com.google.protobuf.Duration getTtl() { return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; } + /** * * @@ -375,11 +316,14 @@ public com.google.protobuf.Duration getTtl() { */ @java.lang.Override public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { - return getTtl(); + return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; } public static final int DESCRIPTION_FIELD_NUMBER = 5; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + /** * * @@ -403,6 +347,7 @@ public java.lang.String getDescription() { return s; } } + /** * * @@ -441,22 +386,22 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); } - if (!getClusterBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cluster_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cluster_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, cluster_); } - if (!getSnapshotIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, snapshotId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshotId_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, snapshotId_); } - if (ttl_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getTtl()); } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, description_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -465,22 +410,22 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); } - if (!getClusterBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cluster_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(cluster_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, cluster_); } - if (!getSnapshotIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, snapshotId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(snapshotId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, snapshotId_); } - if (ttl_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTtl()); } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, description_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -504,7 +449,7 @@ public boolean equals(final java.lang.Object obj) { if (!getTtl().equals(other.getTtl())) return false; } if (!getDescription().equals(other.getDescription())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -527,7 +472,7 @@ public int hashCode() { } hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -569,38 +514,38 @@ public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( public static com.google.bigtable.admin.v2.SnapshotTableRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -623,16 +568,18 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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
    @@ -641,7 +588,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * Protobuf type {@code google.bigtable.admin.v2.SnapshotTableRequest}
        */
    -  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
    +  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 {
    @@ -651,7 +598,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.admin.v2.BigtableTableAdminProto
               .internal_static_google_bigtable_admin_v2_SnapshotTableRequest_fieldAccessorTable
    @@ -665,32 +612,30 @@ private Builder() {
           maybeForceBuilderInitialization();
         }
     
    -    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
           super(parent);
           maybeForceBuilderInitialization();
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
    +        internalGetTtlFieldBuilder();
    +      }
         }
     
         @java.lang.Override
         public Builder clear() {
           super.clear();
    +      bitField0_ = 0;
           name_ = "";
    -
           cluster_ = "";
    -
           snapshotId_ = "";
    -
    -      if (ttlBuilder_ == null) {
    -        ttl_ = null;
    -      } else {
    -        ttl_ = null;
    +      ttl_ = null;
    +      if (ttlBuilder_ != null) {
    +        ttlBuilder_.dispose();
             ttlBuilder_ = null;
           }
           description_ = "";
    -
           return this;
         }
     
    @@ -718,50 +663,33 @@ public com.google.bigtable.admin.v2.SnapshotTableRequest build() {
         public com.google.bigtable.admin.v2.SnapshotTableRequest buildPartial() {
           com.google.bigtable.admin.v2.SnapshotTableRequest result =
               new com.google.bigtable.admin.v2.SnapshotTableRequest(this);
    -      result.name_ = name_;
    -      result.cluster_ = cluster_;
    -      result.snapshotId_ = snapshotId_;
    -      if (ttlBuilder_ == null) {
    -        result.ttl_ = ttl_;
    -      } else {
    -        result.ttl_ = ttlBuilder_.build();
    +      if (bitField0_ != 0) {
    +        buildPartial0(result);
           }
    -      result.description_ = description_;
           onBuilt();
           return result;
         }
     
    -    @java.lang.Override
    -    public Builder clone() {
    -      return super.clone();
    -    }
    -
    -    @java.lang.Override
    -    public Builder setField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.setField(field, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -      return super.clearField(field);
    -    }
    -
    -    @java.lang.Override
    -    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -      return super.clearOneof(oneof);
    -    }
    -
    -    @java.lang.Override
    -    public Builder setRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
    -      return super.setRepeatedField(field, index, value);
    -    }
    -
    -    @java.lang.Override
    -    public Builder addRepeatedField(
    -        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -      return super.addRepeatedField(field, value);
    +    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
    @@ -779,14 +707,17 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.SnapshotTableRequest other
             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()) {
    @@ -794,9 +725,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.SnapshotTableRequest other
           }
           if (!other.getDescription().isEmpty()) {
             description_ = other.description_;
    +        bitField0_ |= 0x00000010;
             onChanged();
           }
    -      this.mergeUnknownFields(other.unknownFields);
    +      this.mergeUnknownFields(other.getUnknownFields());
           onChanged();
           return this;
         }
    @@ -811,22 +743,68 @@ public Builder mergeFrom(
             com.google.protobuf.CodedInputStream input,
             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
             throws java.io.IOException {
    -      com.google.bigtable.admin.v2.SnapshotTableRequest parsedMessage = null;
    +      if (extensionRegistry == null) {
    +        throw new java.lang.NullPointerException();
    +      }
           try {
    -        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +        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) {
    -        parsedMessage =
    -            (com.google.bigtable.admin.v2.SnapshotTableRequest) e.getUnfinishedMessage();
             throw e.unwrapIOException();
           } finally {
    -        if (parsedMessage != null) {
    -          mergeFrom(parsedMessage);
    -        }
    -      }
    +        onChanged();
    +      } // finally
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
    +
         /**
          *
          *
    @@ -853,6 +831,7 @@ public java.lang.String getName() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -879,6 +858,7 @@ public com.google.protobuf.ByteString getNameBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -899,11 +879,12 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -920,11 +901,12 @@ public Builder setName(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearName() {
    -
           name_ = getDefaultInstance().getName();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -946,13 +928,14 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
     
         private java.lang.Object cluster_ = "";
    +
         /**
          *
          *
    @@ -979,6 +962,7 @@ public java.lang.String getCluster() {
             return (java.lang.String) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1005,6 +989,7 @@ public com.google.protobuf.ByteString getClusterBytes() {
             return (com.google.protobuf.ByteString) ref;
           }
         }
    +
         /**
          *
          *
    @@ -1025,11 +1010,12 @@ public Builder setCluster(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           cluster_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1046,11 +1032,12 @@ public Builder setCluster(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearCluster() {
    -
           cluster_ = getDefaultInstance().getCluster();
    +      bitField0_ = (bitField0_ & ~0x00000002);
           onChanged();
           return this;
         }
    +
         /**
          *
          *
    @@ -1072,20 +1059,21 @@ public Builder setClusterBytes(com.google.protobuf.ByteString value) {
             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
    +     * 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`.
          * 
    * @@ -1104,13 +1092,14 @@ public java.lang.String getSnapshotId() { 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
    +     * 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`.
          * 
    * @@ -1129,13 +1118,14 @@ public com.google.protobuf.ByteString getSnapshotIdBytes() { 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
    +     * 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`.
          * 
    * @@ -1148,18 +1138,19 @@ 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
    +     * 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`.
          * 
    * @@ -1168,18 +1159,19 @@ public Builder setSnapshotId(java.lang.String value) { * @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
    +     * 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`.
          * 
    * @@ -1193,18 +1185,19 @@ public Builder setSnapshotIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - snapshotId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.protobuf.Duration ttl_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> ttlBuilder_; + /** * * @@ -1220,8 +1213,9 @@ public Builder setSnapshotIdBytes(com.google.protobuf.ByteString value) { * @return Whether the ttl field is set. */ public boolean hasTtl() { - return ttlBuilder_ != null || ttl_ != null; + return ((bitField0_ & 0x00000008) != 0); } + /** * * @@ -1243,6 +1237,7 @@ public com.google.protobuf.Duration getTtl() { return ttlBuilder_.getMessage(); } } + /** * * @@ -1261,13 +1256,14 @@ public Builder setTtl(com.google.protobuf.Duration value) { throw new NullPointerException(); } ttl_ = value; - onChanged(); } else { ttlBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1283,13 +1279,14 @@ public Builder setTtl(com.google.protobuf.Duration value) { public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { if (ttlBuilder_ == null) { ttl_ = builderForValue.build(); - onChanged(); } else { ttlBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } + /** * * @@ -1304,18 +1301,23 @@ public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { */ public Builder mergeTtl(com.google.protobuf.Duration value) { if (ttlBuilder_ == null) { - if (ttl_ != null) { - ttl_ = com.google.protobuf.Duration.newBuilder(ttl_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000008) != 0) + && ttl_ != null + && ttl_ != com.google.protobuf.Duration.getDefaultInstance()) { + getTtlBuilder().mergeFrom(value); } else { ttl_ = value; } - onChanged(); } else { ttlBuilder_.mergeFrom(value); } - + if (ttl_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } return this; } + /** * * @@ -1329,16 +1331,16 @@ public Builder mergeTtl(com.google.protobuf.Duration value) { * .google.protobuf.Duration ttl = 4; */ public Builder clearTtl() { - if (ttlBuilder_ == null) { - ttl_ = null; - onChanged(); - } else { - ttl_ = null; + bitField0_ = (bitField0_ & ~0x00000008); + ttl_ = null; + if (ttlBuilder_ != null) { + ttlBuilder_.dispose(); ttlBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1352,10 +1354,11 @@ public Builder clearTtl() { * .google.protobuf.Duration ttl = 4; */ public com.google.protobuf.Duration.Builder getTtlBuilder() { - + bitField0_ |= 0x00000008; onChanged(); - return getTtlFieldBuilder().getBuilder(); + return internalGetTtlFieldBuilder().getBuilder(); } + /** * * @@ -1375,6 +1378,7 @@ public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { return ttl_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ttl_; } } + /** * * @@ -1387,14 +1391,14 @@ public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { * * .google.protobuf.Duration ttl = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTtlFieldBuilder() { + internalGetTtlFieldBuilder() { if (ttlBuilder_ == null) { ttlBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>(getTtl(), getParentForChildren(), isClean()); @@ -1404,6 +1408,7 @@ public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { } private java.lang.Object description_ = ""; + /** * * @@ -1426,6 +1431,7 @@ public java.lang.String getDescription() { return (java.lang.String) ref; } } + /** * * @@ -1448,6 +1454,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1464,11 +1471,12 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -1481,11 +1489,12 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } + /** * * @@ -1503,23 +1512,12 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.SnapshotTableRequest) } @@ -1541,7 +1539,18 @@ public SnapshotTableRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SnapshotTableRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java index 292359964b..2934d11ce9 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotTableRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -39,6 +42,7 @@ public interface SnapshotTableRequestOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -72,6 +76,7 @@ public interface SnapshotTableRequestOrBuilder * @return The cluster. */ java.lang.String getCluster(); + /** * * @@ -93,9 +98,9 @@ public interface SnapshotTableRequestOrBuilder * * *
    -   * 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
    +   * 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`.
        * 
    * @@ -104,13 +109,14 @@ public interface SnapshotTableRequestOrBuilder * @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
    +   * 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`.
        * 
    * @@ -135,6 +141,7 @@ public interface SnapshotTableRequestOrBuilder * @return Whether the ttl field is set. */ boolean hasTtl(); + /** * * @@ -150,6 +157,7 @@ public interface SnapshotTableRequestOrBuilder * @return The ttl. */ com.google.protobuf.Duration getTtl(); + /** * * @@ -176,6 +184,7 @@ public interface SnapshotTableRequestOrBuilder * @return The description. */ java.lang.String getDescription(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWrites.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWrites.java new file mode 100644 index 0000000000..34d19e9d61 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWritesOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWritesOrBuilder.java new file mode 100644 index 0000000000..13ab9e7191 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java index 7a408f3c89..91de4a987d 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StorageType.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,6 +29,7 @@ * * Protobuf enum {@code google.bigtable.admin.v2.StorageType} */ +@com.google.protobuf.Generated public enum StorageType implements com.google.protobuf.ProtocolMessageEnum { /** * @@ -61,6 +64,16 @@ public enum StorageType implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "StorageType"); + } + /** * * @@ -71,6 +84,7 @@ public enum StorageType implements com.google.protobuf.ProtocolMessageEnum { * STORAGE_TYPE_UNSPECIFIED = 0; */ public static final int STORAGE_TYPE_UNSPECIFIED_VALUE = 0; + /** * * @@ -81,6 +95,7 @@ public enum StorageType implements com.google.protobuf.ProtocolMessageEnum { * SSD = 1; */ public static final int SSD_VALUE = 1; + /** * * @@ -150,7 +165,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.CommonProto.getDescriptor().getEnumTypes().get(0); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java index c319d8b89f..aeb1008982 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.admin.v2.Table} */ -public final class Table extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Table(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,123 +57,6 @@ private Table() { granularity_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Table(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Table( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - clusterStates_ = - com.google.protobuf.MapField.newMapField( - ClusterStatesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000001; - } - com.google.protobuf.MapEntry< - java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> - clusterStates__ = - input.readMessage( - ClusterStatesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - clusterStates_ - .getMutableMap() - .put(clusterStates__.getKey(), clusterStates__.getValue()); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - columnFamilies_ = - com.google.protobuf.MapField.newMapField( - ColumnFamiliesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry< - java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> - columnFamilies__ = - input.readMessage( - ColumnFamiliesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - columnFamilies_ - .getMutableMap() - .put(columnFamilies__.getKey(), columnFamilies__.getValue()); - break; - } - case 32: - { - int rawValue = input.readEnum(); - - granularity_ = rawValue; - break; - } - case 50: - { - com.google.bigtable.admin.v2.RestoreInfo.Builder subBuilder = null; - if (restoreInfo_ != null) { - subBuilder = restoreInfo_.toBuilder(); - } - restoreInfo_ = - input.readMessage( - com.google.bigtable.admin.v2.RestoreInfo.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(restoreInfo_); - restoreInfo_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Table_descriptor; @@ -167,7 +64,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @SuppressWarnings({"rawtypes"}) @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField(int number) { + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { switch (number) { case 2: return internalGetClusterStates(); @@ -179,7 +77,7 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Table_fieldAccessorTable @@ -223,6 +121,16 @@ public enum TimestampGranularity implements com.google.protobuf.ProtocolMessageE UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TimestampGranularity"); + } + /** * * @@ -234,6 +142,7 @@ public enum TimestampGranularity implements com.google.protobuf.ProtocolMessageE * TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; */ public static final int TIMESTAMP_GRANULARITY_UNSPECIFIED_VALUE = 0; + /** * * @@ -303,7 +212,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Table.getDescriptor().getEnumTypes().get(0); } @@ -384,7 +293,7 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * * *
    -     * Only populates 'name' and fields related to the table's encryption state.
    +     * Only populates `name` and fields related to the table's encryption state.
          * 
    * * ENCRYPTION_VIEW = 5; @@ -403,6 +312,16 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "View"); + } + /** * * @@ -413,6 +332,7 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * VIEW_UNSPECIFIED = 0; */ public static final int VIEW_UNSPECIFIED_VALUE = 0; + /** * * @@ -423,6 +343,7 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * NAME_ONLY = 1; */ public static final int NAME_ONLY_VALUE = 1; + /** * * @@ -433,6 +354,7 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * SCHEMA_VIEW = 2; */ public static final int SCHEMA_VIEW_VALUE = 2; + /** * * @@ -444,16 +366,18 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * REPLICATION_VIEW = 3; */ public static final int REPLICATION_VIEW_VALUE = 3; + /** * * *
    -     * Only populates 'name' and fields related to the table's encryption state.
    +     * Only populates `name` and fields related to the table's encryption state.
          * 
    * * ENCRYPTION_VIEW = 5; */ public static final int ENCRYPTION_VIEW_VALUE = 5; + /** * * @@ -529,7 +453,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Table.getDescriptor().getEnumTypes().get(1); } @@ -566,12 +490,14 @@ public interface ClusterStateOrBuilder * Output only. The state of replication for the table in this cluster. *
    * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .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(); + /** * * @@ -579,7 +505,8 @@ public interface ClusterStateOrBuilder * Output only. The state of replication for the table in this cluster. *
    * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * * @return The replicationState. @@ -602,6 +529,7 @@ public interface ClusterStateOrBuilder * */ java.util.List getEncryptionInfoList(); + /** * * @@ -618,6 +546,7 @@ public interface ClusterStateOrBuilder * */ com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index); + /** * * @@ -634,6 +563,7 @@ public interface ClusterStateOrBuilder * */ int getEncryptionInfoCount(); + /** * * @@ -651,6 +581,7 @@ public interface ClusterStateOrBuilder */ java.util.List getEncryptionInfoOrBuilderList(); + /** * * @@ -668,6 +599,7 @@ public interface ClusterStateOrBuilder */ com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(int index); } + /** * * @@ -677,13 +609,24 @@ public interface ClusterStateOrBuilder * * Protobuf type {@code google.bigtable.admin.v2.Table.ClusterState} */ - public static final class ClusterState extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private ClusterState(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -692,84 +635,13 @@ private ClusterState() { encryptionInfo_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ClusterState(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClusterState( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - int rawValue = input.readEnum(); - - replicationState_ = rawValue; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - encryptionInfo_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - encryptionInfo_.add( - input.readMessage( - com.google.bigtable.admin.v2.EncryptionInfo.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - encryptionInfo_ = java.util.Collections.unmodifiableList(encryptionInfo_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable @@ -859,6 +731,16 @@ public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum UNRECOGNIZED(-1), ; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReplicationState"); + } + /** * * @@ -869,6 +751,7 @@ public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum * STATE_NOT_KNOWN = 0; */ public static final int STATE_NOT_KNOWN_VALUE = 0; + /** * * @@ -881,6 +764,7 @@ public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum * INITIALIZING = 1; */ public static final int INITIALIZING_VALUE = 1; + /** * * @@ -892,6 +776,7 @@ public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum * PLANNED_MAINTENANCE = 2; */ public static final int PLANNED_MAINTENANCE_VALUE = 2; + /** * * @@ -903,6 +788,7 @@ public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum * UNPLANNED_MAINTENANCE = 3; */ public static final int UNPLANNED_MAINTENANCE_VALUE = 3; + /** * * @@ -915,6 +801,7 @@ public enum ReplicationState implements com.google.protobuf.ProtocolMessageEnum * READY = 4; */ public static final int READY_VALUE = 4; + /** * * @@ -994,7 +881,7 @@ public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType return getDescriptor(); } - public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + public static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { return com.google.bigtable.admin.v2.Table.ClusterState.getDescriptor() .getEnumTypes() .get(0); @@ -1023,7 +910,8 @@ private ReplicationState(int value) { } public static final int REPLICATION_STATE_FIELD_NUMBER = 1; - private int replicationState_; + private int replicationState_ = 0; + /** * * @@ -1031,7 +919,8 @@ private ReplicationState(int value) { * Output only. The state of replication for the table in this cluster. *
    * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .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. @@ -1040,6 +929,7 @@ private ReplicationState(int value) { public int getReplicationStateValue() { return replicationState_; } + /** * * @@ -1047,16 +937,16 @@ public 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.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() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState result = - com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.valueOf( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.forNumber( replicationState_); return result == null ? com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.UNRECOGNIZED @@ -1064,7 +954,10 @@ public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getRepli } public static final int ENCRYPTION_INFO_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List encryptionInfo_; + /** * * @@ -1084,6 +977,7 @@ public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getRepli public java.util.List getEncryptionInfoList() { return encryptionInfo_; } + /** * * @@ -1104,6 +998,7 @@ public java.util.List getEncryption getEncryptionInfoOrBuilderList() { return encryptionInfo_; } + /** * * @@ -1123,6 +1018,7 @@ public java.util.List getEncryption public int getEncryptionInfoCount() { return encryptionInfo_.size(); } + /** * * @@ -1142,6 +1038,7 @@ public int getEncryptionInfoCount() { public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index) { return encryptionInfo_.get(index); } + /** * * @@ -1185,7 +1082,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < encryptionInfo_.size(); i++) { output.writeMessage(2, encryptionInfo_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1202,7 +1099,7 @@ public int getSerializedSize() { for (int i = 0; i < encryptionInfo_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, encryptionInfo_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1220,7 +1117,7 @@ public boolean equals(final java.lang.Object obj) { if (replicationState_ != other.replicationState_) return false; if (!getEncryptionInfoList().equals(other.getEncryptionInfoList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1237,7 +1134,7 @@ public int hashCode() { hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; hash = (53 * hash) + getEncryptionInfoList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1279,38 +1176,38 @@ public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( public static com.google.bigtable.admin.v2.Table.ClusterState parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1333,11 +1230,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1347,8 +1244,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.admin.v2.Table.ClusterState} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1358,7 +1254,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable @@ -1368,32 +1264,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.Table.ClusterState.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEncryptionInfoFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; replicationState_ = 0; - if (encryptionInfoBuilder_ == null) { encryptionInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + encryptionInfo_ = null; encryptionInfoBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -1421,54 +1309,32 @@ public com.google.bigtable.admin.v2.Table.ClusterState build() { 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); - int from_bitField0_ = bitField0_; - result.replicationState_ = replicationState_; + 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_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { encryptionInfo_ = java.util.Collections.unmodifiableList(encryptionInfo_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.encryptionInfo_ = encryptionInfo_; } else { result.encryptionInfo_ = encryptionInfoBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -1491,7 +1357,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Table.ClusterState other) if (!other.encryptionInfo_.isEmpty()) { if (encryptionInfo_.isEmpty()) { encryptionInfo_ = other.encryptionInfo_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureEncryptionInfoIsMutable(); encryptionInfo_.addAll(other.encryptionInfo_); @@ -1504,17 +1370,17 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Table.ClusterState other) encryptionInfoBuilder_.dispose(); encryptionInfoBuilder_ = null; encryptionInfo_ = other.encryptionInfo_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); encryptionInfoBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEncryptionInfoFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEncryptionInfoFieldBuilder() : null; } else { encryptionInfoBuilder_.addAllMessages(other.encryptionInfo_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1529,24 +1395,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.Table.ClusterState parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.Table.ClusterState) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private int replicationState_ = 0; + /** * * @@ -1554,7 +1453,8 @@ public Builder mergeFrom( * Output only. The state of replication for the table in this cluster. * * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .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. @@ -1563,6 +1463,7 @@ public Builder mergeFrom( public int getReplicationStateValue() { return replicationState_; } + /** * * @@ -1570,18 +1471,20 @@ public 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.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; } + /** * * @@ -1589,7 +1492,8 @@ public Builder setReplicationStateValue(int value) { * Output only. The state of replication for the table in this cluster. * * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * * @return The replicationState. @@ -1597,14 +1501,14 @@ public Builder setReplicationStateValue(int value) { @java.lang.Override public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getReplicationState() { - @SuppressWarnings("deprecation") com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState result = - com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.valueOf( + com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.forNumber( replicationState_); return result == null ? com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState.UNRECOGNIZED : result; } + /** * * @@ -1612,7 +1516,8 @@ public Builder setReplicationStateValue(int value) { * Output only. The state of replication for the table in this cluster. * * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * * * @param value The replicationState to set. @@ -1623,11 +1528,12 @@ public Builder setReplicationState( if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; replicationState_ = value.getNumber(); onChanged(); return this; } + /** * * @@ -1635,13 +1541,14 @@ public Builder setReplicationState( * Output only. The state of replication for the table in this cluster. * * - * .google.bigtable.admin.v2.Table.ClusterState.ReplicationState replication_state = 1; + * + * .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; @@ -1651,14 +1558,14 @@ public Builder clearReplicationState() { java.util.Collections.emptyList(); private void ensureEncryptionInfoIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { encryptionInfo_ = new java.util.ArrayList(encryptionInfo_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.EncryptionInfo, com.google.bigtable.admin.v2.EncryptionInfo.Builder, com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> @@ -1686,6 +1593,7 @@ public java.util.List getEncryption return encryptionInfoBuilder_.getMessageList(); } } + /** * * @@ -1708,6 +1616,7 @@ public int getEncryptionInfoCount() { return encryptionInfoBuilder_.getCount(); } } + /** * * @@ -1730,6 +1639,7 @@ public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index) return encryptionInfoBuilder_.getMessage(index); } } + /** * * @@ -1759,6 +1669,7 @@ public Builder setEncryptionInfo( } return this; } + /** * * @@ -1785,6 +1696,7 @@ public Builder setEncryptionInfo( } return this; } + /** * * @@ -1813,6 +1725,7 @@ public Builder addEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo val } return this; } + /** * * @@ -1842,6 +1755,7 @@ public Builder addEncryptionInfo( } return this; } + /** * * @@ -1868,6 +1782,7 @@ public Builder addEncryptionInfo( } return this; } + /** * * @@ -1894,6 +1809,7 @@ public Builder addEncryptionInfo( } return this; } + /** * * @@ -1920,6 +1836,7 @@ public Builder addAllEncryptionInfo( } return this; } + /** * * @@ -1938,13 +1855,14 @@ public Builder addAllEncryptionInfo( public Builder clearEncryptionInfo() { if (encryptionInfoBuilder_ == null) { encryptionInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { encryptionInfoBuilder_.clear(); } return this; } + /** * * @@ -1970,6 +1888,7 @@ public Builder removeEncryptionInfo(int index) { } return this; } + /** * * @@ -1987,8 +1906,9 @@ public Builder removeEncryptionInfo(int index) { */ public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder( int index) { - return getEncryptionInfoFieldBuilder().getBuilder(index); + return internalGetEncryptionInfoFieldBuilder().getBuilder(index); } + /** * * @@ -2012,6 +1932,7 @@ public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrB return encryptionInfoBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2035,6 +1956,7 @@ public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrB return java.util.Collections.unmodifiableList(encryptionInfo_); } } + /** * * @@ -2051,9 +1973,10 @@ public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrB * */ public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuilder() { - return getEncryptionInfoFieldBuilder() + return internalGetEncryptionInfoFieldBuilder() .addBuilder(com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()); } + /** * * @@ -2071,9 +1994,10 @@ public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuil */ public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuilder( int index) { - return getEncryptionInfoFieldBuilder() + return internalGetEncryptionInfoFieldBuilder() .addBuilder(index, com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()); } + /** * * @@ -2091,22 +2015,22 @@ public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuil */ public java.util.List getEncryptionInfoBuilderList() { - return getEncryptionInfoFieldBuilder().getBuilderList(); + return internalGetEncryptionInfoFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.admin.v2.EncryptionInfo, com.google.bigtable.admin.v2.EncryptionInfo.Builder, com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> - getEncryptionInfoFieldBuilder() { + internalGetEncryptionInfoFieldBuilder() { if (encryptionInfoBuilder_ == null) { encryptionInfoBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + 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_ & 0x00000001) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); encryptionInfo_ = null; @@ -2114,18 +2038,6 @@ public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuil return encryptionInfoBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Table.ClusterState) } @@ -2147,7 +2059,19 @@ public ClusterState parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClusterState(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -2166,210 +2090,1818 @@ public com.google.bigtable.admin.v2.Table.ClusterState getDefaultInstanceForType } } - public static final int NAME_FIELD_NUMBER = 1; - 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 interface AutomatedBackupPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + com.google.protobuf.MessageOrBuilder { - public static final int CLUSTER_STATES_FIELD_NUMBER = 2; + /** + * + * + *
    +     * 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(); - 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()); - } + /** + * + * + *
    +     * 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(); - private com.google.protobuf.MapField< - java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> - clusterStates_; + /** + * + * + *
    +     * 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(); - 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_; - } + /** + * + * + *
    +     * 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(); - public int getClusterStatesCount() { - return internalGetClusterStates().getMap().size(); + /** + * + * + *
    +     * 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); } + /** * * *
    -   * 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`
    +   * Defines an automated backup policy for a table
        * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; - * + * Protobuf type {@code google.bigtable.admin.v2.Table.AutomatedBackupPolicy} */ - @java.lang.Override - public boolean containsClusterStates(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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"); } - 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; - * - */ - @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; - * - */ - @java.lang.Override - public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( - java.lang.String key, com.google.bigtable.admin.v2.Table.ClusterState defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); + + // Use AutomatedBackupPolicy.newBuilder() to construct. + private AutomatedBackupPolicy(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - 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; - * - */ - @java.lang.Override - public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow( - java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + + private AutomatedBackupPolicy() { + locations_ = com.google.protobuf.LazyStringArrayList.emptyList(); } - java.util.Map map = - internalGetClusterStates().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + + 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; } - return map.get(key); - } - public static final int COLUMN_FAMILIES_FIELD_NUMBER = 3; + @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 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()); - } + private int bitField0_; + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; - private com.google.protobuf.MapField - columnFamilies_; + /** + * + * + *
    +     * 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() { @@ -2377,1454 +3909,3828 @@ private static final class ColumnFamiliesDefaultEntryHolder { return com.google.protobuf.MapField.emptyMapField( ColumnFamiliesDefaultEntryHolder.defaultEntry); } - return columnFamilies_; - } + 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_; + } - public int getColumnFamiliesCount() { - return internalGetColumnFamilies().getMap().size(); - } - /** - * - * - *
    -   * (`CreationOnly`)
    -   * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_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 java.lang.NullPointerException(); + 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(); + } } - return internalGetColumnFamilies().getMap().containsKey(key); - } - /** Use {@link #getColumnFamiliesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map - getColumnFamilies() { - return getColumnFamiliesMap(); - } - /** - * - * - *
    -   * (`CreationOnly`)
    -   * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    -   * 
    - * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; - */ - @java.lang.Override - public java.util.Map - getColumnFamiliesMap() { - return internalGetColumnFamilies().getMap(); - } - /** - * - * - *
    -   * (`CreationOnly`)
    -   * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    -   * 
    - * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; - */ - @java.lang.Override - public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( - java.lang.String key, com.google.bigtable.admin.v2.ColumnFamily defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); + + @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; + } } - java.util.Map map = - internalGetColumnFamilies().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * - * - *
    -   * (`CreationOnly`)
    -   * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_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 java.lang.NullPointerException(); + + 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.util.Map map = - internalGetColumnFamilies().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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; } - return map.get(key); - } - public static final int GRANULARITY_FIELD_NUMBER = 4; - private int granularity_; - /** - * - * - *
    -   * (`CreationOnly`)
    -   * 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; - * - * @return The enum numeric value on the wire for granularity. - */ - @java.lang.Override - public int getGranularityValue() { - return granularity_; - } - /** - * - * - *
    -   * (`CreationOnly`)
    -   * 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; - * - * @return The granularity. - */ - @java.lang.Override - public com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity() { - @SuppressWarnings("deprecation") - com.google.bigtable.admin.v2.Table.TimestampGranularity result = - com.google.bigtable.admin.v2.Table.TimestampGranularity.valueOf(granularity_); - return result == null - ? com.google.bigtable.admin.v2.Table.TimestampGranularity.UNRECOGNIZED - : result; - } + /** + * + * + *
    +     * 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; + } - 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; - * - * @return Whether the restoreInfo field is set. - */ - @java.lang.Override - public boolean hasRestoreInfo() { - return restoreInfo_ != null; - } - /** - * - * - *
    -   * 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; - * - * @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; - */ - @java.lang.Override - public com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { - return getRestoreInfo(); - } + 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(); + } - private byte memoizedIsInitialized = -1; + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + defaultEntry() { + return ClusterStatesDefaultEntryHolder.defaultEntry; + } + } + ; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private static final ClusterStatesConverter clusterStatesConverter = + new ClusterStatesConverter(); - memoizedIsInitialized = 1; - return true; - } + 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_; - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetClusterStates(), ClusterStatesDefaultEntryHolder.defaultEntry, 2); - com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( - output, internalGetColumnFamilies(), ColumnFamiliesDefaultEntryHolder.defaultEntry, 3); - if (granularity_ - != com.google.bigtable.admin.v2.Table.TimestampGranularity.TIMESTAMP_GRANULARITY_UNSPECIFIED - .getNumber()) { - output.writeEnum(4, granularity_); + 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_; } - if (restoreInfo_ != null) { - output.writeMessage(6, getRestoreInfo()); + + 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_; } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + public int getClusterStatesCount() { + return internalGetClusterStates().ensureBuilderMap().size(); + } - size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + /** + * + * + *
    +     * 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); } - 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__); + + /** Use {@link #getClusterStatesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getClusterStates() { + return getClusterStatesMap(); } - 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__); + + /** + * + * + *
    +     * 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(); } - if (granularity_ - != com.google.bigtable.admin.v2.Table.TimestampGranularity.TIMESTAMP_GRANULARITY_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, granularity_); + + /** + * + * + *
    +     * 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; } - if (restoreInfo_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getRestoreInfo()); + + /** + * + * + *
    +     * 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)); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + public Builder clearClusterStates() { + bitField0_ = (bitField0_ & ~0x00000002); + internalGetMutableClusterStates().clear(); + return this; } - if (!(obj instanceof com.google.bigtable.admin.v2.Table)) { - return super.equals(obj); + + /** + * + * + *
    +     * 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; } - 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; + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableClusterStates() { + bitField0_ |= 0x00000002; + return internalGetMutableClusterStates().ensureMessageMap(); } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + * + * + *
    +     * 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; } - 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(); + + /** + * + * + *
    +     * 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; } - if (!internalGetColumnFamilies().getMap().isEmpty()) { - hash = (37 * hash) + COLUMN_FAMILIES_FIELD_NUMBER; - hash = (53 * hash) + internalGetColumnFamilies().hashCode(); + + /** + * + * + *
    +     * 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; } - hash = (37 * hash) + GRANULARITY_FIELD_NUMBER; - hash = (53 * hash) + granularity_; - if (hasRestoreInfo()) { - hash = (37 * hash) + RESTORE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getRestoreInfo().hashCode(); + + 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; + } } - hash = (29 * hash) + unknownFields.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); - } + private static final ColumnFamiliesConverter columnFamiliesConverter = + new ColumnFamiliesConverter(); - 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); - } + 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_; - public static com.google.bigtable.admin.v2.Table parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + 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_; + } - 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); - } + 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 static com.google.bigtable.admin.v2.Table parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + public int getColumnFamiliesCount() { + return internalGetColumnFamilies().ensureBuilderMap().size(); + } - 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); - } + /** + * + * + *
    +     * 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); + } - public static com.google.bigtable.admin.v2.Table parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + /** Use {@link #getColumnFamiliesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getColumnFamilies() { + return getColumnFamiliesMap(); + } - 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.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + /** + * + * + *
    +     * 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 static com.google.bigtable.admin.v2.Table parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } + public Builder clearColumnFamilies() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableColumnFamilies().clear(); + return this; + } - 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.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + /** + * + * + *
    +     * 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; + } - public static com.google.bigtable.admin.v2.Table parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableColumnFamilies() { + bitField0_ |= 0x00000004; + return internalGetMutableColumnFamilies().ensureMessageMap(); + } - 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.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + /** + * + * + *
    +     * 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; + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + /** + * + * + *
    +     * 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; + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + /** + * + * + *
    +     * 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; + } - public static Builder newBuilder(com.google.bigtable.admin.v2.Table prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + private int granularity_ = 0; - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(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 enum numeric value on the wire for granularity. + */ + @java.lang.Override + public int getGranularityValue() { + return granularity_; + } - @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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; + /** + * + * + *
    +     * 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; } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField(int number) { - switch (number) { - case 2: - return internalGetClusterStates(); - case 3: - return internalGetColumnFamilies(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } + /** + * + * + *
    +     * 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; } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField(int number) { - switch (number) { - case 2: - return internalGetMutableClusterStates(); - case 3: - return internalGetMutableColumnFamilies(); - default: - throw new RuntimeException("Invalid map field number: " + number); + /** + * + * + *
    +     * 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; } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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); + /** + * + * + *
    +     * 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; } - // Construct using com.google.bigtable.admin.v2.Table.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + 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_; - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * + * + *
    +     * 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); } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + /** + * + * + *
    +     * 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(); + } } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - internalGetMutableClusterStates().clear(); - internalGetMutableColumnFamilies().clear(); - granularity_ = 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]; + * + */ + public Builder setRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { if (restoreInfoBuilder_ == null) { - restoreInfo_ = null; + if (value == null) { + throw new NullPointerException(); + } + restoreInfo_ = value; } else { - restoreInfo_ = null; - restoreInfoBuilder_ = null; + restoreInfoBuilder_.setMessage(value); } + bitField0_ |= 0x00000010; + onChanged(); 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); + /** + * + * + *
    +     * 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()); } - return result; + bitField0_ |= 0x00000010; + onChanged(); + return this; } - @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); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.clusterStates_ = internalGetClusterStates(); - result.clusterStates_.makeImmutable(); - result.columnFamilies_ = internalGetColumnFamilies(); - result.columnFamilies_.makeImmutable(); - result.granularity_ = granularity_; + /** + * + * + *
    +     * 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) { - result.restoreInfo_ = restoreInfo_; + if (((bitField0_ & 0x00000010) != 0) + && restoreInfo_ != null + && restoreInfo_ != com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance()) { + getRestoreInfoBuilder().mergeFrom(value); + } else { + restoreInfo_ = value; + } } else { - result.restoreInfo_ = restoreInfoBuilder_.build(); + restoreInfoBuilder_.mergeFrom(value); } - onBuilt(); - return result; + if (restoreInfo_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; } - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
    +     * 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(); } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
    +     * 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_; + } } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
    +     * 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_; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } + 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_; - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
    +     * 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); } - @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); + /** + * + * + *
    +     * 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 { - 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_; - onChanged(); - } - internalGetMutableClusterStates().mergeFrom(other.internalGetClusterStates()); - internalGetMutableColumnFamilies().mergeFrom(other.internalGetColumnFamilies()); - if (other.granularity_ != 0) { - setGranularityValue(other.getGranularityValue()); - } - if (other.hasRestoreInfo()) { - mergeRestoreInfo(other.getRestoreInfo()); + return changeStreamConfigBuilder_.getMessage(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.admin.v2.Table parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.bigtable.admin.v2.Table) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + /** + * + * + *
    +     * 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; } - 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`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * string name = 1; - * - * @return The name. + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - 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; + public Builder setChangeStreamConfig( + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder builderForValue) { + if (changeStreamConfigBuilder_ == null) { + changeStreamConfig_ = builderForValue.build(); } else { - return (java.lang.String) ref; + changeStreamConfigBuilder_.setMessage(builderForValue.build()); } + bitField0_ |= 0x00000020; + 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`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * string name = 1; - * - * @return The bytes for name. + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - 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; + 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 { - return (com.google.protobuf.ByteString) ref; + changeStreamConfigBuilder_.mergeFrom(value); + } + if (changeStreamConfig_ != null) { + bitField0_ |= 0x00000020; + 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`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder clearChangeStreamConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + changeStreamConfig_ = null; + if (changeStreamConfigBuilder_ != null) { + changeStreamConfigBuilder_.dispose(); + changeStreamConfigBuilder_ = null; } - - name_ = value; 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`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * string name = 1; - * - * @return This builder for chaining. + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); + public com.google.bigtable.admin.v2.ChangeStreamConfig.Builder getChangeStreamConfigBuilder() { + bitField0_ |= 0x00000020; onChanged(); - return this; + return internalGetChangeStreamConfigFieldBuilder().getBuilder(); } + /** * * *
    -     * 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`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + 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_; } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; } - 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); + /** + * + * + *
    +     * 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 clusterStates_; + return changeStreamConfigBuilder_; } - private com.google.protobuf.MapField< - java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> - internalGetMutableClusterStates() { - onChanged(); - ; - if (clusterStates_ == null) { - clusterStates_ = - com.google.protobuf.MapField.newMapField(ClusterStatesDefaultEntryHolder.defaultEntry); - } - if (!clusterStates_.isMutable()) { - clusterStates_ = clusterStates_.copy(); - } - return clusterStates_; - } + private boolean deletionProtection_; - 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; - * + * bool deletion_protection = 9; + * + * @return The deletionProtection. */ @java.lang.Override - public boolean containsClusterStates(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - return internalGetClusterStates().getMap().containsKey(key); + public boolean getDeletionProtection() { + return deletionProtection_; } - /** Use {@link #getClusterStatesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map - getClusterStates() { - return getClusterStatesMap(); + + /** + * + * + *
    +     * 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; } + /** * * *
    -     * 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; - * + * bool deletion_protection = 9; + * + * @return This builder for chaining. */ - @java.lang.Override - public java.util.Map - getClusterStatesMap() { - return internalGetClusterStates().getMap(); + 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_; + /** * * *
    -     * 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`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; * + * + * @return Whether the automatedBackupPolicy field is set. */ @java.lang.Override - public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( - java.lang.String key, com.google.bigtable.admin.v2.Table.ClusterState defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetClusterStates().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + public boolean hasAutomatedBackupPolicy() { + return automatedBackupConfigCase_ == 13; } + /** * * *
    -     * 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`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; * + * + * @return The automatedBackupPolicy. */ @java.lang.Override - public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow( - java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetClusterStates().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + 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(); } - return map.get(key); } - public Builder clearClusterStates() { - internalGetMutableClusterStates().getMutableMap().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`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; * */ - public Builder removeClusterStates(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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); } - internalGetMutableClusterStates().getMutableMap().remove(key); + automatedBackupConfigCase_ = 13; return this; } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map - getMutableClusterStates() { - return internalGetMutableClusterStates().getMutableMap(); - } + /** * * *
    -     * 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`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; * */ - public Builder putClusterStates( - java.lang.String key, com.google.bigtable.admin.v2.Table.ClusterState value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); + public Builder setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder builderForValue) { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupConfig_ = builderForValue.build(); + onChanged(); + } else { + automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); } - internalGetMutableClusterStates().getMutableMap().put(key, value); + automatedBackupConfigCase_ = 13; 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`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; * */ - public Builder putAllClusterStates( - java.util.Map values) { - internalGetMutableClusterStates().getMutableMap().putAll(values); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> - columnFamilies_; - - private com.google.protobuf.MapField< - java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> - internalGetColumnFamilies() { - if (columnFamilies_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ColumnFamiliesDefaultEntryHolder.defaultEntry); - } - return columnFamilies_; - } - - private com.google.protobuf.MapField< - java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> - internalGetMutableColumnFamilies() { - onChanged(); - ; - if (columnFamilies_ == null) { - columnFamilies_ = - com.google.protobuf.MapField.newMapField(ColumnFamiliesDefaultEntryHolder.defaultEntry); - } - if (!columnFamilies_.isMutable()) { - columnFamilies_ = columnFamilies_.copy(); + 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); + } } - return columnFamilies_; + automatedBackupConfigCase_ = 13; + return this; } - public int getColumnFamiliesCount() { - return internalGetColumnFamilies().getMap().size(); - } /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - @java.lang.Override - public boolean containsColumnFamilies(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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 internalGetColumnFamilies().getMap().containsKey(key); - } - /** Use {@link #getColumnFamiliesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map - getColumnFamilies() { - return getColumnFamiliesMap(); + return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - @java.lang.Override - public java.util.Map - getColumnFamiliesMap() { - return internalGetColumnFamilies().getMap(); + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder + getAutomatedBackupPolicyBuilder() { + return internalGetAutomatedBackupPolicyFieldBuilder().getBuilder(); } + /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ @java.lang.Override - public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( - java.lang.String key, com.google.bigtable.admin.v2.ColumnFamily defaultValue) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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(); } - java.util.Map map = - internalGetColumnFamilies().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; } + /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - @java.lang.Override - public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrThrow( - java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - java.util.Map map = - internalGetColumnFamilies().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + 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; } - return map.get(key); + automatedBackupConfigCase_ = 13; + onChanged(); + return automatedBackupPolicyBuilder_; } - public Builder clearColumnFamilies() { - internalGetMutableColumnFamilies().getMutableMap().clear(); - return this; + 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); } + /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; + * + * @return The tieredStorageConfig. */ - public Builder removeColumnFamilies(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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(); } - internalGetMutableColumnFamilies().getMutableMap().remove(key); - return this; - } - /** Use alternate mutation accessors instead. */ - @java.lang.Deprecated - public java.util.Map - getMutableColumnFamilies() { - return internalGetMutableColumnFamilies().getMutableMap(); } + /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - public Builder putColumnFamilies( - java.lang.String key, com.google.bigtable.admin.v2.ColumnFamily value) { - if (key == null) { - throw new java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); + 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); } - internalGetMutableColumnFamilies().getMutableMap().put(key, value); + bitField0_ |= 0x00000100; + onChanged(); return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - public Builder putAllColumnFamilies( - java.util.Map values) { - internalGetMutableColumnFamilies().getMutableMap().putAll(values); + 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; } - private int granularity_ = 0; /** * * *
    -     * (`CreationOnly`)
    -     * 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`.
    +     * 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.Table.TimestampGranularity granularity = 4; - * - * @return The enum numeric value on the wire for granularity. + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - @java.lang.Override - public int getGranularityValue() { - return granularity_; + 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; } + /** * * *
    -     * (`CreationOnly`)
    -     * 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`.
    +     * 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.Table.TimestampGranularity granularity = 4; - * - * @param value The enum numeric value on the wire for granularity to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - public Builder setGranularityValue(int value) { - - granularity_ = value; + public Builder clearTieredStorageConfig() { + bitField0_ = (bitField0_ & ~0x00000100); + tieredStorageConfig_ = null; + if (tieredStorageConfigBuilder_ != null) { + tieredStorageConfigBuilder_.dispose(); + tieredStorageConfigBuilder_ = null; + } onChanged(); return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * 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`.
    +     * 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.Table.TimestampGranularity granularity = 4; - * - * @return The granularity. + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - @java.lang.Override - public com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity() { - @SuppressWarnings("deprecation") - com.google.bigtable.admin.v2.Table.TimestampGranularity result = - com.google.bigtable.admin.v2.Table.TimestampGranularity.valueOf(granularity_); - return result == null - ? com.google.bigtable.admin.v2.Table.TimestampGranularity.UNRECOGNIZED - : result; + public com.google.bigtable.admin.v2.TieredStorageConfig.Builder + getTieredStorageConfigBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return internalGetTieredStorageConfigFieldBuilder().getBuilder(); } + /** * * *
    -     * (`CreationOnly`)
    -     * 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`.
    +     * 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.Table.TimestampGranularity granularity = 4; - * - * @param value The granularity to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - public Builder setGranularity(com.google.bigtable.admin.v2.Table.TimestampGranularity value) { - if (value == null) { - throw new NullPointerException(); + 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_; } - - granularity_ = value.getNumber(); - onChanged(); - return this; } + /** * * *
    -     * (`CreationOnly`)
    -     * 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`.
    +     * 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.Table.TimestampGranularity granularity = 4; - * - * @return This builder for chaining. + * .google.bigtable.admin.v2.TieredStorageConfig tiered_storage_config = 14; */ - public Builder clearGranularity() { - - granularity_ = 0; - onChanged(); - return this; + 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.RestoreInfo restoreInfo_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.RestoreInfo, - com.google.bigtable.admin.v2.RestoreInfo.Builder, - com.google.bigtable.admin.v2.RestoreInfoOrBuilder> - restoreInfoBuilder_; + 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_; + /** * * *
    -     * 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; * - * @return Whether the restoreInfo field is set. + * @return Whether the rowKeySchema field is set. */ - public boolean hasRestoreInfo() { - return restoreInfoBuilder_ != null || restoreInfo_ != null; + public boolean hasRowKeySchema() { + return ((bitField0_ & 0x00000200) != 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; * - * @return The restoreInfo. + * @return The rowKeySchema. */ - public com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo() { - if (restoreInfoBuilder_ == null) { - return restoreInfo_ == null - ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() - : restoreInfo_; + 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 restoreInfoBuilder_.getMessage(); + return rowKeySchemaBuilder_.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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - public Builder setRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { - if (restoreInfoBuilder_ == null) { + public Builder setRowKeySchema(com.google.bigtable.admin.v2.Type.Struct value) { + if (rowKeySchemaBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - restoreInfo_ = value; - onChanged(); + rowKeySchema_ = value; } else { - restoreInfoBuilder_.setMessage(value); + rowKeySchemaBuilder_.setMessage(value); } - + bitField0_ |= 0x00000200; + 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - public Builder setRestoreInfo( - com.google.bigtable.admin.v2.RestoreInfo.Builder builderForValue) { - if (restoreInfoBuilder_ == null) { - restoreInfo_ = builderForValue.build(); - onChanged(); + public Builder setRowKeySchema( + com.google.bigtable.admin.v2.Type.Struct.Builder builderForValue) { + if (rowKeySchemaBuilder_ == null) { + rowKeySchema_ = builderForValue.build(); } else { - restoreInfoBuilder_.setMessage(builderForValue.build()); + rowKeySchemaBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000200; + 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - public Builder mergeRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { - if (restoreInfoBuilder_ == null) { - if (restoreInfo_ != null) { - restoreInfo_ = - com.google.bigtable.admin.v2.RestoreInfo.newBuilder(restoreInfo_) - .mergeFrom(value) - .buildPartial(); + 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 { - restoreInfo_ = value; + rowKeySchema_ = value; } - onChanged(); } else { - restoreInfoBuilder_.mergeFrom(value); + rowKeySchemaBuilder_.mergeFrom(value); + } + if (rowKeySchema_ != null) { + bitField0_ |= 0x00000200; + 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - public Builder clearRestoreInfo() { - if (restoreInfoBuilder_ == null) { - restoreInfo_ = null; - onChanged(); - } else { - restoreInfo_ = null; - restoreInfoBuilder_ = null; + public Builder clearRowKeySchema() { + bitField0_ = (bitField0_ & ~0x00000200); + rowKeySchema_ = null; + if (rowKeySchemaBuilder_ != null) { + rowKeySchemaBuilder_.dispose(); + rowKeySchemaBuilder_ = 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - public com.google.bigtable.admin.v2.RestoreInfo.Builder getRestoreInfoBuilder() { - + public com.google.bigtable.admin.v2.Type.Struct.Builder getRowKeySchemaBuilder() { + bitField0_ |= 0x00000200; onChanged(); - return getRestoreInfoFieldBuilder().getBuilder(); + return internalGetRowKeySchemaFieldBuilder().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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - public com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { - if (restoreInfoBuilder_ != null) { - return restoreInfoBuilder_.getMessageOrBuilder(); + public com.google.bigtable.admin.v2.Type.StructOrBuilder getRowKeySchemaOrBuilder() { + if (rowKeySchemaBuilder_ != null) { + return rowKeySchemaBuilder_.getMessageOrBuilder(); } else { - return restoreInfo_ == null - ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() - : restoreInfo_; + return rowKeySchema_ == null + ? com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance() + : rowKeySchema_; } } + /** * * *
    -     * 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.
    +     * 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.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Type.Struct row_key_schema = 15; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.RestoreInfo, - com.google.bigtable.admin.v2.RestoreInfo.Builder, - com.google.bigtable.admin.v2.RestoreInfoOrBuilder> - getRestoreInfoFieldBuilder() { - if (restoreInfoBuilder_ == null) { - restoreInfoBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.admin.v2.RestoreInfo, - com.google.bigtable.admin.v2.RestoreInfo.Builder, - com.google.bigtable.admin.v2.RestoreInfoOrBuilder>( - getRestoreInfo(), getParentForChildren(), isClean()); - restoreInfo_ = null; + 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 restoreInfoBuilder_; - } - - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + return rowKeySchemaBuilder_; } // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Table) @@ -3848,7 +7754,18 @@ public Table parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Table(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java index 45ac6098ce..84b258e78d 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { TableName that = ((TableName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) @@ -211,9 +211,9 @@ public Builder setTable(String table) { } private Builder(TableName tableName) { - project = tableName.project; - instance = tableName.instance; - table = tableName.table; + this.project = tableName.project; + this.instance = tableName.instance; + this.table = tableName.table; } public TableName build() { diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java index fe7b9029ef..f82f216bfa 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -37,6 +40,7 @@ public interface TableOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -63,10 +67,12 @@ public interface TableOrBuilder * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ int getClusterStatesCount(); + /** * * @@ -78,14 +84,17 @@ public interface TableOrBuilder * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * 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(); + /** * * @@ -97,11 +106,13 @@ public interface TableOrBuilder * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ java.util.Map getClusterStatesMap(); + /** * * @@ -113,11 +124,16 @@ public interface TableOrBuilder * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * 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, com.google.bigtable.admin.v2.Table.ClusterState defaultValue); + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState defaultValue); + /** * * @@ -129,7 +145,8 @@ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * 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); @@ -138,61 +155,64 @@ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( * * *
    -   * (`CreationOnly`)
        * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
        * 
    * * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; */ int getColumnFamiliesCount(); + /** * * *
    -   * (`CreationOnly`)
        * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    +   * 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(); + /** * * *
    -   * (`CreationOnly`)
        * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
        * 
    * * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; */ java.util.Map getColumnFamiliesMap(); + /** * * *
    -   * (`CreationOnly`)
        * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    +   * 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, com.google.bigtable.admin.v2.ColumnFamily defaultValue); + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.ColumnFamily defaultValue); + /** * * *
    -   * (`CreationOnly`)
        * The column families configured for this table, mapped by column family ID.
    -   * Views: `SCHEMA_VIEW`, `FULL`
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
        * 
    * * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; @@ -203,30 +223,33 @@ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( * * *
    -   * (`CreationOnly`)
    -   * 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`.
    +   * 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.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return The enum numeric value on the wire for granularity. */ int getGranularityValue(); + /** * * *
    -   * (`CreationOnly`)
    -   * 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`.
    +   * 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.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return The granularity. */ @@ -240,11 +263,14 @@ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( * backup), this field will be populated with information about the restore. * * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return Whether the restoreInfo field is set. */ boolean hasRestoreInfo(); + /** * * @@ -253,11 +279,14 @@ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( * backup), this field will be populated with information about the restore. * * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * * @return The restoreInfo. */ com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo(); + /** * * @@ -266,7 +295,375 @@ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( * backup), this field will be populated with information about the restore. * * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * + * .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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java index eafc54bad8..d25349332e 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class TableProto { +@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) { @@ -29,56 +42,96 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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; @@ -88,103 +141,204 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n$google/bigtable/admin/v2/table.proto\022\030" + "\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\036google/protobuf/duration.proto\032\037go" - + "ogle/protobuf/timestamp.proto\032\027google/rp" - + "c/status.proto\"\233\001\n\013RestoreInfo\022@\n\013source" - + "_type\030\001 \001(\0162+.google.bigtable.admin.v2.R" - + "estoreSourceType\022;\n\013backup_info\030\002 \001(\0132$." - + "google.bigtable.admin.v2.BackupInfoH\000B\r\n" - + "\013source_info\"\330\010\n\005Table\022\014\n\004name\030\001 \001(\t\022J\n\016" - + "cluster_states\030\002 \003(\01322.google.bigtable.a" - + "dmin.v2.Table.ClusterStatesEntry\022L\n\017colu" - + "mn_families\030\003 \003(\01323.google.bigtable.admi" - + "n.v2.Table.ColumnFamiliesEntry\022I\n\013granul" - + "arity\030\004 \001(\01624.google.bigtable.admin.v2.T" - + "able.TimestampGranularity\022;\n\014restore_inf" - + "o\030\006 \001(\0132%.google.bigtable.admin.v2.Resto" - + "reInfo\032\301\002\n\014ClusterState\022X\n\021replication_s" - + "tate\030\001 \001(\0162=.google.bigtable.admin.v2.Ta" - + "ble.ClusterState.ReplicationState\022F\n\017enc" - + "ryption_info\030\002 \003(\0132(.google.bigtable.adm" - + "in.v2.EncryptionInfoB\003\340A\003\"\216\001\n\020Replicatio" - + "nState\022\023\n\017STATE_NOT_KNOWN\020\000\022\020\n\014INITIALIZ" - + "ING\020\001\022\027\n\023PLANNED_MAINTENANCE\020\002\022\031\n\025UNPLAN" - + "NED_MAINTENANCE\020\003\022\t\n\005READY\020\004\022\024\n\020READY_OP" - + "TIMIZING\020\005\032b\n\022ClusterStatesEntry\022\013\n\003key\030" - + "\001 \001(\t\022;\n\005value\030\002 \001(\0132,.google.bigtable.a" - + "dmin.v2.Table.ClusterState:\0028\001\032]\n\023Column" - + "FamiliesEntry\022\013\n\003key\030\001 \001(\t\0225\n\005value\030\002 \001(" - + "\0132&.google.bigtable.admin.v2.ColumnFamil" - + "y:\0028\001\"I\n\024TimestampGranularity\022%\n!TIMESTA" - + "MP_GRANULARITY_UNSPECIFIED\020\000\022\n\n\006MILLIS\020\001" - + "\"q\n\004View\022\024\n\020VIEW_UNSPECIFIED\020\000\022\r\n\tNAME_O" - + "NLY\020\001\022\017\n\013SCHEMA_VIEW\020\002\022\024\n\020REPLICATION_VI" - + "EW\020\003\022\023\n\017ENCRYPTION_VIEW\020\005\022\010\n\004FULL\020\004:Z\352AW" - + "\n\035bigtable.googleapis.com/Table\0226project" - + "s/{project}/instances/{instance}/tables/" - + "{table}\"A\n\014ColumnFamily\0221\n\007gc_rule\030\001 \001(\013" - + "2 .google.bigtable.admin.v2.GcRule\"\325\002\n\006G" - + "cRule\022\032\n\020max_num_versions\030\001 \001(\005H\000\022,\n\007max" - + "_age\030\002 \001(\0132\031.google.protobuf.DurationH\000\022" - + "E\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\005Unio" - + "n\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.bigtable" - + ".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/Crypt" - + "oKeyVersion\"q\n\016EncryptionType\022\037\n\033ENCRYPT" - + "ION_TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DEFAULT" - + "_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_ENCRYP" - + "TION\020\002\"\307\003\n\010Snapshot\022\014\n\004name\030\001 \001(\t\0225\n\014sou" - + "rce_table\030\002 \001(\0132\037.google.bigtable.admin." - + "v2.Table\022\027\n\017data_size_bytes\030\003 \001(\003\022/\n\013cre" - + "ate_time\030\004 \001(\0132\032.google.protobuf.Timesta" - + "mp\022/\n\013delete_time\030\005 \001(\0132\032.google.protobu" - + "f.Timestamp\0227\n\005state\030\006 \001(\0162(.google.bigt" - + "able.admin.v2.Snapshot.State\022\023\n\013descript" - + "ion\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:v\352As\n bigtable." - + "googleapis.com/Snapshot\022Oprojects/{proje" - + "ct}/instances/{instance}/clusters/{clust" - + "er}/snapshots/{snapshot}\"\237\004\n\006Backup\022\021\n\004n" - + "ame\030\001 \001(\tB\003\340A\003\022\034\n\014source_table\030\002 \001(\tB\006\340A" - + "\005\340A\002\0224\n\013expire_time\030\003 \001(\0132\032.google.proto" - + "buf.TimestampB\003\340A\002\0223\n\nstart_time\030\004 \001(\0132\032" - + ".google.protobuf.TimestampB\003\340A\003\0221\n\010end_t" - + "ime\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340" - + "A\003\022\027\n\nsize_bytes\030\006 \001(\003B\003\340A\003\022:\n\005state\030\007 \001" - + "(\0162&.google.bigtable.admin.v2.Backup.Sta" - + "teB\003\340A\003\022F\n\017encryption_info\030\t \001(\0132(.googl" - + "e.bigtable.admin.v2.EncryptionInfoB\003\340A\003\"" - + "7\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREAT" - + "ING\020\001\022\t\n\005READY\020\002:p\352Am\n\036bigtable.googleap" - + "is.com/Backup\022Kprojects/{project}/instan" - + "ces/{instance}/clusters/{cluster}/backup" - + "s/{backup}\"\244\001\n\nBackupInfo\022\023\n\006backup\030\001 \001(" - + "\tB\003\340A\003\0223\n\nstart_time\030\002 \001(\0132\032.google.prot" - + "obuf.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*D\n\021RestoreSourceType\022#" - + "\n\037RESTORE_SOURCE_TYPE_UNSPECIFIED\020\000\022\n\n\006B" - + "ACKUP\020\001B\374\002\n\034com.google.bigtable.admin.v2" - + "B\nTableProtoP\001Z=google.golang.org/genpro" - + "to/googleapis/bigtable/admin/v2;admin\252\002\036" - + "Google.Cloud.Bigtable.Admin.V2\312\002\036Google\\" - + "Cloud\\Bigtable\\Admin\\V2\352\002\"Google::Cloud:" - + ":Bigtable::Admin::V2\352A\246\001\n(cloudkms.googl" - + "eapis.com/CryptoKeyVersion\022zprojects/{pr" - + "oject}/locations/{location}/keyRings/{ke" - + "y_ring}/cryptoKeys/{crypto_key}/cryptoKe" - + "yVersions/{crypto_key_version}b\006proto3" + + "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( @@ -192,94 +346,152 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { 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().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_bigtable_admin_v2_RestoreInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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_Table_descriptor = - getDescriptor().getMessageTypes().get(1); + 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.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Table_descriptor, new java.lang.String[] { - "Name", "ClusterStates", "ColumnFamilies", "Granularity", "RestoreInfo", + "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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(0); internal_static_google_bigtable_admin_v2_Table_ClusterState_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(2); internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedType(3); internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(2); + getDescriptor().getMessageType(4); internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor, new java.lang.String[] { - "GcRule", + "GcRule", "ValueType", }); - internal_static_google_bigtable_admin_v2_GcRule_descriptor = - getDescriptor().getMessageTypes().get(3); + internal_static_google_bigtable_admin_v2_GcRule_descriptor = getDescriptor().getMessageType(5); internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_GcRule_descriptor.getNestedType(0); internal_static_google_bigtable_admin_v2_GcRule_Intersection_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_GcRule_descriptor.getNestedType(1); internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(4); + getDescriptor().getMessageType(6); internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(5); + getDescriptor().getMessageType(7); internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Snapshot_descriptor, new java.lang.String[] { "Name", @@ -290,29 +502,70 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "State", "Description", }); - internal_static_google_bigtable_admin_v2_Backup_descriptor = - getDescriptor().getMessageTypes().get(6); + internal_static_google_bigtable_admin_v2_Backup_descriptor = getDescriptor().getMessageType(8); internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(7); + getDescriptor().getMessageType(9); internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_admin_v2_BackupInfo_descriptor, new java.lang.String[] { - "Backup", "StartTime", "EndTime", "SourceTable", + "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); @@ -321,11 +574,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfig.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfig.java new file mode 100644 index 0000000000..e54e3440fb --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfigOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageConfigOrBuilder.java new file mode 100644 index 0000000000..380f53080d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRule.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRule.java new file mode 100644 index 0000000000..2a78390f88 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRuleOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TieredStorageRuleOrBuilder.java new file mode 100644 index 0000000000..642ec6aac2 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java new file mode 100644 index 0000000000..e54b272a43 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypeOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypeOrBuilder.java new file mode 100644 index 0000000000..7e7bf4902b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypesProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypesProto.java new file mode 100644 index 0000000000..cb4756344d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadata.java new file mode 100644 index 0000000000..16897c8633 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadataOrBuilder.java new file mode 100644 index 0000000000..45364c362a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequest.java new file mode 100644 index 0000000000..77244fd815 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequestOrBuilder.java new file mode 100644 index 0000000000..851e6d771d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java index 7807489588..f439b09ac5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,65 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileMetadata} */ -public final class UpdateAppProfileMetadata extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use UpdateAppProfileMetadata.newBuilder() to construct. - private UpdateAppProfileMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateAppProfileMetadata() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateAppProfileMetadata(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateAppProfileMetadata"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use UpdateAppProfileMetadata.newBuilder() to construct. + private UpdateAppProfileMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private UpdateAppProfileMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private UpdateAppProfileMetadata() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto @@ -93,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable @@ -116,7 +82,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -125,7 +91,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -141,7 +107,7 @@ public boolean equals(final java.lang.Object obj) { com.google.bigtable.admin.v2.UpdateAppProfileMetadata other = (com.google.bigtable.admin.v2.UpdateAppProfileMetadata) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -152,7 +118,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -194,38 +160,38 @@ public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( public static com.google.bigtable.admin.v2.UpdateAppProfileMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -249,10 +215,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -262,7 +229,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -272,7 +239,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_fieldAccessorTable @@ -282,17 +249,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.UpdateAppProfileMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -329,39 +289,6 @@ public com.google.bigtable.admin.v2.UpdateAppProfileMetadata buildPartial() { return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.bigtable.admin.v2.UpdateAppProfileMetadata) { @@ -375,7 +302,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateAppProfileMetadata other) { if (other == com.google.bigtable.admin.v2.UpdateAppProfileMetadata.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -390,32 +317,34 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.UpdateAppProfileMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.UpdateAppProfileMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateAppProfileMetadata) } @@ -437,7 +366,18 @@ public UpdateAppProfileMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateAppProfileMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java index 85c13fe4ee..08d2ad5a71 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java index 790dbd793d..1eea319039 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,101 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileRequest} */ -public final class UpdateAppProfileRequest extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use UpdateAppProfileRequest.newBuilder() to construct. - private UpdateAppProfileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateAppProfileRequest() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateAppProfileRequest(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateAppProfileRequest"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use UpdateAppProfileRequest.newBuilder() to construct. + private UpdateAppProfileRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private UpdateAppProfileRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.AppProfile.Builder subBuilder = null; - if (appProfile_ != null) { - subBuilder = appProfile_.toBuilder(); - } - appProfile_ = - input.readMessage( - com.google.bigtable.admin.v2.AppProfile.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(appProfile_); - appProfile_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - case 24: - { - ignoreWarnings_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private UpdateAppProfileRequest() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto @@ -129,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable @@ -138,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -155,8 +87,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasAppProfile() { - return appProfile_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -176,6 +109,7 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile() { ? com.google.bigtable.admin.v2.AppProfile.getDefaultInstance() : appProfile_; } + /** * * @@ -189,11 +123,14 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile() { */ @java.lang.Override public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() { - return getAppProfile(); + 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_; + /** * * @@ -209,8 +146,9 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -228,6 +166,7 @@ public boolean hasUpdateMask() { public com.google.protobuf.FieldMask getUpdateMask() { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } + /** * * @@ -241,11 +180,12 @@ public com.google.protobuf.FieldMask getUpdateMask() { */ @java.lang.Override public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } public static final int IGNORE_WARNINGS_FIELD_NUMBER = 3; - private boolean ignoreWarnings_; + private boolean ignoreWarnings_ = false; + /** * * @@ -276,16 +216,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (appProfile_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getAppProfile()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getUpdateMask()); } if (ignoreWarnings_ != false) { output.writeBool(3, ignoreWarnings_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -294,16 +234,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (appProfile_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAppProfile()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } if (ignoreWarnings_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, ignoreWarnings_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -328,7 +268,7 @@ public boolean equals(final java.lang.Object obj) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } if (getIgnoreWarnings() != other.getIgnoreWarnings()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -349,7 +289,7 @@ public int hashCode() { } hash = (37 * hash) + IGNORE_WARNINGS_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIgnoreWarnings()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -391,38 +331,38 @@ public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( public static com.google.bigtable.admin.v2.UpdateAppProfileRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -445,10 +385,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -458,7 +399,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.UpdateAppProfileRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -468,7 +409,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable @@ -482,32 +423,33 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetAppProfileFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (appProfileBuilder_ == null) { - appProfile_ = null; - } else { - appProfile_ = null; + bitField0_ = 0; + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); appProfileBuilder_ = null; } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } ignoreWarnings_ = false; - return this; } @@ -535,52 +477,28 @@ public com.google.bigtable.admin.v2.UpdateAppProfileRequest build() { public com.google.bigtable.admin.v2.UpdateAppProfileRequest buildPartial() { com.google.bigtable.admin.v2.UpdateAppProfileRequest result = new com.google.bigtable.admin.v2.UpdateAppProfileRequest(this); - if (appProfileBuilder_ == null) { - result.appProfile_ = appProfile_; - } else { - result.appProfile_ = appProfileBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - result.ignoreWarnings_ = ignoreWarnings_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -605,7 +523,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateAppProfileRequest ot if (other.getIgnoreWarnings() != false) { setIgnoreWarnings(other.getIgnoreWarnings()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -620,27 +538,63 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.UpdateAppProfileRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.UpdateAppProfileRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.AppProfile appProfile_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -655,8 +609,9 @@ public Builder mergeFrom( * @return Whether the appProfile field is set. */ public boolean hasAppProfile() { - return appProfileBuilder_ != null || appProfile_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -679,6 +634,7 @@ public com.google.bigtable.admin.v2.AppProfile getAppProfile() { return appProfileBuilder_.getMessage(); } } + /** * * @@ -696,13 +652,14 @@ public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile value) { throw new NullPointerException(); } appProfile_ = value; - onChanged(); } else { appProfileBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -717,13 +674,14 @@ public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile value) { public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile.Builder builderForValue) { if (appProfileBuilder_ == null) { appProfile_ = builderForValue.build(); - onChanged(); } else { appProfileBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -737,21 +695,23 @@ public Builder setAppProfile(com.google.bigtable.admin.v2.AppProfile.Builder bui */ public Builder mergeAppProfile(com.google.bigtable.admin.v2.AppProfile value) { if (appProfileBuilder_ == null) { - if (appProfile_ != null) { - appProfile_ = - com.google.bigtable.admin.v2.AppProfile.newBuilder(appProfile_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && appProfile_ != null + && appProfile_ != com.google.bigtable.admin.v2.AppProfile.getDefaultInstance()) { + getAppProfileBuilder().mergeFrom(value); } else { appProfile_ = value; } - onChanged(); } else { appProfileBuilder_.mergeFrom(value); } - + if (appProfile_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -764,16 +724,16 @@ public Builder mergeAppProfile(com.google.bigtable.admin.v2.AppProfile value) { *
    */ public Builder clearAppProfile() { - if (appProfileBuilder_ == null) { - appProfile_ = null; - onChanged(); - } else { - appProfile_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + appProfile_ = null; + if (appProfileBuilder_ != null) { + appProfileBuilder_.dispose(); appProfileBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -786,10 +746,11 @@ public Builder clearAppProfile() { *
    */ public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfileBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getAppProfileFieldBuilder().getBuilder(); + return internalGetAppProfileFieldBuilder().getBuilder(); } + /** * * @@ -810,6 +771,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() : appProfile_; } } + /** * * @@ -821,14 +783,14 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() * .google.bigtable.admin.v2.AppProfile app_profile = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder> - getAppProfileFieldBuilder() { + internalGetAppProfileFieldBuilder() { if (appProfileBuilder_ == null) { appProfileBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.AppProfile, com.google.bigtable.admin.v2.AppProfile.Builder, com.google.bigtable.admin.v2.AppProfileOrBuilder>( @@ -839,11 +801,12 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() } private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** * * @@ -858,8 +821,9 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() * @return Whether the updateMask field is set. */ public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -882,6 +846,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { return updateMaskBuilder_.getMessage(); } } + /** * * @@ -899,13 +864,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -920,13 +886,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { updateMask_ = builderForValue.build(); - onChanged(); } else { updateMaskBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -940,19 +907,23 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); } else { updateMask_ = value; } - onChanged(); } else { updateMaskBuilder_.mergeFrom(value); } - + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -965,16 +936,16 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * */ public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -987,10 +958,11 @@ public Builder clearUpdateMask() { * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); } + /** * * @@ -1011,6 +983,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { : updateMask_; } } + /** * * @@ -1022,14 +995,14 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { + internalGetUpdateMaskFieldBuilder() { if (updateMaskBuilder_ == null) { updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( @@ -1040,6 +1013,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { } private boolean ignoreWarnings_; + /** * * @@ -1055,6 +1029,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { public boolean getIgnoreWarnings() { return ignoreWarnings_; } + /** * * @@ -1070,9 +1045,11 @@ public boolean getIgnoreWarnings() { public Builder setIgnoreWarnings(boolean value) { ignoreWarnings_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1085,23 +1062,12 @@ public Builder setIgnoreWarnings(boolean value) { * @return This builder for chaining. */ public Builder clearIgnoreWarnings() { - + bitField0_ = (bitField0_ & ~0x00000004); ignoreWarnings_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateAppProfileRequest) } @@ -1123,7 +1089,18 @@ public UpdateAppProfileRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateAppProfileRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java index 08e475ad27..9f0908e247 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAppProfileRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -37,6 +40,7 @@ public interface UpdateAppProfileRequestOrBuilder * @return Whether the appProfile field is set. */ boolean hasAppProfile(); + /** * * @@ -51,6 +55,7 @@ public interface UpdateAppProfileRequestOrBuilder * @return The appProfile. */ com.google.bigtable.admin.v2.AppProfile getAppProfile(); + /** * * @@ -78,6 +83,7 @@ public interface UpdateAppProfileRequestOrBuilder * @return Whether the updateMask field is set. */ boolean hasUpdateMask(); + /** * * @@ -92,6 +98,7 @@ public interface UpdateAppProfileRequestOrBuilder * @return The updateMask. */ com.google.protobuf.FieldMask getUpdateMask(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadata.java new file mode 100644 index 0000000000..b4df5538ea --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadataOrBuilder.java new file mode 100644 index 0000000000..bf2557d7a9 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequest.java new file mode 100644 index 0000000000..ad0831fc6d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequestOrBuilder.java new file mode 100644 index 0000000000..20e32a1a9d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java index 7af8d13bc6..c5eeeffd25 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -22,101 +24,35 @@ * * *
    - * The request for [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
    + * The request for
    + * [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
      * 
    * * Protobuf type {@code google.bigtable.admin.v2.UpdateBackupRequest} */ -public final class UpdateBackupRequest extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use UpdateBackupRequest.newBuilder() to construct. - private UpdateBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private UpdateBackupRequest() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateBackupRequest(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateBackupRequest"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use UpdateBackupRequest.newBuilder() to construct. + private UpdateBackupRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private UpdateBackupRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.Backup.Builder subBuilder = null; - if (backup_ != null) { - subBuilder = backup_.toBuilder(); - } - backup_ = - input.readMessage( - com.google.bigtable.admin.v2.Backup.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(backup_); - backup_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = - input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private UpdateBackupRequest() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto @@ -124,7 +60,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_fieldAccessorTable @@ -133,8 +69,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -142,7 +80,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -152,8 +91,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasBackup() { - return backup_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -161,7 +101,8 @@ public 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`. + * + * * `backup.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -173,6 +114,7 @@ public boolean hasBackup() { public com.google.bigtable.admin.v2.Backup getBackup() { return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; } + /** * * @@ -180,7 +122,8 @@ public 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`. + * + * * `backup.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -188,11 +131,12 @@ public com.google.bigtable.admin.v2.Backup getBackup() { */ @java.lang.Override public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { - return getBackup(); + 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_; + /** * * @@ -211,8 +155,9 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -233,6 +178,7 @@ public boolean hasUpdateMask() { public com.google.protobuf.FieldMask getUpdateMask() { return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } + /** * * @@ -249,7 +195,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { */ @java.lang.Override public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; } private byte memoizedIsInitialized = -1; @@ -266,13 +212,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (backup_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getBackup()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -281,13 +227,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (backup_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBackup()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -311,7 +257,7 @@ public boolean equals(final java.lang.Object obj) { if (hasUpdateMask()) { if (!getUpdateMask().equals(other.getUpdateMask())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -330,7 +276,7 @@ public int hashCode() { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -372,38 +318,38 @@ public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( public static com.google.bigtable.admin.v2.UpdateBackupRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -426,20 +372,22 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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].
    +   * 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.GeneratedMessageV3.Builder + 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 { @@ -449,7 +397,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_fieldAccessorTable @@ -463,28 +411,30 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetBackupFieldBuilder(); + internalGetUpdateMaskFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (backupBuilder_ == null) { - backup_ = null; - } else { - backup_ = null; + bitField0_ = 0; + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); backupBuilder_ = null; } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } return this; @@ -514,51 +464,25 @@ public com.google.bigtable.admin.v2.UpdateBackupRequest build() { public com.google.bigtable.admin.v2.UpdateBackupRequest buildPartial() { com.google.bigtable.admin.v2.UpdateBackupRequest result = new com.google.bigtable.admin.v2.UpdateBackupRequest(this); - if (backupBuilder_ == null) { - result.backup_ = backup_; - } else { - result.backup_ = backupBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -580,7 +504,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateBackupRequest other) if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -595,26 +519,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.UpdateBackupRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.admin.v2.UpdateBackupRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.Backup backup_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -622,7 +576,8 @@ public Builder mergeFrom( * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -631,8 +586,9 @@ public Builder mergeFrom( * @return Whether the backup field is set. */ public boolean hasBackup() { - return backupBuilder_ != null || backup_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -640,7 +596,8 @@ public 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`. + * + * * `backup.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -655,6 +612,7 @@ public com.google.bigtable.admin.v2.Backup getBackup() { return backupBuilder_.getMessage(); } } + /** * * @@ -662,7 +620,8 @@ public 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`. + * + * * `backup.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -674,13 +633,14 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { throw new NullPointerException(); } backup_ = value; - onChanged(); } else { backupBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -688,7 +648,8 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -697,13 +658,14 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup value) { public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForValue) { if (backupBuilder_ == null) { backup_ = builderForValue.build(); - onChanged(); } else { backupBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -711,7 +673,8 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForV * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -719,21 +682,23 @@ public Builder setBackup(com.google.bigtable.admin.v2.Backup.Builder builderForV */ public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { if (backupBuilder_ == null) { - if (backup_ != null) { - backup_ = - com.google.bigtable.admin.v2.Backup.newBuilder(backup_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && backup_ != null + && backup_ != com.google.bigtable.admin.v2.Backup.getDefaultInstance()) { + getBackupBuilder().mergeFrom(value); } else { backup_ = value; } - onChanged(); } else { backupBuilder_.mergeFrom(value); } - + if (backup_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -741,23 +706,24 @@ public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; * */ public Builder clearBackup() { - if (backupBuilder_ == null) { - backup_ = null; - onChanged(); - } else { - backup_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + backup_ = null; + if (backupBuilder_ != null) { + backupBuilder_.dispose(); backupBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -765,17 +731,19 @@ public Builder clearBackup() { * 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.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 getBackupFieldBuilder().getBuilder(); + return internalGetBackupFieldBuilder().getBuilder(); } + /** * * @@ -783,7 +751,8 @@ public com.google.bigtable.admin.v2.Backup.Builder getBackupBuilder() { * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -796,6 +765,7 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { return backup_ == null ? com.google.bigtable.admin.v2.Backup.getDefaultInstance() : backup_; } } + /** * * @@ -803,20 +773,21 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder> - getBackupFieldBuilder() { + internalGetBackupFieldBuilder() { if (backupBuilder_ == null) { backupBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Backup, com.google.bigtable.admin.v2.Backup.Builder, com.google.bigtable.admin.v2.BackupOrBuilder>( @@ -827,11 +798,12 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { } private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** * * @@ -849,8 +821,9 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { * @return Whether the updateMask field is set. */ public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -876,6 +849,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { return updateMaskBuilder_.getMessage(); } } + /** * * @@ -896,13 +870,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -920,13 +895,14 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { if (updateMaskBuilder_ == null) { updateMask_ = builderForValue.build(); - onChanged(); } else { updateMaskBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -943,19 +919,23 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal */ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); } else { updateMask_ = value; } - onChanged(); } else { updateMaskBuilder_.mergeFrom(value); } - + if (updateMask_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -971,16 +951,16 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * */ public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -996,10 +976,11 @@ public Builder clearUpdateMask() { * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); + return internalGetUpdateMaskFieldBuilder().getBuilder(); } + /** * * @@ -1023,6 +1004,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { : updateMask_; } } + /** * * @@ -1037,14 +1019,14 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; * */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { + internalGetUpdateMaskFieldBuilder() { if (updateMaskBuilder_ == null) { updateMaskBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( @@ -1054,17 +1036,6 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return updateMaskBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateBackupRequest) } @@ -1086,7 +1057,18 @@ public UpdateBackupRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateBackupRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java index 40e8398743..ee8c3d4eb6 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateBackupRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -30,7 +33,8 @@ public interface UpdateBackupRequestOrBuilder * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -39,6 +43,7 @@ public interface UpdateBackupRequestOrBuilder * @return Whether the backup field is set. */ boolean hasBackup(); + /** * * @@ -46,7 +51,8 @@ public interface UpdateBackupRequestOrBuilder * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -55,6 +61,7 @@ public interface UpdateBackupRequestOrBuilder * @return The backup. */ com.google.bigtable.admin.v2.Backup getBackup(); + /** * * @@ -62,7 +69,8 @@ public interface UpdateBackupRequestOrBuilder * 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.expire_time`. * * * .google.bigtable.admin.v2.Backup backup = 1 [(.google.api.field_behavior) = REQUIRED]; @@ -87,6 +95,7 @@ public interface UpdateBackupRequestOrBuilder * @return Whether the updateMask field is set. */ boolean hasUpdateMask(); + /** * * @@ -104,6 +113,7 @@ public interface UpdateBackupRequestOrBuilder * @return The updateMask. */ com.google.protobuf.FieldMask getUpdateMask(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java index aae580e145..7ceddedbd9 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,111 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.UpdateClusterMetadata} */ -public final class UpdateClusterMetadata extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use UpdateClusterMetadata.newBuilder() to construct. - private UpdateClusterMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateClusterMetadata() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateClusterMetadata(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateClusterMetadata"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use UpdateClusterMetadata.newBuilder() to construct. + private UpdateClusterMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private UpdateClusterMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.Cluster.Builder subBuilder = null; - if (originalRequest_ != null) { - subBuilder = originalRequest_.toBuilder(); - } - originalRequest_ = - input.readMessage( - com.google.bigtable.admin.v2.Cluster.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(originalRequest_); - originalRequest_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (requestTime_ != null) { - subBuilder = requestTime_.toBuilder(); - } - requestTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(requestTime_); - requestTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (finishTime_ != null) { - subBuilder = finishTime_.toBuilder(); - } - finishTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(finishTime_); - finishTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private UpdateClusterMetadata() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto @@ -139,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable @@ -148,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -163,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -182,6 +105,7 @@ public com.google.bigtable.admin.v2.Cluster getOriginalRequest() { ? com.google.bigtable.admin.v2.Cluster.getDefaultInstance() : originalRequest_; } + /** * * @@ -193,11 +117,14 @@ public com.google.bigtable.admin.v2.Cluster getOriginalRequest() { */ @java.lang.Override public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder() { - return getOriginalRequest(); + 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_; + /** * * @@ -211,8 +138,9 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -228,6 +156,7 @@ public boolean hasRequestTime() { public com.google.protobuf.Timestamp getRequestTime() { return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } + /** * * @@ -239,11 +168,12 @@ public com.google.protobuf.Timestamp getRequestTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { - return getRequestTime(); + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } public static final int FINISH_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp finishTime_; + /** * * @@ -257,8 +187,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -274,6 +205,7 @@ public boolean hasFinishTime() { public com.google.protobuf.Timestamp getFinishTime() { return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; } + /** * * @@ -285,7 +217,7 @@ public com.google.protobuf.Timestamp getFinishTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { - return getFinishTime(); + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; } private byte memoizedIsInitialized = -1; @@ -302,16 +234,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(3, getFinishTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -320,16 +252,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -357,7 +289,7 @@ public boolean equals(final java.lang.Object obj) { if (hasFinishTime()) { if (!getFinishTime().equals(other.getFinishTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -380,7 +312,7 @@ public int hashCode() { hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; hash = (53 * hash) + getFinishTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -422,38 +354,38 @@ public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( public static com.google.bigtable.admin.v2.UpdateClusterMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -476,10 +408,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -489,7 +422,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.UpdateClusterMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -499,7 +432,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_fieldAccessorTable @@ -513,34 +446,36 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - } else { - originalRequest_ = null; + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - if (requestTimeBuilder_ == null) { - requestTime_ = null; - } else { - requestTime_ = null; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - if (finishTimeBuilder_ == null) { - finishTime_ = null; - } else { - finishTime_ = null; + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } return this; @@ -570,56 +505,31 @@ public com.google.bigtable.admin.v2.UpdateClusterMetadata build() { public com.google.bigtable.admin.v2.UpdateClusterMetadata buildPartial() { com.google.bigtable.admin.v2.UpdateClusterMetadata result = new com.google.bigtable.admin.v2.UpdateClusterMetadata(this); - if (originalRequestBuilder_ == null) { - result.originalRequest_ = originalRequest_; - } else { - result.originalRequest_ = originalRequestBuilder_.build(); - } - if (requestTimeBuilder_ == null) { - result.requestTime_ = requestTime_; - } else { - result.requestTime_ = requestTimeBuilder_.build(); - } - if (finishTimeBuilder_ == null) { - result.finishTime_ = finishTime_; - } else { - result.finishTime_ = finishTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -644,7 +554,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateClusterMetadata othe if (other.hasFinishTime()) { mergeFinishTime(other.getFinishTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -659,27 +569,64 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.UpdateClusterMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.UpdateClusterMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.Cluster originalRequest_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -692,8 +639,9 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -714,6 +662,7 @@ public com.google.bigtable.admin.v2.Cluster getOriginalRequest() { return originalRequestBuilder_.getMessage(); } } + /** * * @@ -729,13 +678,14 @@ public Builder setOriginalRequest(com.google.bigtable.admin.v2.Cluster value) { throw new NullPointerException(); } originalRequest_ = value; - onChanged(); } else { originalRequestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -749,13 +699,14 @@ public Builder setOriginalRequest( com.google.bigtable.admin.v2.Cluster.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); - onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -767,21 +718,23 @@ public Builder setOriginalRequest( */ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.Cluster value) { if (originalRequestBuilder_ == null) { - if (originalRequest_ != null) { - originalRequest_ = - com.google.bigtable.admin.v2.Cluster.newBuilder(originalRequest_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ != com.google.bigtable.admin.v2.Cluster.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); } else { originalRequest_ = value; } - onChanged(); } else { originalRequestBuilder_.mergeFrom(value); } - + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -792,16 +745,16 @@ public Builder mergeOriginalRequest(com.google.bigtable.admin.v2.Cluster value) * .google.bigtable.admin.v2.Cluster original_request = 1; */ public Builder clearOriginalRequest() { - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - onChanged(); - } else { - originalRequest_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -812,10 +765,11 @@ public Builder clearOriginalRequest() { * .google.bigtable.admin.v2.Cluster original_request = 1; */ public com.google.bigtable.admin.v2.Cluster.Builder getOriginalRequestBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getOriginalRequestFieldBuilder().getBuilder(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); } + /** * * @@ -834,6 +788,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder : originalRequest_; } } + /** * * @@ -843,14 +798,14 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder * * .google.bigtable.admin.v2.Cluster original_request = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder> - getOriginalRequestFieldBuilder() { + internalGetOriginalRequestFieldBuilder() { if (originalRequestBuilder_ == null) { originalRequestBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.Cluster, com.google.bigtable.admin.v2.Cluster.Builder, com.google.bigtable.admin.v2.ClusterOrBuilder>( @@ -861,11 +816,12 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder } private com.google.protobuf.Timestamp requestTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> requestTimeBuilder_; + /** * * @@ -878,8 +834,9 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder * @return Whether the requestTime field is set. */ public boolean hasRequestTime() { - return requestTimeBuilder_ != null || requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -900,6 +857,7 @@ public com.google.protobuf.Timestamp getRequestTime() { return requestTimeBuilder_.getMessage(); } } + /** * * @@ -915,13 +873,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -934,13 +893,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (requestTimeBuilder_ == null) { requestTime_ = builderForValue.build(); - onChanged(); } else { requestTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -952,21 +912,23 @@ public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForVa */ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { if (requestTimeBuilder_ == null) { - if (requestTime_ != null) { - requestTime_ = - com.google.protobuf.Timestamp.newBuilder(requestTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); } else { requestTime_ = value; } - onChanged(); } else { requestTimeBuilder_.mergeFrom(value); } - + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -977,16 +939,16 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp request_time = 2; */ public Builder clearRequestTime() { - if (requestTimeBuilder_ == null) { - requestTime_ = null; - onChanged(); - } else { - requestTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -997,10 +959,11 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getRequestTimeFieldBuilder().getBuilder(); + return internalGetRequestTimeFieldBuilder().getBuilder(); } + /** * * @@ -1019,6 +982,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { : requestTime_; } } + /** * * @@ -1028,14 +992,14 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * * .google.protobuf.Timestamp request_time = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getRequestTimeFieldBuilder() { + internalGetRequestTimeFieldBuilder() { if (requestTimeBuilder_ == null) { requestTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1046,11 +1010,12 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { } private com.google.protobuf.Timestamp finishTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> finishTimeBuilder_; + /** * * @@ -1063,8 +1028,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * @return Whether the finishTime field is set. */ public boolean hasFinishTime() { - return finishTimeBuilder_ != null || finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1085,6 +1051,7 @@ public com.google.protobuf.Timestamp getFinishTime() { return finishTimeBuilder_.getMessage(); } } + /** * * @@ -1100,13 +1067,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1119,13 +1087,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (finishTimeBuilder_ == null) { finishTime_ = builderForValue.build(); - onChanged(); } else { finishTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1137,19 +1106,23 @@ public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { if (finishTimeBuilder_ == null) { - if (finishTime_ != null) { - finishTime_ = - com.google.protobuf.Timestamp.newBuilder(finishTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); } else { finishTime_ = value; } - onChanged(); } else { finishTimeBuilder_.mergeFrom(value); } - + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1160,16 +1133,16 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp finish_time = 3; */ public Builder clearFinishTime() { - if (finishTimeBuilder_ == null) { - finishTime_ = null; - onChanged(); - } else { - finishTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1180,10 +1153,11 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getFinishTimeFieldBuilder().getBuilder(); + return internalGetFinishTimeFieldBuilder().getBuilder(); } + /** * * @@ -1202,6 +1176,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { : finishTime_; } } + /** * * @@ -1211,14 +1186,14 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { * * .google.protobuf.Timestamp finish_time = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getFinishTimeFieldBuilder() { + internalGetFinishTimeFieldBuilder() { if (finishTimeBuilder_ == null) { finishTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1228,17 +1203,6 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { return finishTimeBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateClusterMetadata) } @@ -1260,7 +1224,18 @@ public UpdateClusterMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateClusterMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java index 4122ab7dcc..c78882a254 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateClusterMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface UpdateClusterMetadataOrBuilder * @return Whether the originalRequest field is set. */ boolean hasOriginalRequest(); + /** * * @@ -47,6 +51,7 @@ public interface UpdateClusterMetadataOrBuilder * @return The originalRequest. */ com.google.bigtable.admin.v2.Cluster getOriginalRequest(); + /** * * @@ -70,6 +75,7 @@ public interface UpdateClusterMetadataOrBuilder * @return Whether the requestTime field is set. */ boolean hasRequestTime(); + /** * * @@ -82,6 +88,7 @@ public interface UpdateClusterMetadataOrBuilder * @return The requestTime. */ com.google.protobuf.Timestamp getRequestTime(); + /** * * @@ -105,6 +112,7 @@ public interface UpdateClusterMetadataOrBuilder * @return Whether the finishTime field is set. */ boolean hasFinishTime(); + /** * * @@ -117,6 +125,7 @@ public interface UpdateClusterMetadataOrBuilder * @return The finishTime. */ com.google.protobuf.Timestamp getFinishTime(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java index 7bd90cde08..f20fd29125 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,112 +29,29 @@ * * Protobuf type {@code google.bigtable.admin.v2.UpdateInstanceMetadata} */ -public final class UpdateInstanceMetadata extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use UpdateInstanceMetadata.newBuilder() to construct. - private UpdateInstanceMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateInstanceMetadata() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new UpdateInstanceMetadata(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "UpdateInstanceMetadata"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use UpdateInstanceMetadata.newBuilder() to construct. + private UpdateInstanceMetadata(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private UpdateInstanceMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder subBuilder = null; - if (originalRequest_ != null) { - subBuilder = originalRequest_.toBuilder(); - } - originalRequest_ = - input.readMessage( - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(originalRequest_); - originalRequest_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (requestTime_ != null) { - subBuilder = requestTime_.toBuilder(); - } - requestTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(requestTime_); - requestTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (finishTime_ != null) { - subBuilder = finishTime_.toBuilder(); - } - finishTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(finishTime_); - finishTime_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private UpdateInstanceMetadata() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto @@ -140,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable @@ -149,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -164,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -183,6 +105,7 @@ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequ ? com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance() : originalRequest_; } + /** * * @@ -195,11 +118,14 @@ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequ @java.lang.Override public com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder getOriginalRequestOrBuilder() { - return getOriginalRequest(); + 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_; + /** * * @@ -213,8 +139,9 @@ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequ */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -230,6 +157,7 @@ public boolean hasRequestTime() { public com.google.protobuf.Timestamp getRequestTime() { return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } + /** * * @@ -241,11 +169,12 @@ public com.google.protobuf.Timestamp getRequestTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { - return getRequestTime(); + return requestTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : requestTime_; } public static final int FINISH_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp finishTime_; + /** * * @@ -259,8 +188,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -276,6 +206,7 @@ public boolean hasFinishTime() { public com.google.protobuf.Timestamp getFinishTime() { return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; } + /** * * @@ -287,7 +218,7 @@ public com.google.protobuf.Timestamp getFinishTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { - return getFinishTime(); + return finishTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : finishTime_; } private byte memoizedIsInitialized = -1; @@ -304,16 +235,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(3, getFinishTime()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -322,16 +253,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getOriginalRequest()); } - if (requestTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFinishTime()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -359,7 +290,7 @@ public boolean equals(final java.lang.Object obj) { if (hasFinishTime()) { if (!getFinishTime().equals(other.getFinishTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -382,7 +313,7 @@ public int hashCode() { hash = (37 * hash) + FINISH_TIME_FIELD_NUMBER; hash = (53 * hash) + getFinishTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -424,38 +355,38 @@ public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( public static com.google.bigtable.admin.v2.UpdateInstanceMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -478,10 +409,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -491,7 +423,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.admin.v2.UpdateInstanceMetadata} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -501,7 +433,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_fieldAccessorTable @@ -515,34 +447,36 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetOriginalRequestFieldBuilder(); + internalGetRequestTimeFieldBuilder(); + internalGetFinishTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - } else { - originalRequest_ = null; + bitField0_ = 0; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - if (requestTimeBuilder_ == null) { - requestTime_ = null; - } else { - requestTime_ = null; + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - if (finishTimeBuilder_ == null) { - finishTime_ = null; - } else { - finishTime_ = null; + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } return this; @@ -572,56 +506,31 @@ public com.google.bigtable.admin.v2.UpdateInstanceMetadata build() { public com.google.bigtable.admin.v2.UpdateInstanceMetadata buildPartial() { com.google.bigtable.admin.v2.UpdateInstanceMetadata result = new com.google.bigtable.admin.v2.UpdateInstanceMetadata(this); - if (originalRequestBuilder_ == null) { - result.originalRequest_ = originalRequest_; - } else { - result.originalRequest_ = originalRequestBuilder_.build(); - } - if (requestTimeBuilder_ == null) { - result.requestTime_ = requestTime_; - } else { - result.requestTime_ = requestTimeBuilder_.build(); - } - if (finishTimeBuilder_ == null) { - result.finishTime_ = finishTime_; - } else { - result.finishTime_ = finishTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -646,7 +555,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.UpdateInstanceMetadata oth if (other.hasFinishTime()) { mergeFinishTime(other.getFinishTime()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -661,27 +570,64 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.UpdateInstanceMetadata parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.UpdateInstanceMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.PartialUpdateInstanceRequest originalRequest_; - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -694,8 +640,9 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -716,6 +663,7 @@ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequ return originalRequestBuilder_.getMessage(); } } + /** * * @@ -732,13 +680,14 @@ public Builder setOriginalRequest( throw new NullPointerException(); } originalRequest_ = value; - onChanged(); } else { originalRequestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -752,13 +701,14 @@ public Builder setOriginalRequest( com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); - onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -771,21 +721,24 @@ public Builder setOriginalRequest( public Builder mergeOriginalRequest( com.google.bigtable.admin.v2.PartialUpdateInstanceRequest value) { if (originalRequestBuilder_ == null) { - if (originalRequest_ != null) { - originalRequest_ = - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.newBuilder(originalRequest_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); } else { originalRequest_ = value; } - onChanged(); } else { originalRequestBuilder_.mergeFrom(value); } - + if (originalRequest_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -796,16 +749,16 @@ public Builder mergeOriginalRequest( * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; */ public Builder clearOriginalRequest() { - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - onChanged(); - } else { - originalRequest_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -817,10 +770,11 @@ public Builder clearOriginalRequest() { */ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder getOriginalRequestBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getOriginalRequestFieldBuilder().getBuilder(); + return internalGetOriginalRequestFieldBuilder().getBuilder(); } + /** * * @@ -840,6 +794,7 @@ public Builder clearOriginalRequest() { : originalRequest_; } } + /** * * @@ -849,14 +804,14 @@ public Builder clearOriginalRequest() { * * .google.bigtable.admin.v2.PartialUpdateInstanceRequest original_request = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder, com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder> - getOriginalRequestFieldBuilder() { + internalGetOriginalRequestFieldBuilder() { if (originalRequestBuilder_ == null) { originalRequestBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder, com.google.bigtable.admin.v2.PartialUpdateInstanceRequestOrBuilder>( @@ -867,11 +822,12 @@ public Builder clearOriginalRequest() { } private com.google.protobuf.Timestamp requestTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> requestTimeBuilder_; + /** * * @@ -884,8 +840,9 @@ public Builder clearOriginalRequest() { * @return Whether the requestTime field is set. */ public boolean hasRequestTime() { - return requestTimeBuilder_ != null || requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -906,6 +863,7 @@ public com.google.protobuf.Timestamp getRequestTime() { return requestTimeBuilder_.getMessage(); } } + /** * * @@ -921,13 +879,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -940,13 +899,14 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (requestTimeBuilder_ == null) { requestTime_ = builderForValue.build(); - onChanged(); } else { requestTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -958,21 +918,23 @@ public Builder setRequestTime(com.google.protobuf.Timestamp.Builder builderForVa */ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { if (requestTimeBuilder_ == null) { - if (requestTime_ != null) { - requestTime_ = - com.google.protobuf.Timestamp.newBuilder(requestTime_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); } else { requestTime_ = value; } - onChanged(); } else { requestTimeBuilder_.mergeFrom(value); } - + if (requestTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -983,16 +945,16 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp request_time = 2; */ public Builder clearRequestTime() { - if (requestTimeBuilder_ == null) { - requestTime_ = null; - onChanged(); - } else { - requestTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1003,10 +965,11 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getRequestTimeFieldBuilder().getBuilder(); + return internalGetRequestTimeFieldBuilder().getBuilder(); } + /** * * @@ -1025,6 +988,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { : requestTime_; } } + /** * * @@ -1034,14 +998,14 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * * .google.protobuf.Timestamp request_time = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getRequestTimeFieldBuilder() { + internalGetRequestTimeFieldBuilder() { if (requestTimeBuilder_ == null) { requestTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1052,11 +1016,12 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { } private com.google.protobuf.Timestamp finishTime_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> finishTimeBuilder_; + /** * * @@ -1069,8 +1034,9 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * @return Whether the finishTime field is set. */ public boolean hasFinishTime() { - return finishTimeBuilder_ != null || finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1091,6 +1057,7 @@ public com.google.protobuf.Timestamp getFinishTime() { return finishTimeBuilder_.getMessage(); } } + /** * * @@ -1106,13 +1073,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1125,13 +1093,14 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (finishTimeBuilder_ == null) { finishTime_ = builderForValue.build(); - onChanged(); } else { finishTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1143,19 +1112,23 @@ public Builder setFinishTime(com.google.protobuf.Timestamp.Builder builderForVal */ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { if (finishTimeBuilder_ == null) { - if (finishTime_ != null) { - finishTime_ = - com.google.protobuf.Timestamp.newBuilder(finishTime_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); } else { finishTime_ = value; } - onChanged(); } else { finishTimeBuilder_.mergeFrom(value); } - + if (finishTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1166,16 +1139,16 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp finish_time = 3; */ public Builder clearFinishTime() { - if (finishTimeBuilder_ == null) { - finishTime_ = null; - onChanged(); - } else { - finishTime_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1186,10 +1159,11 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getFinishTimeFieldBuilder().getBuilder(); + return internalGetFinishTimeFieldBuilder().getBuilder(); } + /** * * @@ -1208,6 +1182,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { : finishTime_; } } + /** * * @@ -1217,14 +1192,14 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { * * .google.protobuf.Timestamp finish_time = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getFinishTimeFieldBuilder() { + internalGetFinishTimeFieldBuilder() { if (finishTimeBuilder_ == null) { finishTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( @@ -1234,17 +1209,6 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { return finishTimeBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.UpdateInstanceMetadata) } @@ -1266,7 +1230,18 @@ public UpdateInstanceMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateInstanceMetadata(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java index 4191fb0e8e..bad74afac7 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateInstanceMetadataOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface UpdateInstanceMetadataOrBuilder * @return Whether the originalRequest field is set. */ boolean hasOriginalRequest(); + /** * * @@ -47,6 +51,7 @@ public interface UpdateInstanceMetadataOrBuilder * @return The originalRequest. */ com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequest(); + /** * * @@ -70,6 +75,7 @@ public interface UpdateInstanceMetadataOrBuilder * @return Whether the requestTime field is set. */ boolean hasRequestTime(); + /** * * @@ -82,6 +88,7 @@ public interface UpdateInstanceMetadataOrBuilder * @return The requestTime. */ com.google.protobuf.Timestamp getRequestTime(); + /** * * @@ -105,6 +112,7 @@ public interface UpdateInstanceMetadataOrBuilder * @return Whether the finishTime field is set. */ boolean hasFinishTime(); + /** * * @@ -117,6 +125,7 @@ public interface UpdateInstanceMetadataOrBuilder * @return The finishTime. */ com.google.protobuf.Timestamp getFinishTime(); + /** * * diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadata.java new file mode 100644 index 0000000000..3917774755 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewMetadataOrBuilder.java new file mode 100644 index 0000000000..fa959e16cc --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequest.java new file mode 100644 index 0000000000..1c5587f231 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateLogicalViewRequestOrBuilder.java new file mode 100644 index 0000000000..32369b623d --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadata.java new file mode 100644 index 0000000000..ed4e1c5756 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewMetadataOrBuilder.java new file mode 100644 index 0000000000..efa2fcbd51 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequest.java new file mode 100644 index 0000000000..4b779d8fc5 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateMaterializedViewRequestOrBuilder.java new file mode 100644 index 0000000000..624d0b7155 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadata.java new file mode 100644 index 0000000000..38250e4c02 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleMetadataOrBuilder.java new file mode 100644 index 0000000000..bf78446362 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequest.java new file mode 100644 index 0000000000..20bb973b6a --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateSchemaBundleRequestOrBuilder.java new file mode 100644 index 0000000000..80e8ed22df --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadata.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadata.java new file mode 100644 index 0000000000..17a344f2b8 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadataOrBuilder.java new file mode 100644 index 0000000000..4c18c689af --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequest.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequest.java new file mode 100644 index 0000000000..64d1b72290 --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequestOrBuilder.java new file mode 100644 index 0000000000..c5faaf7d2b --- /dev/null +++ b/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/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto index ca3aaed7a1..a800f990da 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -29,7 +29,7 @@ import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; +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"; @@ -51,12 +51,20 @@ service BigtableInstanceAdmin { "https://www.googleapis.com/auth/cloud-platform.read-only"; // Create an instance within a project. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + // + // 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.api.method_signature) = + "parent,instance_id,instance,clusters"; option (google.longrunning.operation_info) = { response_type: "Instance" metadata_type: "CreateInstanceMetadata" @@ -91,7 +99,8 @@ service BigtableInstanceAdmin { // 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) { + rpc PartialUpdateInstance(PartialUpdateInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v2/{instance.name=projects/*/instances/*}" body: "instance" @@ -112,7 +121,14 @@ service BigtableInstanceAdmin { } // Creates a cluster within an instance. - rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) { + // + // 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" @@ -141,6 +157,10 @@ service BigtableInstanceAdmin { } // 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/*}" @@ -152,6 +172,31 @@ service BigtableInstanceAdmin { }; } + // 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) = { @@ -178,7 +223,8 @@ service BigtableInstanceAdmin { } // Lists information about app profiles in an instance. - rpc ListAppProfiles(ListAppProfilesRequest) returns (ListAppProfilesResponse) { + rpc ListAppProfiles(ListAppProfilesRequest) + returns (ListAppProfilesResponse) { option (google.api.http) = { get: "/v2/{parent=projects/*/instances/*}/appProfiles" }; @@ -186,7 +232,8 @@ service BigtableInstanceAdmin { } // Updates an app profile within an instance. - rpc UpdateAppProfile(UpdateAppProfileRequest) returns (google.longrunning.Operation) { + rpc UpdateAppProfile(UpdateAppProfileRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}" body: "app_profile" @@ -199,47 +246,196 @@ service BigtableInstanceAdmin { } // Deletes an app profile from an instance. - rpc DeleteAppProfile(DeleteAppProfileRequest) returns (google.protobuf.Empty) { + 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) { + 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) { + 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) { + 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}`. + // 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) = { @@ -247,8 +443,8 @@ message CreateInstanceRequest { } ]; - // Required. The ID to be used when referring to the new instance within its project, - // e.g., just `myinstance` rather than + // 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]; @@ -260,7 +456,6 @@ message CreateInstanceRequest { // cluster ID, e.g., just `mycluster` rather than // `projects/myproject/instances/myinstance/clusters/mycluster`. // Fields marked `OutputOnly` must be left blank. - // Currently, at most four clusters can be specified. map clusters = 4 [(google.api.field_behavior) = REQUIRED]; } @@ -271,15 +466,15 @@ message GetInstanceRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Instance" + 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}`. + // 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) = { @@ -315,7 +510,8 @@ message PartialUpdateInstanceRequest { // 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]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for BigtableInstanceAdmin.DeleteInstance. @@ -325,25 +521,24 @@ message DeleteInstanceRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Instance" + 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}`. + // 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: "bigtable.googleapis.com/Instance" + 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 + // 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]; @@ -359,21 +554,22 @@ message GetClusterRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Cluster" + 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/-`. + // 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: "bigtable.googleapis.com/Instance" + type: "bigtableadmin.googleapis.com/Instance" } ]; @@ -399,12 +595,12 @@ message ListClustersResponse { // 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}`. + // 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: "bigtable.googleapis.com/Cluster" + type: "bigtableadmin.googleapis.com/Cluster" } ]; } @@ -435,6 +631,37 @@ message UpdateInstanceMetadata { // 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; @@ -443,6 +670,16 @@ message CreateClusterMetadata { // 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. @@ -457,20 +694,42 @@ message UpdateClusterMetadata { 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}`. + // 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: "bigtable.googleapis.com/Instance" + 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 + // 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]; @@ -484,27 +743,27 @@ message CreateAppProfileRequest { // 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}`. + // 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: "bigtable.googleapis.com/AppProfile" + 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 + // 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: "bigtable.googleapis.com/Instance" + type: "bigtableadmin.googleapis.com/Instance" } ]; @@ -547,7 +806,8 @@ message UpdateAppProfileRequest { // 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]; + 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; @@ -555,12 +815,13 @@ message UpdateAppProfileRequest { // Request message for BigtableInstanceAdmin.DeleteAppProfile. message DeleteAppProfileRequest { - // Required. The unique name of the app profile to be deleted. Values are of the form + // 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: "bigtable.googleapis.com/AppProfile" + type: "bigtableadmin.googleapis.com/AppProfile" } ]; @@ -569,6 +830,308 @@ message DeleteAppProfileRequest { } // The metadata for the Operation returned by UpdateAppProfile. -message UpdateAppProfileMetadata { +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/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto index d979dba597..6267fa9097 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -31,7 +31,7 @@ import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; +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"; @@ -72,7 +72,8 @@ service BigtableTableAdmin { // 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) { + rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot" body: "*" @@ -100,6 +101,19 @@ service BigtableTableAdmin { 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) = { @@ -108,6 +122,75 @@ service BigtableTableAdmin { 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 @@ -134,7 +217,8 @@ service BigtableTableAdmin { // 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) { + rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) + returns (GenerateConsistencyTokenResponse) { option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken" body: "*" @@ -145,7 +229,8 @@ service BigtableTableAdmin { // 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) { + rpc CheckConsistency(CheckConsistencyRequest) + returns (CheckConsistencyResponse) { option (google.api.http) = { post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency" body: "*" @@ -161,12 +246,14 @@ service BigtableTableAdmin { // 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) { + 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.api.method_signature) = + "name,cluster,snapshot_id,description"; option (google.longrunning.operation_info) = { response_type: "Snapshot" metadata_type: "SnapshotTableMetadata" @@ -221,8 +308,8 @@ service BigtableTableAdmin { // [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. + // [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" @@ -269,12 +356,11 @@ service BigtableTableAdmin { option (google.api.method_signature) = "parent"; } - // Create a new table by restoring from a completed backup. The new table - // must be in the same instance as the instance containing the backup. The + // 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.RestoreTableMetadata]. The + // [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) { @@ -288,10 +374,26 @@ service BigtableTableAdmin { }; } - // Gets the access control policy for a Table or Backup resource. + // 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) { + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy" body: "*" @@ -299,13 +401,22 @@ service BigtableTableAdmin { 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 Table or Backup 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) { + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) + returns (google.iam.v1.Policy) { option (google.api.http) = { post: "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy" body: "*" @@ -313,12 +424,22 @@ service BigtableTableAdmin { 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 Table or Backup resource. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + // 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: "*" @@ -326,21 +447,83 @@ service BigtableTableAdmin { 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. This instance must be the parent of the source backup. Values are - // of the form `projects//instances/`. + // table. Values are of the form `projects//instances/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Instance" + type: "bigtableadmin.googleapis.com/Instance" } ]; @@ -355,8 +538,8 @@ message RestoreTableRequest { // 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: "bigtable.googleapis.com/Backup" - }]; + type: "bigtableadmin.googleapis.com/Backup" + }]; } } @@ -370,7 +553,8 @@ message RestoreTableMetadata { RestoreSourceType source_type = 2; // Information about the source used to restore the table, as specified by - // `source` in [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest]. + // `source` in + // [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest]. oneof source_info { BackupInfo backup_info = 3; } @@ -386,7 +570,8 @@ message RestoreTableMetadata { // not successful. string optimize_table_operation_name = 4; - // The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] + // The progress of the + // [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] // operation. OperationProgress progress = 5; } @@ -417,12 +602,12 @@ message CreateTableRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Instance" + 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`. + // 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]; @@ -461,22 +646,22 @@ message CreateTableFromSnapshotRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Instance" + 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`. + // 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 + // 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: "bigtable.googleapis.com/Snapshot" + type: "bigtableadmin.googleapis.com/Snapshot" } ]; } @@ -490,7 +675,7 @@ message DropRowRangeRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/Table" } ]; @@ -508,17 +693,17 @@ message DropRowRangeRequest { // 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}`. + // 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: "bigtable.googleapis.com/Instance" + type: "bigtableadmin.googleapis.com/Instance" } ]; // The view to be applied to the returned tables' fields. - // Only NAME_ONLY view (default) and REPLICATION_VIEW are supported. + // NAME_ONLY view (default) and REPLICATION_VIEW are supported. Table.View view = 2; // Maximum number of results per page. @@ -557,7 +742,7 @@ message GetTableRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/Table" } ]; @@ -566,6 +751,46 @@ message GetTableRequest { 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 { @@ -575,11 +800,38 @@ message DeleteTableRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Table" + 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 { @@ -588,7 +840,7 @@ message ModifyColumnFamiliesRequest { // The ID of the column family to be modified. string id = 1; - // Column familiy modifications. + // Column family modifications. oneof mod { // Create a new column family with the specified schema, or fail if // one already exists with the given ID. @@ -602,6 +854,12 @@ message ModifyColumnFamiliesRequest { // 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. @@ -610,27 +868,31 @@ message ModifyColumnFamiliesRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Table" + 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]; + // 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 + // 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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/Table" } ]; } @@ -645,20 +907,42 @@ message GenerateConsistencyTokenResponse { // 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 + // 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: "bigtable.googleapis.com/Table" + 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 { @@ -681,7 +965,7 @@ message SnapshotTableRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/Table" } ]; @@ -691,13 +975,13 @@ message SnapshotTableRequest { string cluster = 2 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Cluster" + 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 + // 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]; @@ -725,7 +1009,7 @@ message GetSnapshotRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Snapshot" + type: "bigtableadmin.googleapis.com/Snapshot" } ]; } @@ -738,15 +1022,15 @@ message GetSnapshotRequest { // 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 + // 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: "bigtable.googleapis.com/Cluster" + type: "bigtableadmin.googleapis.com/Cluster" } ]; @@ -789,7 +1073,7 @@ message DeleteSnapshotRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Snapshot" + type: "bigtableadmin.googleapis.com/Snapshot" } ]; } @@ -829,7 +1113,8 @@ message CreateTableFromSnapshotMetadata { google.protobuf.Timestamp finish_time = 3; } -// The request for [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. +// 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 @@ -837,7 +1122,7 @@ message CreateBackupRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Cluster" + type: "bigtableadmin.googleapis.com/Cluster" } ]; @@ -869,11 +1154,13 @@ message CreateBackupMetadata { google.protobuf.Timestamp end_time = 4; } -// The request for [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. +// 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]; @@ -882,10 +1169,12 @@ message UpdateBackupRequest { // 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]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } -// The request for [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. +// The request for +// [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. message GetBackupRequest { // Required. Name of the backup. // Values are of the form @@ -893,12 +1182,13 @@ message GetBackupRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Backup" + type: "bigtableadmin.googleapis.com/Backup" } ]; } -// The request for [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. +// The request for +// [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. message DeleteBackupRequest { // Required. Name of the backup to delete. // Values are of the form @@ -906,12 +1196,13 @@ message DeleteBackupRequest { string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Backup" + type: "bigtableadmin.googleapis.com/Backup" } ]; } -// The request for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. +// 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}`. @@ -920,7 +1211,7 @@ message ListBackupsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Cluster" + type: "bigtableadmin.googleapis.com/Cluster" } ]; @@ -932,13 +1223,14 @@ message ListBackupsRequest { // 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` + // + // * `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, @@ -946,30 +1238,32 @@ message ListBackupsRequest { // // 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 + // * `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. + // 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 + // + // * 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 @@ -985,19 +1279,382 @@ message ListBackupsRequest { 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`. + // [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]. +// 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. + // [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/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto index 17c69d469a..0503e3f3c4 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package google.bigtable.admin.v2; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; +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"; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto index d590788b2d..5baa006a9c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -19,9 +19,10 @@ 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 = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; +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"; @@ -38,8 +39,10 @@ option (google.api.resource_definition) = { // [Clusters][google.bigtable.admin.v2.Cluster] in the instance. message Instance { option (google.api.resource) = { - type: "bigtable.googleapis.com/Instance" + type: "bigtableadmin.googleapis.com/Instance" pattern: "projects/{project}/instances/{instance}" + plural: "instances" + singular: "instance" }; // Possible states of an instance. @@ -67,28 +70,22 @@ message Instance { // on the cluster. PRODUCTION = 1; - // The instance is meant for development and testing purposes only; it has - // no performance or uptime guarantees and is not covered by SLA. - // After a development instance is created, it can be upgraded by - // updating the instance to type `PRODUCTION`. An instance created - // as a production instance cannot be changed to a development instance. - // When creating a development instance, `serve_nodes` on the cluster must - // not be set. + // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces + // a higher minimum node count than DEVELOPMENT. DEVELOPMENT = 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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]; - // (`OutputOnly`) - // The current state of the instance. - State state = 3; + // 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; @@ -105,6 +102,59 @@ message Instance { // * 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 @@ -112,26 +162,12 @@ message Instance { // [Instance][google.bigtable.admin.v2.Instance]. message Cluster { option (google.api.resource) = { - type: "bigtable.googleapis.com/Cluster" + type: "bigtableadmin.googleapis.com/Cluster" pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" + plural: "clusters" + singular: "cluster" }; - // 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. - // 3) All clusters within an instance must use the same CMEK key. - string kms_key_name = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - } - // Possible states of a cluster. enum State { // The state of the cluster could not be determined. @@ -157,30 +193,91 @@ message 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + string name = 1; - // (`CreationOnly`) - // The location where this cluster's nodes and storage reside. For best - // performance, clients should be located as close as possible to 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.resource_reference) = { - type: "locations.googleapis.com/Location" - }]; - - // The current state of the cluster. + 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]; - // Required. The number of nodes allocated to this cluster. More nodes enable - // higher throughput and more consistent performance. - int32 serve_nodes = 4 [(google.api.field_behavior) = REQUIRED]; + // 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; + } - // (`CreationOnly`) - // The type of storage used by this cluster to serve its + // Immutable. The type of storage used by this cluster to serve its // parent instance's tables, unless explicitly overridden. - StorageType default_storage_type = 5; + StorageType default_storage_type = 5 + [(google.api.field_behavior) = IMMUTABLE]; // Immutable. The encryption configuration for CMEK-protected clusters. EncryptionConfig encryption_config = 6 @@ -191,8 +288,10 @@ message Cluster { // from a particular end user application. message AppProfile { option (google.api.resource) = { - type: "bigtable.googleapis.com/AppProfile" + 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 @@ -200,7 +299,36 @@ message AppProfile { // transient errors or delays. Clusters in a region are considered // equidistant. Choosing this option sacrifices read-your-writes consistency // to improve availability. - message MultiClusterRoutingUseAny {} + 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 @@ -215,7 +343,49 @@ message AppProfile { bool allow_transactional_writes = 2; } - // (`OutputOnly`) + // 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; @@ -230,7 +400,7 @@ message AppProfile { // details. string etag = 2; - // Optional long form description of the use case for this AppProfile. + // 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. @@ -242,4 +412,122 @@ message AppProfile { // 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/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto index a5578225ea..6da7f8b487 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,12 +18,13 @@ 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 = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; +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"; @@ -34,15 +35,6 @@ option (google.api.resource_definition) = { pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" }; -// 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; -} - // Information about a table restore. message RestoreInfo { // The type of the restore source. @@ -56,11 +48,21 @@ message RestoreInfo { } } +// 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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/Table" pattern: "projects/{project}/instances/{instance}/tables/{table}" }; @@ -96,7 +98,8 @@ message Table { } // Output only. The state of replication for the table in this cluster. - ReplicationState replication_state = 1; + 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 @@ -133,13 +136,37 @@ message Table { // state. REPLICATION_VIEW = 3; - // Only populates 'name' and fields related to the table's encryption state. + // 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` @@ -150,23 +177,184 @@ message Table { // 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; + map cluster_states = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // (`CreationOnly`) // The column families configured for this table, mapped by column family ID. - // Views: `SCHEMA_VIEW`, `FULL` + // Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` map column_families = 3; - // (`CreationOnly`) - // 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; + // 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; + 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. @@ -178,6 +366,18 @@ message ColumnFamily { // 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. @@ -266,7 +466,7 @@ message EncryptionInfo { // for production use. It is not subject to any SLA or deprecation policy. message Snapshot { option (google.api.resource) = { - type: "bigtable.googleapis.com/Snapshot" + type: "bigtableadmin.googleapis.com/Snapshot" pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" }; @@ -284,39 +484,40 @@ message Snapshot { CREATING = 2; } - // Output only. The unique name of the snapshot. + // 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; + 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; + 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.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // 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 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; + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Description of the snapshot. + // Description of the snapshot. string description = 7; } // A backup of a Cloud Bigtable table. message Backup { option (google.api.resource) = { - type: "bigtable.googleapis.com/Backup" + type: "bigtableadmin.googleapis.com/Backup" pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" }; @@ -333,7 +534,24 @@ message Backup { READY = 2; } - // Output only. A globally unique identifier for the backup which cannot be + // 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]*` @@ -343,7 +561,7 @@ message Backup { // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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 @@ -353,11 +571,19 @@ message Backup { (google.api.field_behavior) = REQUIRED ]; - // Required. The expiration time of the backup, with microseconds - // 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. + // 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]; @@ -383,6 +609,19 @@ message Backup { // 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. @@ -402,4 +641,88 @@ message BackupInfo { // 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/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/types.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/types.proto new file mode 100644 index 0000000000..adafda693b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml b/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml index 0259e4ee6e..24ba9badcd 100644 --- a/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml +++ b/proto-google-cloud-bigtable-v2/clirr-ignored-differences.xml @@ -4,6 +4,127 @@ 7012 com/google/bigtable/v2/*OrBuilder - * has*(*) + * 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/proto-google-cloud-bigtable-v2/pom.xml b/proto-google-cloud-bigtable-v2/pom.xml index af55904f80..837b3fd7be 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 1.20.2-SNAPSHOT + 2.76.0 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 1.20.2-SNAPSHOT + 2.76.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import com.google.cloud google-cloud-bigtable-bom - 1.20.2-SNAPSHOT + 2.76.0 pom import diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValue.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValue.java new file mode 100644 index 0000000000..313ec8d580 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValueOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValueOrBuilder.java new file mode 100644 index 0000000000..1d0a4b98de --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewName.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewName.java new file mode 100644 index 0000000000..99ece5465f --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java index 774b16d0a3..3a75fff0ac 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class BigtableProto { +@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) { @@ -29,64 +42,136 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_v2_ReadRowsRequest_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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; @@ -96,116 +181,333 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n!google/bigtable/v2/bigtable.proto\022\022goo" + "\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\035google/bigtable/v2/data.prot" - + "o\032\036google/protobuf/wrappers.proto\032\027googl" - + "e/rpc/status.proto\"\321\001\n\017ReadRowsRequest\0229" - + "\n\ntable_name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtable.goo" - + "gleapis.com/Table\022\026\n\016app_profile_id\030\005 \001(" - + "\t\022(\n\004rows\030\002 \001(\0132\032.google.bigtable.v2.Row" - + "Set\022-\n\006filter\030\003 \001(\0132\035.google.bigtable.v2" - + ".RowFilter\022\022\n\nrows_limit\030\004 \001(\003\"\370\002\n\020ReadR" - + "owsResponse\022>\n\006chunks\030\001 \003(\0132..google.big" - + "table.v2.ReadRowsResponse.CellChunk\022\034\n\024l" - + "ast_scanned_row_key\030\002 \001(\014\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\020t" - + "imestamp_micros\030\004 \001(\003\022\016\n\006labels\030\005 \003(\t\022\r\n" - + "\005value\030\006 \001(\014\022\022\n\nvalue_size\030\007 \001(\005\022\023\n\trese" - + "t_row\030\010 \001(\010H\000\022\024\n\ncommit_row\030\t \001(\010H\000B\014\n\nr" - + "ow_status\"i\n\024SampleRowKeysRequest\0229\n\ntab" - + "le_name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtable.googleap" - + "is.com/Table\022\026\n\016app_profile_id\030\002 \001(\t\">\n\025" - + "SampleRowKeysResponse\022\017\n\007row_key\030\001 \001(\014\022\024" - + "\n\014offset_bytes\030\002 \001(\003\"\261\001\n\020MutateRowReques" - + "t\0229\n\ntable_name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtable." - + "googleapis.com/Table\022\026\n\016app_profile_id\030\004" - + " \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340A\002\0224\n\tmutations\030" - + "\003 \003(\0132\034.google.bigtable.v2.MutationB\003\340A\002" - + "\"\023\n\021MutateRowResponse\"\371\001\n\021MutateRowsRequ" - + "est\0229\n\ntable_name\030\001 \001(\tB%\340A\002\372A\037\n\035bigtabl" - + "e.googleapis.com/Table\022\026\n\016app_profile_id" - + "\030\003 \001(\t\022A\n\007entries\030\002 \003(\0132+.google.bigtabl" - + "e.v2.MutateRowsRequest.EntryB\003\340A\002\032N\n\005Ent" - + "ry\022\017\n\007row_key\030\001 \001(\014\0224\n\tmutations\030\002 \003(\0132\034" - + ".google.bigtable.v2.MutationB\003\340A\002\"\217\001\n\022Mu" - + "tateRowsResponse\022=\n\007entries\030\001 \003(\0132,.goog" - + "le.bigtable.v2.MutateRowsResponse.Entry\032" - + ":\n\005Entry\022\r\n\005index\030\001 \001(\003\022\"\n\006status\030\002 \001(\0132" - + "\022.google.rpc.Status\"\251\002\n\030CheckAndMutateRo" - + "wRequest\0229\n\ntable_name\030\001 \001(\tB%\340A\002\372A\037\n\035bi" - + "gtable.googleapis.com/Table\022\026\n\016app_profi" - + "le_id\030\007 \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340A\002\0227\n\020pre" - + "dicate_filter\030\006 \001(\0132\035.google.bigtable.v2" - + ".RowFilter\0224\n\016true_mutations\030\004 \003(\0132\034.goo" - + "gle.bigtable.v2.Mutation\0225\n\017false_mutati" - + "ons\030\005 \003(\0132\034.google.bigtable.v2.Mutation\"" - + "6\n\031CheckAndMutateRowResponse\022\031\n\021predicat" - + "e_matched\030\001 \001(\010\"\301\001\n\031ReadModifyWriteRowRe" - + "quest\0229\n\ntable_name\030\001 \001(\tB%\340A\002\372A\037\n\035bigta" - + "ble.googleapis.com/Table\022\026\n\016app_profile_" - + "id\030\004 \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340A\002\022;\n\005rules\030" - + "\003 \003(\0132\'.google.bigtable.v2.ReadModifyWri" - + "teRuleB\003\340A\002\"B\n\032ReadModifyWriteRowRespons" - + "e\022$\n\003row\030\001 \001(\0132\027.google.bigtable.v2.Row2" - + "\304\016\n\010Bigtable\022\306\001\n\010ReadRows\022#.google.bigta" - + "ble.v2.ReadRowsRequest\032$.google.bigtable" - + ".v2.ReadRowsResponse\"m\202\323\344\223\002>\"9/v2/{table" - + "_name=projects/*/instances/*/tables/*}:r" - + "eadRows:\001*\332A\ntable_name\332A\031table_name,app" - + "_profile_id0\001\022\327\001\n\rSampleRowKeys\022(.google" - + ".bigtable.v2.SampleRowKeysRequest\032).goog" - + "le.bigtable.v2.SampleRowKeysResponse\"o\202\323" - + "\344\223\002@\022>/v2/{table_name=projects/*/instanc" - + "es/*/tables/*}:sampleRowKeys\332A\ntable_nam" - + "e\332A\031table_name,app_profile_id0\001\022\355\001\n\tMuta" - + "teRow\022$.google.bigtable.v2.MutateRowRequ" - + "est\032%.google.bigtable.v2.MutateRowRespon" - + "se\"\222\001\202\323\344\223\002?\":/v2/{table_name=projects/*/" - + "instances/*/tables/*}:mutateRow:\001*\332A\034tab" - + "le_name,row_key,mutations\332A+table_name,r" - + "ow_key,mutations,app_profile_id\022\336\001\n\nMuta" - + "teRows\022%.google.bigtable.v2.MutateRowsRe" - + "quest\032&.google.bigtable.v2.MutateRowsRes" - + "ponse\"\177\202\323\344\223\002@\";/v2/{table_name=projects/" - + "*/instances/*/tables/*}:mutateRows:\001*\332A\022" - + "table_name,entries\332A!table_name,entries," - + "app_profile_id0\001\022\331\002\n\021CheckAndMutateRow\022," - + ".google.bigtable.v2.CheckAndMutateRowReq" - + "uest\032-.google.bigtable.v2.CheckAndMutate" - + "RowResponse\"\346\001\202\323\344\223\002G\"B/v2/{table_name=pr" - + "ojects/*/instances/*/tables/*}:checkAndM" - + "utateRow:\001*\332ABtable_name,row_key,predica" - + "te_filter,true_mutations,false_mutations" - + "\332AQtable_name,row_key,predicate_filter,t" - + "rue_mutations,false_mutations,app_profil" - + "e_id\022\211\002\n\022ReadModifyWriteRow\022-.google.big" - + "table.v2.ReadModifyWriteRowRequest\032..goo" - + "gle.bigtable.v2.ReadModifyWriteRowRespon" - + "se\"\223\001\202\323\344\223\002H\"C/v2/{table_name=projects/*/" - + "instances/*/tables/*}:readModifyWriteRow" - + ":\001*\332A\030table_name,row_key,rules\332A\'table_n" - + "ame,row_key,rules,app_profile_id\032\333\002\312A\027bi" - + "gtable.googleapis.com\322A\275\002https://www.goo" - + "gleapis.com/auth/bigtable.data,https://w" - + "ww.googleapis.com/auth/bigtable.data.rea" - + "donly,https://www.googleapis.com/auth/cl" - + "oud-bigtable.data,https://www.googleapis" - + ".com/auth/cloud-bigtable.data.readonly,h" - + "ttps://www.googleapis.com/auth/cloud-pla" - + "tform,https://www.googleapis.com/auth/cl" - + "oud-platform.read-onlyB\223\002\n\026com.google.bi" - + "gtable.v2B\rBigtableProtoP\001Z:google.golan" - + "g.org/genproto/googleapis/bigtable/v2;bi" - + "gtable\252\002\030Google.Cloud.Bigtable.V2\312\002\030Goog" - + "le\\Cloud\\Bigtable\\V2\352\002\033Google::Cloud::Bi" - + "gtable::V2\352AW\n\035bigtable.googleapis.com/T" - + "able\0226projects/{project}/instances/{inst" - + "ance}/tables/{table}b\006proto3" + + "urce.proto\032\030google/api/routing.proto\032\035go" + + "ogle/bigtable/v2/data.proto\032&google/bigt" + + "able/v2/request_stats.proto\032\036google/bigt" + + "able/v2/types.proto\032\036google/protobuf/dur" + + "ation.proto\032\037google/protobuf/timestamp.p" + + "roto\032\036google/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.g" + + "oogle.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.bi" + + "gtable.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.googl" + + "e.bigtable.v2.ReadChangeStreamResponse.DataChangeH\000\022K\n" + + "\theartbeat\030\002 \001(\01326.google." + + "bigtable.v2.ReadChangeStreamResponse.HeartbeatH\000\022P\n" + + "\014close_stream\030\003 \001(\01328.google." + + "bigtable.v2.ReadChangeStreamResponse.CloseStreamH\000\032\364\001\n\r" + + "MutationChunk\022X\n\n" + + "chunk_info\030\001 \001(\0132D.google.bigtable.v2.ReadChange" + + "StreamResponse.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(\0162<.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:.google.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+.g" + + "oogle.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.v" + + "2.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\333\'\n" + + "\010Bigtable\022\325\004\n" + + "\010ReadRows\022#.go" + + "ogle.bigtable.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_view_name=projects/*/instances/*/tabl" + + "es/*/authorizedViews/*}:readRows:\001*ZU\"P/v2/{materialized_view_name=projects/*/in" + + "stances/*/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.SampleRowKeysReque" + + "st\032).google.bigtable.v2.SampleRowKeysResponse\"\201\004\332A\n" + + "table_name\332A\031table_name,app_p" + + "rofile_id\202\323\344\223\002\367\001\022>/v2/{table_name=projec" + + "ts/*/instances/*/tables/*}:sampleRowKeysZ\\\022Z/v2/{authorized_view_name=projects/*" + + "/instances/*/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.Mut" + + "ateRowResponse\"\216\003\332A\034table_name,row_key,m" + + "utations\332A+table_name,row_key,mutations," + + "app_profile_id\202\323\344\223\002\234\001\":/v2/{table_name=p" + + "rojects/*/instances/*/tables/*}:mutateRow:\001*Z[\"V/v2/{authorized_view_name=projec" + + "ts/*/instances/*/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_vie" + + "w_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\334\003\n\n" + + "MutateRows\022%.google.bigtable.v2.MutateRowsRequest\032&.google.b" + + "igtable.v2.MutateRowsResponse\"\374\002\332A\022table" + + "_name,entries\332A!table_name,entries,app_p" + + "rofile_id\202\323\344\223\002\236\001\";/v2/{table_name=projec" + + "ts/*/instances/*/tables/*}:mutateRows:\001*Z\\\"W/v2/{authorized_view_name=projects/*" + + "/instances/*/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_n" + + "ame\022/{table_name=projects/*/instances/*/tables/*}/**0\001\022\335\004\n" + + "\021CheckAndMutateRow\022,.google.bigtable.v2.CheckAndMutateRowReque" + + "st\032-.google.bigtable.v2.CheckAndMutateRo" + + "wResponse\"\352\003\332ABtable_name,row_key,predic" + + "ate_filter,true_mutations,false_mutations\332AQtable_name,row_key,predicate_filter," + + "true_mutations,false_mutations,app_profi" + + "le_id\202\323\344\223\002\254\001\"B/v2/{table_name=projects/*" + + "/instances/*/tables/*}:checkAndMutateRow:\001*Zc\"^/v2/{authorized_view_name=project" + + "s/*/instances/*/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" + + "\024authori" + + "zed_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\356\001\n" + + "\013PingAndWarm\022&.google.bigtable.v2.PingAndWarmRequest\032\'" + + ".google.bigtable.v2.PingAndWarmResponse\"" + + "\215\001\332A\004name\332A\023name,app_profile_id\202\323\344\223\002+\"&/" + + "v2/{name=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.ReadModifyWr" + + "iteRowRequest\032..google.bigtable.v2.ReadM" + + "odifyWriteRowResponse\"\230\003\332A\030table_name,ro" + + "w_key,rules\332A\'table_name,row_key,rules,a" + + "pp_profile_id\202\323\344\223\002\256\001\"C/v2/{table_name=pr" + + "ojects/*/instances/*/tables/*}:readModifyWriteRow:\001*Zd\"_/v2/{authorized_view_nam" + + "e=projects/*/instances/*/tables/*/author" + + "izedViews/*}: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" + + "\024authorized_view_name\022/{table_name=projects/*/instances/*/tables/*}/**\022\273\002\n" + + "%GenerateInitialChangeStreamPartitions\022@.goo" + + "gle.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest\032A.google.bigtable.v" + + "2.GenerateInitialChangeStreamPartitionsResponse\"\212\001\332A\n" + + "table_name\332A\031table_name,app" + + "_profile_id\202\323\344\223\002[\"V/v2/{table_name=proje" + + "cts/*/instances/*/tables/*}:generateInitialChangeStreamPartitions:\001*0\001\022\346\001\n" + + "\020ReadChangeStream\022+.google.bigtable.v2.ReadCha" + + "ngeStreamRequest\032,.google.bigtable.v2.ReadChangeStreamResponse\"u\332A\n" + + "table_name\332A\031table_name,app_profile_id\202\323\344\223\002F\"A/v2/{ta" + + "ble_name=projects/*/instances/*/tables/*}:readChangeStream:\001*0\001\022\251\002\n" + + "\014PrepareQuery\022\'.google.bigtable.v2.PrepareQueryReques" + + "t\032(.google.bigtable.v2.PrepareQueryRespo" + + "nse\"\305\001\332A\023instance_name,query\332A\"instance_" + + "name,query,app_profile_id\202\323\344\223\002<\"7/v2/{in" + + "stance_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.ExecuteQueryRequest\032(.google.bigtable." + + "v2.ExecuteQueryResponse\"\305\001\332A\023instance_na" + + "me,query\332A\"instance_name,query,app_profi" + + "le_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\032\333\002\312A\027bigtable." + + "googleapis.com\322A\275\002https://www.googleapis" + + ".com/auth/bigtable.data,https://www.googleapis.com/auth/bigtable.data.readonly,h" + + "ttps://www.googleapis.com/auth/cloud-bigtable.data,https://www.googleapis.com/au" + + "th/cloud-bigtable.data.readonly,https://www.googleapis.com/auth/cloud-platform,h" + + "ttps://www.googleapis.com/auth/cloud-platform.read-onlyB\365\004\n" + + "\026com.google.bigtable.v2B\r" + + "BigtableProtoP\001Z8cloud.google.com/go" + + "/bigtable/apiv2/bigtablepb;bigtablepb\252\002\030" + + "Google.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\" + + "Bigtable\\V2\352\002\033Google::Cloud::Bigtable::V2\352AP\n" + + "%bigtableadmin.googleapis.com/Insta" + + "nce\022\'projects/{project}/instances/{instance}\352A\\\n" + + "\"bigtableadmin.googleapis.com/Ta" + + "ble\0226projects/{project}/instances/{instance}/tables/{table}\352A\207\001\n" + + "+bigtableadmin.googleapis.com/AuthorizedView\022Xprojects/{" + + "project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}\352A~\n" + + "-bigtableadmin.googleapis.com/MaterializedView\022Mprojects/{project}/instances/{" + + "instance}/materializedViews/{materialized_view}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -215,30 +517,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), com.google.bigtable.v2.DataProto.getDescriptor(), + com.google.bigtable.v2.RequestStatsProto.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().getMessageTypes().get(0); + getDescriptor().getMessageType(0); internal_static_google_bigtable_v2_ReadRowsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_ReadRowsRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", "Rows", "Filter", "RowsLimit", + "TableName", + "AuthorizedViewName", + "MaterializedViewName", + "AppProfileId", + "Rows", + "Filter", + "RowsLimit", + "RequestStatsView", + "Reversed", }); internal_static_google_bigtable_v2_ReadRowsResponse_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageType(1); internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_ReadRowsResponse_descriptor, new java.lang.String[] { - "Chunks", "LastScannedRowKey", + "Chunks", "LastScannedRowKey", "RequestStats", }); internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor = - internal_static_google_bigtable_v2_ReadRowsResponse_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_ReadRowsResponse_descriptor.getNestedType(0); internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor, new java.lang.String[] { "RowKey", @@ -253,74 +568,87 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "RowStatus", }); internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageType(2); internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", + "TableName", "AuthorizedViewName", "MaterializedViewName", "AppProfileId", }); internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageType(3); internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(4); + getDescriptor().getMessageType(4); internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_MutateRowRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", "RowKey", "Mutations", + "TableName", + "AuthorizedViewName", + "AppProfileId", + "RowKey", + "Mutations", + "Idempotency", }); internal_static_google_bigtable_v2_MutateRowResponse_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageType(5); internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(6); + getDescriptor().getMessageType(6); internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_MutateRowsRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", "Entries", + "TableName", "AuthorizedViewName", "AppProfileId", "Entries", }); internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor = - internal_static_google_bigtable_v2_MutateRowsRequest_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_MutateRowsRequest_descriptor.getNestedType(0); internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor, new java.lang.String[] { - "RowKey", "Mutations", + "RowKey", "Mutations", "Idempotency", }); internal_static_google_bigtable_v2_MutateRowsResponse_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageType(7); internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_MutateRowsResponse_descriptor, new java.lang.String[] { - "Entries", + "Entries", "RateLimitInfo", }); internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor = - internal_static_google_bigtable_v2_MutateRowsResponse_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_MutateRowsResponse_descriptor.getNestedType(0); internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(8); + getDescriptor().getMessageType(9); internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor, new java.lang.String[] { "TableName", + "AuthorizedViewName", "AppProfileId", "RowKey", "PredicateFilter", @@ -328,29 +656,199 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FalseMutations", }); internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageType(10); internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(10); + getDescriptor().getMessageType(13); internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", "RowKey", "Rules", + "TableName", "AuthorizedViewName", "AppProfileId", "RowKey", "Rules", }); internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageType(14); internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.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); @@ -360,15 +858,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ClientProto.oauthScopes); registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.api.RoutingProto.routing); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.bigtable.v2.DataProto.getDescriptor(); - com.google.protobuf.WrappersProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java index e9fcd3494b..17f06c8b62 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,91 +29,31 @@ * * Protobuf type {@code google.bigtable.v2.Cell} */ -public final class Cell extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Cell(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Cell() { value_ = com.google.protobuf.ByteString.EMPTY; - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Cell(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Cell( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - timestampMicros_ = input.readInt64(); - break; - } - case 18: - { - value_ = input.readBytes(); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - labels_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - labels_.add(s); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - labels_ = labels_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -119,7 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Cell_fieldAccessorTable @@ -128,7 +70,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 1; - private long timestampMicros_; + private long timestampMicros_ = 0L; + /** * * @@ -151,7 +94,8 @@ public long getTimestampMicros() { } public static final int VALUE_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString value_; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -171,7 +115,11 @@ public com.google.protobuf.ByteString getValue() { } public static final int LABELS_FIELD_NUMBER = 3; - private com.google.protobuf.LazyStringList labels_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -186,6 +134,7 @@ public com.google.protobuf.ByteString getValue() { public com.google.protobuf.ProtocolStringList getLabelsList() { return labels_; } + /** * * @@ -200,6 +149,7 @@ public com.google.protobuf.ProtocolStringList getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -215,6 +165,7 @@ public int getLabelsCount() { public java.lang.String getLabels(int index) { return labels_.get(index); } + /** * * @@ -252,9 +203,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeBytes(2, value_); } for (int i = 0; i < labels_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, labels_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 3, labels_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -277,7 +228,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getLabelsList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -295,7 +246,7 @@ public boolean equals(final java.lang.Object obj) { if (getTimestampMicros() != other.getTimestampMicros()) return false; if (!getValue().equals(other.getValue())) return false; if (!getLabelsList().equals(other.getLabelsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -314,7 +265,7 @@ public int hashCode() { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + getLabelsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -355,38 +306,38 @@ public static com.google.bigtable.v2.Cell parseFrom( public static com.google.bigtable.v2.Cell parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -409,10 +360,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -422,7 +374,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.Cell} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -431,7 +383,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Cell_fieldAccessorTable @@ -440,28 +392,19 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Cell.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; timestampMicros_ = 0L; - value_ = com.google.protobuf.ByteString.EMPTY; - - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -487,49 +430,25 @@ public com.google.bigtable.v2.Cell build() { @java.lang.Override public com.google.bigtable.v2.Cell buildPartial() { com.google.bigtable.v2.Cell result = new com.google.bigtable.v2.Cell(this); - int from_bitField0_ = bitField0_; - result.timestampMicros_ = timestampMicros_; - result.value_ = value_; - if (((bitField0_ & 0x00000001) != 0)) { - labels_ = labels_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (bitField0_ != 0) { + buildPartial0(result); } - result.labels_ = labels_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -547,20 +466,20 @@ public Builder mergeFrom(com.google.bigtable.v2.Cell other) { if (other.getTimestampMicros() != 0L) { setTimestampMicros(other.getTimestampMicros()); } - if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getValue().isEmpty()) { setValue(other.getValue()); } if (!other.labels_.isEmpty()) { if (labels_.isEmpty()) { labels_ = other.labels_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000004; } else { ensureLabelsIsMutable(); labels_.addAll(other.labels_); } onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -575,23 +494,57 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Cell parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.Cell) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private long timestampMicros_; + /** * * @@ -612,6 +565,7 @@ public Builder mergeFrom( public long getTimestampMicros() { return timestampMicros_; } + /** * * @@ -632,9 +586,11 @@ public long getTimestampMicros() { public Builder setTimestampMicros(long value) { timestampMicros_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -652,13 +608,14 @@ public Builder setTimestampMicros(long value) { * @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; + /** * * @@ -676,6 +633,7 @@ public Builder clearTimestampMicros() { public com.google.protobuf.ByteString getValue() { return value_; } + /** * * @@ -694,11 +652,12 @@ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -713,21 +672,22 @@ public Builder setValue(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearValue() { - + bitField0_ = (bitField0_ & ~0x00000002); value_ = getDefaultInstance().getValue(); onChanged(); return this; } - private com.google.protobuf.LazyStringList labels_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureLabelsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!labels_.isModifiable()) { labels_ = new com.google.protobuf.LazyStringArrayList(labels_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000004; } + /** * * @@ -740,8 +700,10 @@ private void ensureLabelsIsMutable() { * @return A list containing the labels. */ public com.google.protobuf.ProtocolStringList getLabelsList() { - return labels_.getUnmodifiableView(); + labels_.makeImmutable(); + return labels_; } + /** * * @@ -756,6 +718,7 @@ public com.google.protobuf.ProtocolStringList getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -771,6 +734,7 @@ public int getLabelsCount() { public java.lang.String getLabels(int index) { return labels_.get(index); } + /** * * @@ -786,6 +750,7 @@ public java.lang.String getLabels(int index) { public com.google.protobuf.ByteString getLabelsBytes(int index) { return labels_.getByteString(index); } + /** * * @@ -805,9 +770,11 @@ public Builder setLabels(int index, java.lang.String value) { } ensureLabelsIsMutable(); labels_.set(index, value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -826,9 +793,11 @@ public Builder addLabels(java.lang.String value) { } ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -844,9 +813,11 @@ public Builder addLabels(java.lang.String value) { public Builder addAllLabels(java.lang.Iterable values) { ensureLabelsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_); + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -859,11 +830,13 @@ public Builder addAllLabels(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearLabels() { - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; onChanged(); return this; } + /** * * @@ -883,21 +856,11 @@ public Builder addLabelsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Cell) } @@ -919,7 +882,18 @@ public Cell parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Cell(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java index 8f09773a0f..1706b7cccb 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CellOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -68,6 +71,7 @@ public interface CellOrBuilder * @return A list containing the labels. */ java.util.List getLabelsList(); + /** * * @@ -80,6 +84,7 @@ public interface CellOrBuilder * @return The count of labels. */ int getLabelsCount(); + /** * * @@ -93,6 +98,7 @@ public interface CellOrBuilder * @return The labels at the given index. */ java.lang.String getLabels(int index); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java index efa13e99a8..230c65a21e 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,140 +29,44 @@ * * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowRequest} */ -public final class CheckAndMutateRowRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + 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(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CheckAndMutateRowRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CheckAndMutateRowRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; - break; - } - case 18: - { - rowKey_ = input.readBytes(); - break; - } - case 34: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - trueMutations_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - trueMutations_.add( - input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry)); - break; - } - case 42: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - falseMutations_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - falseMutations_.add( - input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry)); - break; - } - case 50: - { - com.google.bigtable.v2.RowFilter.Builder subBuilder = null; - if (predicateFilter_ != null) { - subBuilder = predicateFilter_.toBuilder(); - } - predicateFilter_ = - input.readMessage(com.google.bigtable.v2.RowFilter.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(predicateFilter_); - predicateFilter_ = subBuilder.buildPartial(); - } - - break; - } - case 58: - { - java.lang.String s = input.readStringRequireUtf8(); - - appProfileId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - trueMutations_ = java.util.Collections.unmodifiableList(trueMutations_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - falseMutations_ = java.util.Collections.unmodifiableList(falseMutations_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable @@ -169,20 +75,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.v2.CheckAndMutateRowRequest.Builder.class); } + private int bitField0_; public static final int TABLE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object tableName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + /** * * *
    -   * Required. The unique name of the table to which the conditional mutation should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -199,18 +110,20 @@ public java.lang.String getTableName() { return s; } } + /** * * *
    -   * Required. The unique name of the table to which the conditional mutation should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -228,8 +141,76 @@ public com.google.protobuf.ByteString getTableNameBytes() { } } + 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; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + /** * * @@ -254,6 +235,7 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * @@ -280,12 +262,14 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { } public static final int ROW_KEY_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString rowKey_; + 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.
    +   * Required. The key of the row to which the conditional mutation should be
    +   * applied.
        * 
    * * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -299,6 +283,7 @@ public com.google.protobuf.ByteString getRowKey() { public static final int PREDICATE_FILTER_FIELD_NUMBER = 6; private com.google.bigtable.v2.RowFilter predicateFilter_; + /** * * @@ -315,8 +300,9 @@ public com.google.protobuf.ByteString getRowKey() { */ @java.lang.Override public boolean hasPredicateFilter() { - return predicateFilter_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -337,6 +323,7 @@ public com.google.bigtable.v2.RowFilter getPredicateFilter() { ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : predicateFilter_; } + /** * * @@ -351,11 +338,16 @@ public com.google.bigtable.v2.RowFilter getPredicateFilter() { */ @java.lang.Override public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { - return getPredicateFilter(); + 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_; + /** * * @@ -373,6 +365,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { public java.util.List getTrueMutationsList() { return trueMutations_; } + /** * * @@ -391,6 +384,7 @@ public java.util.List getTrueMutationsList() { getTrueMutationsOrBuilderList() { return trueMutations_; } + /** * * @@ -408,6 +402,7 @@ public java.util.List getTrueMutationsList() { public int getTrueMutationsCount() { return trueMutations_.size(); } + /** * * @@ -425,6 +420,7 @@ public int getTrueMutationsCount() { public com.google.bigtable.v2.Mutation getTrueMutations(int index) { return trueMutations_.get(index); } + /** * * @@ -444,7 +440,10 @@ public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int in } public static final int FALSE_MUTATIONS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") private java.util.List falseMutations_; + /** * * @@ -462,6 +461,7 @@ public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int in public java.util.List getFalseMutationsList() { return falseMutations_; } + /** * * @@ -480,6 +480,7 @@ public java.util.List getFalseMutationsList() { getFalseMutationsOrBuilderList() { return falseMutations_; } + /** * * @@ -497,6 +498,7 @@ public java.util.List getFalseMutationsList() { public int getFalseMutationsCount() { return falseMutations_.size(); } + /** * * @@ -514,6 +516,7 @@ public int getFalseMutationsCount() { public com.google.bigtable.v2.Mutation getFalseMutations(int index) { return falseMutations_.get(index); } + /** * * @@ -546,8 +549,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); } if (!rowKey_.isEmpty()) { output.writeBytes(2, rowKey_); @@ -558,13 +561,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < falseMutations_.size(); i++) { output.writeMessage(5, falseMutations_.get(i)); } - if (predicateFilter_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(6, getPredicateFilter()); } - if (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, appProfileId_); + 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_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -573,8 +579,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + 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_); @@ -585,13 +591,16 @@ public int getSerializedSize() { for (int i = 0; i < falseMutations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, falseMutations_.get(i)); } - if (predicateFilter_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getPredicateFilter()); } - if (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(7, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(9, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -608,6 +617,7 @@ public boolean equals(final java.lang.Object obj) { (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; @@ -616,7 +626,7 @@ public boolean equals(final java.lang.Object obj) { } if (!getTrueMutationsList().equals(other.getTrueMutationsList())) return false; if (!getFalseMutationsList().equals(other.getFalseMutationsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -629,6 +639,8 @@ public int hashCode() { 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; @@ -645,7 +657,7 @@ public int hashCode() { hash = (37 * hash) + FALSE_MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getFalseMutationsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -687,38 +699,38 @@ public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom( public static com.google.bigtable.v2.CheckAndMutateRowRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -741,10 +753,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -754,7 +767,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -764,7 +777,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable @@ -778,45 +791,46 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getTrueMutationsFieldBuilder(); - getFalseMutationsFieldBuilder(); + 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; - - if (predicateFilterBuilder_ == null) { - predicateFilter_ = null; - } else { - predicateFilter_ = null; + predicateFilter_ = null; + if (predicateFilterBuilder_ != null) { + predicateFilterBuilder_.dispose(); predicateFilterBuilder_ = null; } if (trueMutationsBuilder_ == null) { trueMutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + trueMutations_ = null; trueMutationsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000020); if (falseMutationsBuilder_ == null) { falseMutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + falseMutations_ = null; falseMutationsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000040); return this; } @@ -844,68 +858,57 @@ public com.google.bigtable.v2.CheckAndMutateRowRequest build() { public com.google.bigtable.v2.CheckAndMutateRowRequest buildPartial() { com.google.bigtable.v2.CheckAndMutateRowRequest result = new com.google.bigtable.v2.CheckAndMutateRowRequest(this); - int from_bitField0_ = bitField0_; - result.tableName_ = tableName_; - result.appProfileId_ = appProfileId_; - result.rowKey_ = rowKey_; - if (predicateFilterBuilder_ == null) { - result.predicateFilter_ = predicateFilter_; - } else { - result.predicateFilter_ = predicateFilterBuilder_.build(); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.CheckAndMutateRowRequest result) { if (trueMutationsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000020) != 0)) { trueMutations_ = java.util.Collections.unmodifiableList(trueMutations_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); } result.trueMutations_ = trueMutations_; } else { result.trueMutations_ = trueMutationsBuilder_.build(); } if (falseMutationsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000040) != 0)) { falseMutations_ = java.util.Collections.unmodifiableList(falseMutations_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); } result.falseMutations_ = falseMutations_; } else { result.falseMutations_ = falseMutationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -923,13 +926,20 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) 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() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getRowKey().isEmpty()) { setRowKey(other.getRowKey()); } if (other.hasPredicateFilter()) { @@ -939,7 +949,7 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) if (!other.trueMutations_.isEmpty()) { if (trueMutations_.isEmpty()) { trueMutations_ = other.trueMutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTrueMutationsIsMutable(); trueMutations_.addAll(other.trueMutations_); @@ -952,10 +962,10 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) trueMutationsBuilder_.dispose(); trueMutationsBuilder_ = null; trueMutations_ = other.trueMutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); trueMutationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getTrueMutationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetTrueMutationsFieldBuilder() : null; } else { trueMutationsBuilder_.addAllMessages(other.trueMutations_); @@ -966,7 +976,7 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) if (!other.falseMutations_.isEmpty()) { if (falseMutations_.isEmpty()) { falseMutations_ = other.falseMutations_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); } else { ensureFalseMutationsIsMutable(); falseMutations_.addAll(other.falseMutations_); @@ -979,17 +989,17 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) falseMutationsBuilder_.dispose(); falseMutationsBuilder_ = null; falseMutations_ = other.falseMutations_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); falseMutationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getFalseMutationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFalseMutationsFieldBuilder() : null; } else { falseMutationsBuilder_.addAllMessages(other.falseMutations_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1004,35 +1014,106 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.CheckAndMutateRowRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.CheckAndMutateRowRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object tableName_ = ""; + /** * * *
    -     * Required. The unique name of the table to which the conditional mutation should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -1048,18 +1129,20 @@ public java.lang.String getTableName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the conditional mutation should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -1075,18 +1158,20 @@ public com.google.protobuf.ByteString getTableNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the conditional mutation should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The tableName to set. @@ -1096,45 +1181,49 @@ 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 to which the conditional mutation should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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; } + /** * * *
    -     * Required. The unique name of the table to which the conditional mutation should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The bytes for tableName to set. @@ -1145,13 +1234,155 @@ public Builder setTableNameBytes(com.google.protobuf.ByteString value) { 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_ = ""; + /** * * @@ -1175,6 +1406,7 @@ public java.lang.String getAppProfileId() { return (java.lang.String) ref; } } + /** * * @@ -1198,6 +1430,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -1215,11 +1448,12 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1233,11 +1467,12 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1256,18 +1491,20 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { 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.
    +     * Required. The key of the row to which the conditional mutation should be
    +     * applied.
          * 
    * * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1278,11 +1515,13 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getRowKey() { return rowKey_; } + /** * * *
    -     * Required. The key of the row to which the conditional mutation should be applied.
    +     * Required. The key of the row to which the conditional mutation should be
    +     * applied.
          * 
    * * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1294,16 +1533,18 @@ 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.
    +     * Required. The key of the row to which the conditional mutation should be
    +     * applied.
          * 
    * * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -1311,18 +1552,19 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * @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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> predicateFilterBuilder_; + /** * * @@ -1338,8 +1580,9 @@ public Builder clearRowKey() { * @return Whether the predicateFilter field is set. */ public boolean hasPredicateFilter() { - return predicateFilterBuilder_ != null || predicateFilter_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * @@ -1363,6 +1606,7 @@ public com.google.bigtable.v2.RowFilter getPredicateFilter() { return predicateFilterBuilder_.getMessage(); } } + /** * * @@ -1381,13 +1625,14 @@ public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter value) { throw new NullPointerException(); } predicateFilter_ = value; - onChanged(); } else { predicateFilterBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1403,13 +1648,14 @@ public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter value) { public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { if (predicateFilterBuilder_ == null) { predicateFilter_ = builderForValue.build(); - onChanged(); } else { predicateFilterBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * @@ -1424,21 +1670,23 @@ public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter.Builder build */ public Builder mergePredicateFilter(com.google.bigtable.v2.RowFilter value) { if (predicateFilterBuilder_ == null) { - if (predicateFilter_ != null) { - predicateFilter_ = - com.google.bigtable.v2.RowFilter.newBuilder(predicateFilter_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && predicateFilter_ != null + && predicateFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getPredicateFilterBuilder().mergeFrom(value); } else { predicateFilter_ = value; } - onChanged(); } else { predicateFilterBuilder_.mergeFrom(value); } - + if (predicateFilter_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * @@ -1452,16 +1700,16 @@ public Builder mergePredicateFilter(com.google.bigtable.v2.RowFilter value) { * .google.bigtable.v2.RowFilter predicate_filter = 6; */ public Builder clearPredicateFilter() { - if (predicateFilterBuilder_ == null) { - predicateFilter_ = null; - onChanged(); - } else { - predicateFilter_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + predicateFilter_ = null; + if (predicateFilterBuilder_ != null) { + predicateFilterBuilder_.dispose(); predicateFilterBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1475,10 +1723,11 @@ public Builder clearPredicateFilter() { * .google.bigtable.v2.RowFilter predicate_filter = 6; */ public com.google.bigtable.v2.RowFilter.Builder getPredicateFilterBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getPredicateFilterFieldBuilder().getBuilder(); + return internalGetPredicateFilterFieldBuilder().getBuilder(); } + /** * * @@ -1500,6 +1749,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { : predicateFilter_; } } + /** * * @@ -1512,14 +1762,14 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { * * .google.bigtable.v2.RowFilter predicate_filter = 6; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> - getPredicateFilterFieldBuilder() { + internalGetPredicateFilterFieldBuilder() { if (predicateFilterBuilder_ == null) { predicateFilterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder>( @@ -1533,13 +1783,13 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() { java.util.Collections.emptyList(); private void ensureTrueMutationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000020) != 0)) { trueMutations_ = new java.util.ArrayList(trueMutations_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000020; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> @@ -1565,6 +1815,7 @@ public java.util.List getTrueMutationsList() { return trueMutationsBuilder_.getMessageList(); } } + /** * * @@ -1585,6 +1836,7 @@ public int getTrueMutationsCount() { return trueMutationsBuilder_.getCount(); } } + /** * * @@ -1605,6 +1857,7 @@ public com.google.bigtable.v2.Mutation getTrueMutations(int index) { return trueMutationsBuilder_.getMessage(index); } } + /** * * @@ -1631,6 +1884,7 @@ public Builder setTrueMutations(int index, com.google.bigtable.v2.Mutation value } return this; } + /** * * @@ -1655,6 +1909,7 @@ public Builder setTrueMutations( } return this; } + /** * * @@ -1681,6 +1936,7 @@ public Builder addTrueMutations(com.google.bigtable.v2.Mutation value) { } return this; } + /** * * @@ -1707,6 +1963,7 @@ public Builder addTrueMutations(int index, com.google.bigtable.v2.Mutation value } return this; } + /** * * @@ -1730,6 +1987,7 @@ public Builder addTrueMutations(com.google.bigtable.v2.Mutation.Builder builderF } return this; } + /** * * @@ -1754,6 +2012,7 @@ public Builder addTrueMutations( } return this; } + /** * * @@ -1778,6 +2037,7 @@ public Builder addAllTrueMutations( } return this; } + /** * * @@ -1794,13 +2054,14 @@ public Builder addAllTrueMutations( public Builder clearTrueMutations() { if (trueMutationsBuilder_ == null) { trueMutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { trueMutationsBuilder_.clear(); } return this; } + /** * * @@ -1824,6 +2085,7 @@ public Builder removeTrueMutations(int index) { } return this; } + /** * * @@ -1838,8 +2100,9 @@ public Builder removeTrueMutations(int index) { * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ public com.google.bigtable.v2.Mutation.Builder getTrueMutationsBuilder(int index) { - return getTrueMutationsFieldBuilder().getBuilder(index); + return internalGetTrueMutationsFieldBuilder().getBuilder(index); } + /** * * @@ -1860,6 +2123,7 @@ public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int in return trueMutationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1881,6 +2145,7 @@ public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int in return java.util.Collections.unmodifiableList(trueMutations_); } } + /** * * @@ -1895,9 +2160,10 @@ public com.google.bigtable.v2.MutationOrBuilder getTrueMutationsOrBuilder(int in * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ public com.google.bigtable.v2.Mutation.Builder addTrueMutationsBuilder() { - return getTrueMutationsFieldBuilder() + return internalGetTrueMutationsFieldBuilder() .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); } + /** * * @@ -1912,9 +2178,10 @@ public com.google.bigtable.v2.Mutation.Builder addTrueMutationsBuilder() { * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ public com.google.bigtable.v2.Mutation.Builder addTrueMutationsBuilder(int index) { - return getTrueMutationsFieldBuilder() + return internalGetTrueMutationsFieldBuilder() .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); } + /** * * @@ -1929,22 +2196,22 @@ public com.google.bigtable.v2.Mutation.Builder addTrueMutationsBuilder(int index * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ public java.util.List getTrueMutationsBuilderList() { - return getTrueMutationsFieldBuilder().getBuilderList(); + return internalGetTrueMutationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> - getTrueMutationsFieldBuilder() { + internalGetTrueMutationsFieldBuilder() { if (trueMutationsBuilder_ == null) { trueMutationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder>( trueMutations_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); trueMutations_ = null; @@ -1956,13 +2223,13 @@ public java.util.List getTrueMutationsB java.util.Collections.emptyList(); private void ensureFalseMutationsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000040) != 0)) { falseMutations_ = new java.util.ArrayList(falseMutations_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000040; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> @@ -1988,6 +2255,7 @@ public java.util.List getFalseMutationsList() { return falseMutationsBuilder_.getMessageList(); } } + /** * * @@ -2008,6 +2276,7 @@ public int getFalseMutationsCount() { return falseMutationsBuilder_.getCount(); } } + /** * * @@ -2028,6 +2297,7 @@ public com.google.bigtable.v2.Mutation getFalseMutations(int index) { return falseMutationsBuilder_.getMessage(index); } } + /** * * @@ -2054,6 +2324,7 @@ public Builder setFalseMutations(int index, com.google.bigtable.v2.Mutation valu } return this; } + /** * * @@ -2078,6 +2349,7 @@ public Builder setFalseMutations( } return this; } + /** * * @@ -2104,6 +2376,7 @@ public Builder addFalseMutations(com.google.bigtable.v2.Mutation value) { } return this; } + /** * * @@ -2130,6 +2403,7 @@ public Builder addFalseMutations(int index, com.google.bigtable.v2.Mutation valu } return this; } + /** * * @@ -2153,6 +2427,7 @@ public Builder addFalseMutations(com.google.bigtable.v2.Mutation.Builder builder } return this; } + /** * * @@ -2177,6 +2452,7 @@ public Builder addFalseMutations( } return this; } + /** * * @@ -2201,6 +2477,7 @@ public Builder addAllFalseMutations( } return this; } + /** * * @@ -2217,13 +2494,14 @@ public Builder addAllFalseMutations( public Builder clearFalseMutations() { if (falseMutationsBuilder_ == null) { falseMutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { falseMutationsBuilder_.clear(); } return this; } + /** * * @@ -2247,6 +2525,7 @@ public Builder removeFalseMutations(int index) { } return this; } + /** * * @@ -2261,8 +2540,9 @@ public Builder removeFalseMutations(int index) { * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ public com.google.bigtable.v2.Mutation.Builder getFalseMutationsBuilder(int index) { - return getFalseMutationsFieldBuilder().getBuilder(index); + return internalGetFalseMutationsFieldBuilder().getBuilder(index); } + /** * * @@ -2283,6 +2563,7 @@ public com.google.bigtable.v2.MutationOrBuilder getFalseMutationsOrBuilder(int i return falseMutationsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2304,6 +2585,7 @@ public com.google.bigtable.v2.MutationOrBuilder getFalseMutationsOrBuilder(int i return java.util.Collections.unmodifiableList(falseMutations_); } } + /** * * @@ -2318,9 +2600,10 @@ public com.google.bigtable.v2.MutationOrBuilder getFalseMutationsOrBuilder(int i * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ public com.google.bigtable.v2.Mutation.Builder addFalseMutationsBuilder() { - return getFalseMutationsFieldBuilder() + return internalGetFalseMutationsFieldBuilder() .addBuilder(com.google.bigtable.v2.Mutation.getDefaultInstance()); } + /** * * @@ -2335,9 +2618,10 @@ public com.google.bigtable.v2.Mutation.Builder addFalseMutationsBuilder() { * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ public com.google.bigtable.v2.Mutation.Builder addFalseMutationsBuilder(int index) { - return getFalseMutationsFieldBuilder() + return internalGetFalseMutationsFieldBuilder() .addBuilder(index, com.google.bigtable.v2.Mutation.getDefaultInstance()); } + /** * * @@ -2352,22 +2636,22 @@ public com.google.bigtable.v2.Mutation.Builder addFalseMutationsBuilder(int inde * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ public java.util.List getFalseMutationsBuilderList() { - return getFalseMutationsFieldBuilder().getBuilderList(); + return internalGetFalseMutationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> - getFalseMutationsFieldBuilder() { + internalGetFalseMutationsFieldBuilder() { if (falseMutationsBuilder_ == null) { falseMutationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder>( falseMutations_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); falseMutations_ = null; @@ -2375,17 +2659,6 @@ public java.util.List getFalseMutations return falseMutationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CheckAndMutateRowRequest) } @@ -2407,7 +2680,18 @@ public CheckAndMutateRowRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CheckAndMutateRowRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java index e044d70cd1..4e2fa437a1 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,37 +30,78 @@ public interface CheckAndMutateRowRequestOrBuilder * * *
    -   * Required. The unique name of the table to which the conditional mutation should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. */ java.lang.String getTableName(); + /** * * *
    -   * Required. The unique name of the table to which the conditional mutation should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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(); + /** * * @@ -71,6 +115,7 @@ public interface CheckAndMutateRowRequestOrBuilder * @return The appProfileId. */ java.lang.String getAppProfileId(); + /** * * @@ -89,7 +134,8 @@ public interface CheckAndMutateRowRequestOrBuilder * * *
    -   * Required. The key of the row to which the conditional mutation should be applied.
    +   * Required. The key of the row to which the conditional mutation should be
    +   * applied.
        * 
    * * bytes row_key = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -113,6 +159,7 @@ public interface CheckAndMutateRowRequestOrBuilder * @return Whether the predicateFilter field is set. */ boolean hasPredicateFilter(); + /** * * @@ -128,6 +175,7 @@ public interface CheckAndMutateRowRequestOrBuilder * @return The predicateFilter. */ com.google.bigtable.v2.RowFilter getPredicateFilter(); + /** * * @@ -156,6 +204,7 @@ public interface CheckAndMutateRowRequestOrBuilder * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ java.util.List getTrueMutationsList(); + /** * * @@ -170,6 +219,7 @@ public interface CheckAndMutateRowRequestOrBuilder * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ com.google.bigtable.v2.Mutation getTrueMutations(int index); + /** * * @@ -184,6 +234,7 @@ public interface CheckAndMutateRowRequestOrBuilder * repeated .google.bigtable.v2.Mutation true_mutations = 4; */ int getTrueMutationsCount(); + /** * * @@ -199,6 +250,7 @@ public interface CheckAndMutateRowRequestOrBuilder */ java.util.List getTrueMutationsOrBuilderList(); + /** * * @@ -228,6 +280,7 @@ public interface CheckAndMutateRowRequestOrBuilder * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ java.util.List getFalseMutationsList(); + /** * * @@ -242,6 +295,7 @@ public interface CheckAndMutateRowRequestOrBuilder * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ com.google.bigtable.v2.Mutation getFalseMutations(int index); + /** * * @@ -256,6 +310,7 @@ public interface CheckAndMutateRowRequestOrBuilder * repeated .google.bigtable.v2.Mutation false_mutations = 5; */ int getFalseMutationsCount(); + /** * * @@ -271,6 +326,7 @@ public interface CheckAndMutateRowRequestOrBuilder */ java.util.List getFalseMutationsOrBuilderList(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java index d5dc51bd63..852a8acf48 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,70 +29,29 @@ * * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowResponse} */ -public final class CheckAndMutateRowResponse extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use CheckAndMutateRowResponse.newBuilder() to construct. - private CheckAndMutateRowResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private CheckAndMutateRowResponse() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CheckAndMutateRowResponse(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CheckAndMutateRowResponse"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use CheckAndMutateRowResponse.newBuilder() to construct. + private CheckAndMutateRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private CheckAndMutateRowResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - predicateMatched_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private CheckAndMutateRowResponse() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto @@ -98,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable @@ -108,7 +69,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int PREDICATE_MATCHED_FIELD_NUMBER = 1; - private boolean predicateMatched_; + private boolean predicateMatched_ = false; + /** * * @@ -143,7 +105,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (predicateMatched_ != false) { output.writeBool(1, predicateMatched_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -155,7 +117,7 @@ public int getSerializedSize() { if (predicateMatched_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, predicateMatched_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -172,7 +134,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.v2.CheckAndMutateRowResponse) obj; if (getPredicateMatched() != other.getPredicateMatched()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -185,7 +147,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PREDICATE_MATCHED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPredicateMatched()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -227,38 +189,38 @@ public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( public static com.google.bigtable.v2.CheckAndMutateRowResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -281,10 +243,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -294,7 +257,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.CheckAndMutateRowResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -304,7 +267,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable @@ -314,24 +277,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.CheckAndMutateRowResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; predicateMatched_ = false; - return this; } @@ -359,42 +315,18 @@ public com.google.bigtable.v2.CheckAndMutateRowResponse build() { public com.google.bigtable.v2.CheckAndMutateRowResponse buildPartial() { com.google.bigtable.v2.CheckAndMutateRowResponse result = new com.google.bigtable.v2.CheckAndMutateRowResponse(this); - result.predicateMatched_ = predicateMatched_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.bigtable.v2.CheckAndMutateRowResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.predicateMatched_ = predicateMatched_; + } } @java.lang.Override @@ -413,7 +345,7 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowResponse other) if (other.getPredicateMatched() != false) { setPredicateMatched(other.getPredicateMatched()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -428,21 +360,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.CheckAndMutateRowResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.CheckAndMutateRowResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private boolean predicateMatched_; + /** * * @@ -459,6 +414,7 @@ public Builder mergeFrom( public boolean getPredicateMatched() { return predicateMatched_; } + /** * * @@ -475,9 +431,11 @@ public boolean getPredicateMatched() { public Builder setPredicateMatched(boolean value) { predicateMatched_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -491,23 +449,12 @@ public Builder setPredicateMatched(boolean value) { * @return This builder for chaining. */ public Builder clearPredicateMatched() { - + bitField0_ = (bitField0_ & ~0x00000001); predicateMatched_ = false; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.CheckAndMutateRowResponse) } @@ -529,7 +476,18 @@ public CheckAndMutateRowResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CheckAndMutateRowResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java index 6a3e935338..d7e3c9567d 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/CheckAndMutateRowResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java index 642231da59..6ccfb8de32 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Column.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.v2.Column} */ -public final class Column extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Column(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,79 +57,12 @@ private Column() { cells_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Column(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Column( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - qualifier_ = input.readBytes(); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - cells_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - cells_.add( - input.readMessage(com.google.bigtable.v2.Cell.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - cells_ = java.util.Collections.unmodifiableList(cells_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Column_fieldAccessorTable @@ -124,7 +71,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int QUALIFIER_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString qualifier_; + private com.google.protobuf.ByteString qualifier_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -146,7 +94,10 @@ public com.google.protobuf.ByteString getQualifier() { } public static final int CELLS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List cells_; + /** * * @@ -160,6 +111,7 @@ public com.google.protobuf.ByteString getQualifier() { public java.util.List getCellsList() { return cells_; } + /** * * @@ -173,6 +125,7 @@ public java.util.List getCellsList() { public java.util.List getCellsOrBuilderList() { return cells_; } + /** * * @@ -186,6 +139,7 @@ public java.util.List getCellsOr public int getCellsCount() { return cells_.size(); } + /** * * @@ -199,6 +153,7 @@ public int getCellsCount() { public com.google.bigtable.v2.Cell getCells(int index) { return cells_.get(index); } + /** * * @@ -233,7 +188,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < cells_.size(); i++) { output.writeMessage(2, cells_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -248,7 +203,7 @@ public int getSerializedSize() { for (int i = 0; i < cells_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, cells_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -265,7 +220,7 @@ public boolean equals(final java.lang.Object obj) { if (!getQualifier().equals(other.getQualifier())) return false; if (!getCellsList().equals(other.getCellsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -282,7 +237,7 @@ public int hashCode() { hash = (37 * hash) + CELLS_FIELD_NUMBER; hash = (53 * hash) + getCellsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -323,38 +278,38 @@ public static com.google.bigtable.v2.Column parseFrom( public static com.google.bigtable.v2.Column parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -377,10 +332,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -391,7 +347,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.Column} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -400,7 +356,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Column_fieldAccessorTable @@ -409,32 +365,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Column.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getCellsFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; qualifier_ = com.google.protobuf.ByteString.EMPTY; - if (cellsBuilder_ == null) { cells_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + cells_ = null; cellsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -460,52 +408,31 @@ public com.google.bigtable.v2.Column build() { @java.lang.Override public com.google.bigtable.v2.Column buildPartial() { com.google.bigtable.v2.Column result = new com.google.bigtable.v2.Column(this); - int from_bitField0_ = bitField0_; - result.qualifier_ = qualifier_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Column result) { if (cellsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { cells_ = java.util.Collections.unmodifiableList(cells_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.cells_ = cells_; } else { result.cells_ = cellsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.bigtable.v2.Column result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.qualifier_ = qualifier_; + } } @java.lang.Override @@ -520,14 +447,14 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.Column other) { if (other == com.google.bigtable.v2.Column.getDefaultInstance()) return this; - if (other.getQualifier() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getQualifier().isEmpty()) { setQualifier(other.getQualifier()); } if (cellsBuilder_ == null) { if (!other.cells_.isEmpty()) { if (cells_.isEmpty()) { cells_ = other.cells_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureCellsIsMutable(); cells_.addAll(other.cells_); @@ -540,17 +467,17 @@ public Builder mergeFrom(com.google.bigtable.v2.Column other) { cellsBuilder_.dispose(); cellsBuilder_ = null; cells_ = other.cells_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); cellsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getCellsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetCellsFieldBuilder() : null; } else { cellsBuilder_.addAllMessages(other.cells_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -565,23 +492,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Column parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.Column) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private com.google.protobuf.ByteString qualifier_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -601,6 +561,7 @@ public Builder mergeFrom( public com.google.protobuf.ByteString getQualifier() { return qualifier_; } + /** * * @@ -621,11 +582,12 @@ public Builder setQualifier(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - qualifier_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -642,7 +604,7 @@ public Builder setQualifier(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearQualifier() { - + bitField0_ = (bitField0_ & ~0x00000001); qualifier_ = getDefaultInstance().getQualifier(); onChanged(); return this; @@ -651,13 +613,13 @@ public Builder clearQualifier() { private java.util.List cells_ = java.util.Collections.emptyList(); private void ensureCellsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { cells_ = new java.util.ArrayList(cells_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Cell, com.google.bigtable.v2.Cell.Builder, com.google.bigtable.v2.CellOrBuilder> @@ -679,6 +641,7 @@ public java.util.List getCellsList() { return cellsBuilder_.getMessageList(); } } + /** * * @@ -695,6 +658,7 @@ public int getCellsCount() { return cellsBuilder_.getCount(); } } + /** * * @@ -711,6 +675,7 @@ public com.google.bigtable.v2.Cell getCells(int index) { return cellsBuilder_.getMessage(index); } } + /** * * @@ -733,6 +698,7 @@ public Builder setCells(int index, com.google.bigtable.v2.Cell value) { } return this; } + /** * * @@ -752,6 +718,7 @@ public Builder setCells(int index, com.google.bigtable.v2.Cell.Builder builderFo } return this; } + /** * * @@ -774,6 +741,7 @@ public Builder addCells(com.google.bigtable.v2.Cell value) { } return this; } + /** * * @@ -796,6 +764,7 @@ public Builder addCells(int index, com.google.bigtable.v2.Cell value) { } return this; } + /** * * @@ -815,6 +784,7 @@ public Builder addCells(com.google.bigtable.v2.Cell.Builder builderForValue) { } return this; } + /** * * @@ -834,6 +804,7 @@ public Builder addCells(int index, com.google.bigtable.v2.Cell.Builder builderFo } return this; } + /** * * @@ -853,6 +824,7 @@ public Builder addAllCells(java.lang.Iterablerepeated .google.bigtable.v2.Cell cells = 2;
    */ public com.google.bigtable.v2.Cell.Builder getCellsBuilder(int index) { - return getCellsFieldBuilder().getBuilder(index); + return internalGetCellsFieldBuilder().getBuilder(index); } + /** * * @@ -919,6 +894,7 @@ public com.google.bigtable.v2.CellOrBuilder getCellsOrBuilder(int index) { return cellsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -935,6 +911,7 @@ public java.util.List getCellsOr return java.util.Collections.unmodifiableList(cells_); } } + /** * * @@ -945,8 +922,10 @@ public java.util.List getCellsOr * repeated .google.bigtable.v2.Cell cells = 2; */ public com.google.bigtable.v2.Cell.Builder addCellsBuilder() { - return getCellsFieldBuilder().addBuilder(com.google.bigtable.v2.Cell.getDefaultInstance()); + return internalGetCellsFieldBuilder() + .addBuilder(com.google.bigtable.v2.Cell.getDefaultInstance()); } + /** * * @@ -957,9 +936,10 @@ public com.google.bigtable.v2.Cell.Builder addCellsBuilder() { * repeated .google.bigtable.v2.Cell cells = 2; */ public com.google.bigtable.v2.Cell.Builder addCellsBuilder(int index) { - return getCellsFieldBuilder() + return internalGetCellsFieldBuilder() .addBuilder(index, com.google.bigtable.v2.Cell.getDefaultInstance()); } + /** * * @@ -970,37 +950,26 @@ public com.google.bigtable.v2.Cell.Builder addCellsBuilder(int index) { * repeated .google.bigtable.v2.Cell cells = 2; */ public java.util.List getCellsBuilderList() { - return getCellsFieldBuilder().getBuilderList(); + return internalGetCellsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Cell, com.google.bigtable.v2.Cell.Builder, com.google.bigtable.v2.CellOrBuilder> - getCellsFieldBuilder() { + internalGetCellsFieldBuilder() { if (cellsBuilder_ == null) { cellsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Cell, com.google.bigtable.v2.Cell.Builder, com.google.bigtable.v2.CellOrBuilder>( - cells_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + cells_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); cells_ = null; } return cellsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Column) } @@ -1022,7 +991,18 @@ public Column parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Column(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadata.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadata.java new file mode 100644 index 0000000000..d73499cdf1 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadataOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadataOrBuilder.java new file mode 100644 index 0000000000..fa42bea19b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java index fc994bb813..5d29131b2a 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -50,6 +53,7 @@ public interface ColumnOrBuilder * repeated .google.bigtable.v2.Cell cells = 2; */ java.util.List getCellsList(); + /** * * @@ -60,6 +64,7 @@ public interface ColumnOrBuilder * repeated .google.bigtable.v2.Cell cells = 2; */ com.google.bigtable.v2.Cell getCells(int index); + /** * * @@ -70,6 +75,7 @@ public interface ColumnOrBuilder * repeated .google.bigtable.v2.Cell cells = 2; */ int getCellsCount(); + /** * * @@ -80,6 +86,7 @@ public interface ColumnOrBuilder * repeated .google.bigtable.v2.Cell cells = 2; */ java.util.List getCellsOrBuilderList(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java index 66a55fe241..df6d511e3b 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -30,13 +32,25 @@ * * Protobuf type {@code google.bigtable.v2.ColumnRange} */ -public final class ColumnRange extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ColumnRange(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -44,92 +58,13 @@ private ColumnRange() { familyName_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ColumnRange(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ColumnRange( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - familyName_ = s; - break; - } - case 18: - { - startQualifierCase_ = 2; - startQualifier_ = input.readBytes(); - break; - } - case 26: - { - startQualifierCase_ = 3; - startQualifier_ = input.readBytes(); - break; - } - case 34: - { - endQualifierCase_ = 4; - endQualifier_ = input.readBytes(); - break; - } - case 42: - { - endQualifierCase_ = 5; - endQualifier_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ColumnRange_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable @@ -139,6 +74,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int startQualifierCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object startQualifier_; public enum StartQualifierCase @@ -153,6 +90,7 @@ public enum StartQualifierCase 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. @@ -186,6 +124,8 @@ public StartQualifierCase getStartQualifierCase() { } private int endQualifierCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object endQualifier_; public enum EndQualifierCase @@ -200,6 +140,7 @@ public enum EndQualifierCase 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. @@ -233,7 +174,10 @@ public EndQualifierCase getEndQualifierCase() { } public static final int FAMILY_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object familyName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + /** * * @@ -257,6 +201,7 @@ public java.lang.String getFamilyName() { return s; } } + /** * * @@ -282,6 +227,7 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { } public static final int START_QUALIFIER_CLOSED_FIELD_NUMBER = 2; + /** * * @@ -297,6 +243,7 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { public boolean hasStartQualifierClosed() { return startQualifierCase_ == 2; } + /** * * @@ -317,6 +264,7 @@ public com.google.protobuf.ByteString getStartQualifierClosed() { } public static final int START_QUALIFIER_OPEN_FIELD_NUMBER = 3; + /** * * @@ -332,6 +280,7 @@ public com.google.protobuf.ByteString getStartQualifierClosed() { public boolean hasStartQualifierOpen() { return startQualifierCase_ == 3; } + /** * * @@ -352,6 +301,7 @@ public com.google.protobuf.ByteString getStartQualifierOpen() { } public static final int END_QUALIFIER_CLOSED_FIELD_NUMBER = 4; + /** * * @@ -367,6 +317,7 @@ public com.google.protobuf.ByteString getStartQualifierOpen() { public boolean hasEndQualifierClosed() { return endQualifierCase_ == 4; } + /** * * @@ -387,6 +338,7 @@ public com.google.protobuf.ByteString getEndQualifierClosed() { } public static final int END_QUALIFIER_OPEN_FIELD_NUMBER = 5; + /** * * @@ -402,6 +354,7 @@ public com.google.protobuf.ByteString getEndQualifierClosed() { public boolean hasEndQualifierOpen() { return endQualifierCase_ == 5; } + /** * * @@ -435,8 +388,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getFamilyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, familyName_); + 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_); @@ -450,7 +403,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (endQualifierCase_ == 5) { output.writeBytes(5, (com.google.protobuf.ByteString) endQualifier_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -459,8 +412,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getFamilyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, familyName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); } if (startQualifierCase_ == 2) { size += @@ -482,7 +435,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBytesSize( 5, (com.google.protobuf.ByteString) endQualifier_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -520,7 +473,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -557,7 +510,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -598,38 +551,38 @@ public static com.google.bigtable.v2.ColumnRange parseFrom( public static com.google.bigtable.v2.ColumnRange parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -652,10 +605,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -668,7 +622,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ColumnRange} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -678,7 +632,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable @@ -688,24 +642,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.ColumnRange.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; familyName_ = ""; - startQualifierCase_ = 0; startQualifier_ = null; endQualifierCase_ = 0; @@ -736,56 +683,26 @@ public com.google.bigtable.v2.ColumnRange build() { @java.lang.Override public com.google.bigtable.v2.ColumnRange buildPartial() { com.google.bigtable.v2.ColumnRange result = new com.google.bigtable.v2.ColumnRange(this); - result.familyName_ = familyName_; - if (startQualifierCase_ == 2) { - result.startQualifier_ = startQualifier_; - } - if (startQualifierCase_ == 3) { - result.startQualifier_ = startQualifier_; - } - if (endQualifierCase_ == 4) { - result.endQualifier_ = endQualifier_; - } - if (endQualifierCase_ == 5) { - result.endQualifier_ = endQualifier_; + if (bitField0_ != 0) { + buildPartial0(result); } - result.startQualifierCase_ = startQualifierCase_; - result.endQualifierCase_ = endQualifierCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + private void buildPartial0(com.google.bigtable.v2.ColumnRange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -802,6 +719,7 @@ 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()) { @@ -836,7 +754,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ColumnRange other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -851,17 +769,61 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ColumnRange parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.ColumnRange) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -893,7 +855,10 @@ public Builder clearEndQualifier() { return this; } + private int bitField0_; + private java.lang.Object familyName_ = ""; + /** * * @@ -916,6 +881,7 @@ public java.lang.String getFamilyName() { return (java.lang.String) ref; } } + /** * * @@ -938,6 +904,7 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -954,11 +921,12 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -971,11 +939,12 @@ public Builder setFamilyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFamilyName() { - familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -993,8 +962,8 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1013,6 +982,7 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { public boolean hasStartQualifierClosed() { return startQualifierCase_ == 2; } + /** * * @@ -1030,6 +1000,7 @@ public com.google.protobuf.ByteString getStartQualifierClosed() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1051,6 +1022,7 @@ public Builder setStartQualifierClosed(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1085,6 +1057,7 @@ public Builder clearStartQualifierClosed() { public boolean hasStartQualifierOpen() { return startQualifierCase_ == 3; } + /** * * @@ -1102,6 +1075,7 @@ public com.google.protobuf.ByteString getStartQualifierOpen() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1123,6 +1097,7 @@ public Builder setStartQualifierOpen(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1157,6 +1132,7 @@ public Builder clearStartQualifierOpen() { public boolean hasEndQualifierClosed() { return endQualifierCase_ == 4; } + /** * * @@ -1174,6 +1150,7 @@ public com.google.protobuf.ByteString getEndQualifierClosed() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1195,6 +1172,7 @@ public Builder setEndQualifierClosed(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1229,6 +1207,7 @@ public Builder clearEndQualifierClosed() { public boolean hasEndQualifierOpen() { return endQualifierCase_ == 5; } + /** * * @@ -1246,6 +1225,7 @@ public com.google.protobuf.ByteString getEndQualifierOpen() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1267,6 +1247,7 @@ public Builder setEndQualifierOpen(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1287,17 +1268,6 @@ public Builder clearEndQualifierOpen() { return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ColumnRange) } @@ -1319,7 +1289,18 @@ public ColumnRange parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ColumnRange(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java index e94bae3d49..b7eab1ee34 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnRangeOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface ColumnRangeOrBuilder * @return The familyName. */ java.lang.String getFamilyName(); + /** * * @@ -60,6 +64,7 @@ public interface ColumnRangeOrBuilder * @return Whether the startQualifierClosed field is set. */ boolean hasStartQualifierClosed(); + /** * * @@ -85,6 +90,7 @@ public interface ColumnRangeOrBuilder * @return Whether the startQualifierOpen field is set. */ boolean hasStartQualifierOpen(); + /** * * @@ -110,6 +116,7 @@ public interface ColumnRangeOrBuilder * @return Whether the endQualifierClosed field is set. */ boolean hasEndQualifierClosed(); + /** * * @@ -135,6 +142,7 @@ public interface ColumnRangeOrBuilder * @return Whether the endQualifierOpen field is set. */ boolean hasEndQualifierOpen(); + /** * * @@ -148,7 +156,7 @@ public interface ColumnRangeOrBuilder */ com.google.protobuf.ByteString getEndQualifierOpen(); - public com.google.bigtable.v2.ColumnRange.StartQualifierCase getStartQualifierCase(); + com.google.bigtable.v2.ColumnRange.StartQualifierCase getStartQualifierCase(); - public com.google.bigtable.v2.ColumnRange.EndQualifierCase getEndQualifierCase(); + com.google.bigtable.v2.ColumnRange.EndQualifierCase getEndQualifierCase(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java index ba55154653..63ba302c3b 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/DataProto.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,13 +14,26 @@ * 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; -public final class DataProto { +@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) { @@ -29,80 +42,140 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_v2_Row_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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_RowFilter_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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.GeneratedMessageV3.FieldAccessorTable + 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; @@ -112,133 +185,261 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n\035google/bigtable/v2/data.proto\022\022google." - + "bigtable.v2\"@\n\003Row\022\013\n\003key\030\001 \001(\014\022,\n\010famil" - + "ies\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\t" - + "qualifier\030\001 \001(\014\022\'\n\005cells\030\002 \003(\0132\030.google." - + "bigtable.v2.Cell\"?\n\004Cell\022\030\n\020timestamp_mi" - + "cros\030\001 \001(\003\022\r\n\005value\030\002 \001(\014\022\016\n\006labels\030\003 \003(" - + "\t\"\212\001\n\010RowRange\022\032\n\020start_key_closed\030\001 \001(\014" - + "H\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\nrow_ranges\030\002 \003(\0132\034.google." - + "bigtable.v2.RowRange\"\306\001\n\013ColumnRange\022\023\n\013" - + "family_name\030\001 \001(\t\022 \n\026start_qualifier_clo" - + "sed\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\022e" - + "nd_qualifier_open\030\005 \001(\014H\001B\021\n\017start_quali" - + "fierB\017\n\rend_qualifier\"N\n\016TimestampRange\022" - + "\036\n\026start_timestamp_micros\030\001 \001(\003\022\034\n\024end_t" - + "imestamp_micros\030\002 \001(\003\"\230\001\n\nValueRange\022\034\n\022" - + "start_value_closed\030\001 \001(\014H\000\022\032\n\020start_valu" - + "e_open\030\002 \001(\014H\000\022\032\n\020end_value_closed\030\003 \001(\014" - + "H\001\022\030\n\016end_value_open\030\004 \001(\014H\001B\r\n\013start_va" - + "lueB\013\n\tend_value\"\337\010\n\tRowFilter\0224\n\005chain\030" - + "\001 \001(\0132#.google.bigtable.v2.RowFilter.Cha" - + "inH\000\022>\n\ninterleave\030\002 \001(\0132(.google.bigtab" - + "le.v2.RowFilter.InterleaveH\000\022<\n\tconditio" - + "n\030\003 \001(\0132\'.google.bigtable.v2.RowFilter.C" - + "onditionH\000\022\016\n\004sink\030\020 \001(\010H\000\022\031\n\017pass_all_f" - + "ilter\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_re" - + "gex_filter\030\005 \001(\tH\000\022\'\n\035column_qualifier_r" - + "egex_filter\030\006 \001(\014H\000\022>\n\023column_range_filt" - + "er\030\007 \001(\0132\037.google.bigtable.v2.ColumnRang" - + "eH\000\022D\n\026timestamp_range_filter\030\010 \001(\0132\".go" - + "ogle.bigtable.v2.TimestampRangeH\000\022\034\n\022val" - + "ue_regex_filter\030\t \001(\014H\000\022<\n\022value_range_f" - + "ilter\030\017 \001(\0132\036.google.bigtable.v2.ValueRa" - + "ngeH\000\022%\n\033cells_per_row_offset_filter\030\n \001" - + "(\005H\000\022$\n\032cells_per_row_limit_filter\030\013 \001(\005" - + "H\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\0327\n\005Cha" - + "in\022.\n\007filters\030\001 \003(\0132\035.google.bigtable.v2" - + ".RowFilter\032<\n\nInterleave\022.\n\007filters\030\001 \003(" - + "\0132\035.google.bigtable.v2.RowFilter\032\255\001\n\tCon" - + "dition\0227\n\020predicate_filter\030\001 \001(\0132\035.googl" - + "e.bigtable.v2.RowFilter\0222\n\013true_filter\030\002" - + " \001(\0132\035.google.bigtable.v2.RowFilter\0223\n\014f" - + "alse_filter\030\003 \001(\0132\035.google.bigtable.v2.R" - + "owFilterB\010\n\006filter\"\311\004\n\010Mutation\0228\n\010set_c" - + "ell\030\001 \001(\0132$.google.bigtable.v2.Mutation." - + "SetCellH\000\022K\n\022delete_from_column\030\002 \001(\0132-." - + "google.bigtable.v2.Mutation.DeleteFromCo" - + "lumnH\000\022K\n\022delete_from_family\030\003 \001(\0132-.goo" - + "gle.bigtable.v2.Mutation.DeleteFromFamil" - + "yH\000\022E\n\017delete_from_row\030\004 \001(\0132*.google.bi" - + "gtable.v2.Mutation.DeleteFromRowH\000\032a\n\007Se" - + "tCell\022\023\n\013family_name\030\001 \001(\t\022\030\n\020column_qua" - + "lifier\030\002 \001(\014\022\030\n\020timestamp_micros\030\003 \001(\003\022\r" - + "\n\005value\030\004 \001(\014\032y\n\020DeleteFromColumn\022\023\n\013fam" - + "ily_name\030\001 \001(\t\022\030\n\020column_qualifier\030\002 \001(\014" - + "\0226\n\ntime_range\030\003 \001(\0132\".google.bigtable.v" - + "2.TimestampRange\032\'\n\020DeleteFromFamily\022\023\n\013" - + "family_name\030\001 \001(\t\032\017\n\rDeleteFromRowB\n\n\010mu" - + "tation\"\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_amoun" - + "t\030\004 \001(\003H\000B\006\n\004ruleB\265\001\n\026com.google.bigtabl" - + "e.v2B\tDataProtoP\001Z:google.golang.org/gen" - + "proto/googleapis/bigtable/v2;bigtable\252\002\030" - + "Google.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\" - + "Bigtable\\V2\352\002\033Google::Cloud::Bigtable::V" - + "2b\006proto3" + "\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\"\337\010\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\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*.googl" + + "e.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/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[] {}); - internal_static_google_bigtable_v2_Row_descriptor = getDescriptor().getMessageTypes().get(0); + 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.GeneratedMessageV3.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().getMessageTypes().get(1); + internal_static_google_bigtable_v2_Family_descriptor = getDescriptor().getMessageType(1); internal_static_google_bigtable_v2_Family_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(2); + internal_static_google_bigtable_v2_Column_descriptor = getDescriptor().getMessageType(2); internal_static_google_bigtable_v2_Column_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(3); + internal_static_google_bigtable_v2_Cell_descriptor = getDescriptor().getMessageType(3); internal_static_google_bigtable_v2_Cell_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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_RowRange_descriptor = - getDescriptor().getMessageTypes().get(4); + 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.GeneratedMessageV3.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().getMessageTypes().get(5); + internal_static_google_bigtable_v2_RowSet_descriptor = getDescriptor().getMessageType(7); internal_static_google_bigtable_v2_RowSet_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(6); + internal_static_google_bigtable_v2_ColumnRange_descriptor = getDescriptor().getMessageType(8); internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_ColumnRange_descriptor, new java.lang.String[] { "FamilyName", @@ -250,17 +451,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndQualifier", }); internal_static_google_bigtable_v2_TimestampRange_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageType(9); internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(8); + internal_static_google_bigtable_v2_ValueRange_descriptor = getDescriptor().getMessageType(10); internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_ValueRange_descriptor, new java.lang.String[] { "StartValueClosed", @@ -270,10 +470,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "StartValue", "EndValue", }); - internal_static_google_bigtable_v2_RowFilter_descriptor = - getDescriptor().getMessageTypes().get(9); + internal_static_google_bigtable_v2_RowFilter_descriptor = getDescriptor().getMessageType(11); internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_RowFilter_descriptor, new java.lang.String[] { "Chain", @@ -298,75 +497,187 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Filter", }); internal_static_google_bigtable_v2_RowFilter_Chain_descriptor = - internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedType(0); internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedType(1); internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_v2_RowFilter_descriptor.getNestedType(2); internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(10); + internal_static_google_bigtable_v2_Mutation_descriptor = getDescriptor().getMessageType(12); internal_static_google_bigtable_v2_Mutation_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_bigtable_v2_Mutation_descriptor, new java.lang.String[] { - "SetCell", "DeleteFromColumn", "DeleteFromFamily", "DeleteFromRow", "Mutation", + "SetCell", + "AddToCell", + "MergeToCell", + "DeleteFromColumn", + "DeleteFromFamily", + "DeleteFromRow", + "Mutation", }); internal_static_google_bigtable_v2_Mutation_SetCell_descriptor = - internal_static_google_bigtable_v2_Mutation_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(0); internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(3); internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(4); internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(3); + internal_static_google_bigtable_v2_Mutation_descriptor.getNestedType(5); internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(11); + getDescriptor().getMessageType(13); internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.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(14); + 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(15); + 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(16); + 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(17); + 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(18); + 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(19); + 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(20); + 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(21); + 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(22); + 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(23); + 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(24); + 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(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java new file mode 100644 index 0000000000..37dd639ce2 --- /dev/null +++ b/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=1101 + * @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=1101 + * @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=1122 + * @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=1122 + * @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=1101 + * @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=1101 + * @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=1101 + * @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=1101 + * @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=1101 + * @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=1122 + * @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=1122 + * @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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java new file mode 100644 index 0000000000..f29ee2741f --- /dev/null +++ b/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=1101 + * @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=1101 + * @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=1122 + * @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=1122 + * @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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponse.java new file mode 100644 index 0000000000..a022efc48f --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponseOrBuilder.java new file mode 100644 index 0000000000..0ef540b872 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java index 611af92f83..4dff09c262 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Family.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.v2.Family} */ -public final class Family extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Family(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,81 +57,12 @@ private Family() { columns_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Family(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Family( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - columns_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - columns_.add( - input.readMessage(com.google.bigtable.v2.Column.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - columns_ = java.util.Collections.unmodifiableList(columns_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Family_fieldAccessorTable @@ -126,7 +71,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** * * @@ -155,6 +103,7 @@ public java.lang.String getName() { return s; } } + /** * * @@ -185,7 +134,10 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int COLUMNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List columns_; + /** * * @@ -199,6 +151,7 @@ public com.google.protobuf.ByteString getNameBytes() { public java.util.List getColumnsList() { return columns_; } + /** * * @@ -213,6 +166,7 @@ public java.util.List getColumnsList() { getColumnsOrBuilderList() { return columns_; } + /** * * @@ -226,6 +180,7 @@ public java.util.List getColumnsList() { public int getColumnsCount() { return columns_.size(); } + /** * * @@ -239,6 +194,7 @@ public int getColumnsCount() { public com.google.bigtable.v2.Column getColumns(int index) { return columns_.get(index); } + /** * * @@ -267,13 +223,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + 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)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -282,13 +238,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + 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 += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -305,7 +261,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (!getColumnsList().equals(other.getColumnsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -322,7 +278,7 @@ public int hashCode() { hash = (37 * hash) + COLUMNS_FIELD_NUMBER; hash = (53 * hash) + getColumnsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -363,38 +319,38 @@ public static com.google.bigtable.v2.Family parseFrom( public static com.google.bigtable.v2.Family parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -417,10 +373,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -431,7 +388,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.Family} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -440,7 +397,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Family_fieldAccessorTable @@ -449,32 +406,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Family.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getColumnsFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - if (columnsBuilder_ == null) { columns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + columns_ = null; columnsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -500,52 +449,31 @@ public com.google.bigtable.v2.Family build() { @java.lang.Override public com.google.bigtable.v2.Family buildPartial() { com.google.bigtable.v2.Family result = new com.google.bigtable.v2.Family(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Family result) { if (columnsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { columns_ = java.util.Collections.unmodifiableList(columns_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.columns_ = columns_; } else { result.columns_ = columnsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.bigtable.v2.Family result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } } @java.lang.Override @@ -562,13 +490,14 @@ 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_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureColumnsIsMutable(); columns_.addAll(other.columns_); @@ -581,17 +510,17 @@ public Builder mergeFrom(com.google.bigtable.v2.Family other) { columnsBuilder_.dispose(); columnsBuilder_ = null; columns_ = other.columns_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); columnsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getColumnsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetColumnsFieldBuilder() : null; } else { columnsBuilder_.addAllMessages(other.columns_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -606,23 +535,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Family parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.Family) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object name_ = ""; + /** * * @@ -650,6 +612,7 @@ public java.lang.String getName() { return (java.lang.String) ref; } } + /** * * @@ -677,6 +640,7 @@ public com.google.protobuf.ByteString getNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -698,11 +662,12 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -720,11 +685,12 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -747,8 +713,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -757,13 +723,13 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureColumnsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { columns_ = new java.util.ArrayList(columns_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Column, com.google.bigtable.v2.Column.Builder, com.google.bigtable.v2.ColumnOrBuilder> @@ -785,6 +751,7 @@ public java.util.List getColumnsList() { return columnsBuilder_.getMessageList(); } } + /** * * @@ -801,6 +768,7 @@ public int getColumnsCount() { return columnsBuilder_.getCount(); } } + /** * * @@ -817,6 +785,7 @@ public com.google.bigtable.v2.Column getColumns(int index) { return columnsBuilder_.getMessage(index); } } + /** * * @@ -839,6 +808,7 @@ public Builder setColumns(int index, com.google.bigtable.v2.Column value) { } return this; } + /** * * @@ -858,6 +828,7 @@ public Builder setColumns(int index, com.google.bigtable.v2.Column.Builder build } return this; } + /** * * @@ -880,6 +851,7 @@ public Builder addColumns(com.google.bigtable.v2.Column value) { } return this; } + /** * * @@ -902,6 +874,7 @@ public Builder addColumns(int index, com.google.bigtable.v2.Column value) { } return this; } + /** * * @@ -921,6 +894,7 @@ public Builder addColumns(com.google.bigtable.v2.Column.Builder builderForValue) } return this; } + /** * * @@ -940,6 +914,7 @@ public Builder addColumns(int index, com.google.bigtable.v2.Column.Builder build } return this; } + /** * * @@ -960,6 +935,7 @@ public Builder addAllColumns( } return this; } + /** * * @@ -972,13 +948,14 @@ public Builder addAllColumns( public Builder clearColumns() { if (columnsBuilder_ == null) { columns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { columnsBuilder_.clear(); } return this; } + /** * * @@ -998,6 +975,7 @@ public Builder removeColumns(int index) { } return this; } + /** * * @@ -1008,8 +986,9 @@ public Builder removeColumns(int index) { * repeated .google.bigtable.v2.Column columns = 2; */ public com.google.bigtable.v2.Column.Builder getColumnsBuilder(int index) { - return getColumnsFieldBuilder().getBuilder(index); + return internalGetColumnsFieldBuilder().getBuilder(index); } + /** * * @@ -1026,6 +1005,7 @@ public com.google.bigtable.v2.ColumnOrBuilder getColumnsOrBuilder(int index) { return columnsBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1043,6 +1023,7 @@ public com.google.bigtable.v2.ColumnOrBuilder getColumnsOrBuilder(int index) { return java.util.Collections.unmodifiableList(columns_); } } + /** * * @@ -1053,9 +1034,10 @@ public com.google.bigtable.v2.ColumnOrBuilder getColumnsOrBuilder(int index) { * repeated .google.bigtable.v2.Column columns = 2; */ public com.google.bigtable.v2.Column.Builder addColumnsBuilder() { - return getColumnsFieldBuilder() + return internalGetColumnsFieldBuilder() .addBuilder(com.google.bigtable.v2.Column.getDefaultInstance()); } + /** * * @@ -1066,9 +1048,10 @@ public com.google.bigtable.v2.Column.Builder addColumnsBuilder() { * repeated .google.bigtable.v2.Column columns = 2; */ public com.google.bigtable.v2.Column.Builder addColumnsBuilder(int index) { - return getColumnsFieldBuilder() + return internalGetColumnsFieldBuilder() .addBuilder(index, com.google.bigtable.v2.Column.getDefaultInstance()); } + /** * * @@ -1079,37 +1062,26 @@ public com.google.bigtable.v2.Column.Builder addColumnsBuilder(int index) { * repeated .google.bigtable.v2.Column columns = 2; */ public java.util.List getColumnsBuilderList() { - return getColumnsFieldBuilder().getBuilderList(); + return internalGetColumnsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Column, com.google.bigtable.v2.Column.Builder, com.google.bigtable.v2.ColumnOrBuilder> - getColumnsFieldBuilder() { + internalGetColumnsFieldBuilder() { if (columnsBuilder_ == null) { columnsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Column, com.google.bigtable.v2.Column.Builder, com.google.bigtable.v2.ColumnOrBuilder>( - columns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + columns_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); columns_ = null; } return columnsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Family) } @@ -1131,7 +1103,18 @@ public Family parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Family(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java index 7c90e78023..8669507682 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FamilyOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -40,6 +43,7 @@ public interface FamilyOrBuilder * @return The name. */ java.lang.String getName(); + /** * * @@ -68,6 +72,7 @@ public interface FamilyOrBuilder * repeated .google.bigtable.v2.Column columns = 2; */ java.util.List getColumnsList(); + /** * * @@ -78,6 +83,7 @@ public interface FamilyOrBuilder * repeated .google.bigtable.v2.Column columns = 2; */ com.google.bigtable.v2.Column getColumns(int index); + /** * * @@ -88,6 +94,7 @@ public interface FamilyOrBuilder * repeated .google.bigtable.v2.Column columns = 2; */ int getColumnsCount(); + /** * * @@ -98,6 +105,7 @@ public interface FamilyOrBuilder * repeated .google.bigtable.v2.Column columns = 2; */ java.util.List getColumnsOrBuilderList(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java new file mode 100644 index 0000000000..46c908818a --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java @@ -0,0 +1,1418 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language 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_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!getUnknownFields().equals(other.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 = (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; + 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_; + } + } + + @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()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an 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; + } + + // @@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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.java new file mode 100644 index 0000000000..7f41ef5559 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.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/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(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java new file mode 100644 index 0000000000..92e14798bb --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language 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\"\261\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(\010B\273\001\n\026com.google.bigtable.v2B\021Fea" + + "tureFlagsProtoP\001Z8cloud.google.com/go/bi" + + "gtable/apiv2/bigtablepb;bigtablepb\252\002\030Goo" + + "gle.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\Big" + + "table\\V2\352\002\033Google::Cloud::Bigtable::V2b\006" + + "proto3" + }; + 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", + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsView.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsView.java new file mode 100644 index 0000000000..9e2e6fe855 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsViewOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsViewOrBuilder.java new file mode 100644 index 0000000000..6355563d96 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequest.java new file mode 100644 index 0000000000..8d49f29c98 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequestOrBuilder.java new file mode 100644 index 0000000000..480a01e981 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponse.java new file mode 100644 index 0000000000..553e33d3fc --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponseOrBuilder.java new file mode 100644 index 0000000000..af25316245 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Idempotency.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Idempotency.java new file mode 100644 index 0000000000..b90af09d6a --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/IdempotencyOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/IdempotencyOrBuilder.java new file mode 100644 index 0000000000..95e40c3547 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java new file mode 100644 index 0000000000..d36d4f04c1 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewName.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MaterializedViewName.java new file mode 100644 index 0000000000..a1e665074a --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java index 2187ce7a6c..ff0558b238 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,111 +29,43 @@ * * Protobuf type {@code google.bigtable.v2.MutateRowRequest} */ -public final class MutateRowRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + 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(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MutateRowRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private MutateRowRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; - break; - } - case 18: - { - rowKey_ = input.readBytes(); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - mutations_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - mutations_.add( - input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry)); - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - appProfileId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - mutations_ = java.util.Collections.unmodifiableList(mutations_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable @@ -140,19 +74,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.v2.MutateRowRequest.Builder.class); } + private int bitField0_; public static final int TABLE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object tableName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + /** * * *
    -   * Required. The unique name of the table to which the mutation should be applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -169,17 +109,20 @@ public java.lang.String getTableName() { return s; } } + /** * * *
    -   * Required. The unique name of the table to which the mutation should be applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -197,8 +140,76 @@ public com.google.protobuf.ByteString getTableNameBytes() { } } + 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; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + /** * * @@ -223,6 +234,7 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * @@ -249,7 +261,8 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { } public static final int ROW_KEY_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString rowKey_; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -267,14 +280,17 @@ public com.google.protobuf.ByteString getRowKey() { } 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.
    +   * 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.
        * 
    * * @@ -285,13 +301,14 @@ public com.google.protobuf.ByteString getRowKey() { 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.
    +   * 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.
        * 
    * * @@ -303,13 +320,14 @@ public java.util.List getMutationsList() { 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.
    +   * 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.
        * 
    * * @@ -320,13 +338,14 @@ public java.util.List getMutationsList() { 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.
    +   * 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.
        * 
    * * @@ -337,13 +356,14 @@ public int getMutationsCount() { 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.
    +   * 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.
        * 
    * * @@ -355,6 +375,62 @@ 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 @@ -369,8 +445,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); } if (!rowKey_.isEmpty()) { output.writeBytes(2, rowKey_); @@ -378,10 +454,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < mutations_.size(); i++) { output.writeMessage(3, mutations_.get(i)); } - if (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, appProfileId_); + 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_); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getIdempotency()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -390,8 +472,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + 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_); @@ -399,10 +481,16 @@ public int getSerializedSize() { for (int i = 0; i < mutations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, mutations_.get(i)); } - if (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, appProfileId_); + 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 += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getIdempotency()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -418,10 +506,15 @@ public boolean equals(final java.lang.Object 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 (!unknownFields.equals(other.unknownFields)) 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; } @@ -434,6 +527,8 @@ public int hashCode() { 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; @@ -442,7 +537,11 @@ public int hashCode() { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + if (hasIdempotency()) { + hash = (37 * hash) + IDEMPOTENCY_FIELD_NUMBER; + hash = (53 * hash) + getIdempotency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -484,38 +583,38 @@ public static com.google.bigtable.v2.MutateRowRequest parseFrom( public static com.google.bigtable.v2.MutateRowRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -538,10 +637,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -551,7 +651,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.MutateRowRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -561,7 +661,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowRequest_fieldAccessorTable @@ -575,32 +675,38 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMutationsFieldBuilder(); + 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(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + mutations_ = null; mutationsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000010); + idempotency_ = null; + if (idempotencyBuilder_ != null) { + idempotencyBuilder_.dispose(); + idempotencyBuilder_ = null; + } return this; } @@ -628,54 +734,47 @@ public com.google.bigtable.v2.MutateRowRequest build() { public com.google.bigtable.v2.MutateRowRequest buildPartial() { com.google.bigtable.v2.MutateRowRequest result = new com.google.bigtable.v2.MutateRowRequest(this); - int from_bitField0_ = bitField0_; - result.tableName_ = tableName_; - result.appProfileId_ = appProfileId_; - result.rowKey_ = rowKey_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.MutateRowRequest result) { if (mutationsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000010) != 0)) { mutations_ = java.util.Collections.unmodifiableList(mutations_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } result.mutations_ = mutations_; } else { result.mutations_ = mutationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -692,20 +791,27 @@ 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() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getRowKey().isEmpty()) { setRowKey(other.getRowKey()); } if (mutationsBuilder_ == null) { if (!other.mutations_.isEmpty()) { if (mutations_.isEmpty()) { mutations_ = other.mutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureMutationsIsMutable(); mutations_.addAll(other.mutations_); @@ -718,17 +824,20 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowRequest other) { mutationsBuilder_.dispose(); mutationsBuilder_ = null; mutations_ = other.mutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); mutationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMutationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMutationsFieldBuilder() : null; } else { mutationsBuilder_.addAllMessages(other.mutations_); } } } - this.mergeUnknownFields(other.unknownFields); + if (other.hasIdempotency()) { + mergeIdempotency(other.getIdempotency()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -743,34 +852,94 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.MutateRowRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.MutateRowRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object tableName_ = ""; + /** * * *
    -     * Required. The unique name of the table to which the mutation should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -786,17 +955,20 @@ public java.lang.String getTableName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the mutation should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -812,17 +984,20 @@ public com.google.protobuf.ByteString getTableNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the mutation should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The tableName to set. @@ -832,43 +1007,49 @@ 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 to which the mutation should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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; } + /** * * *
    -     * Required. The unique name of the table to which the mutation should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The bytes for tableName to set. @@ -879,13 +1060,155 @@ public Builder setTableNameBytes(com.google.protobuf.ByteString value) { 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_ = ""; + /** * * @@ -909,6 +1232,7 @@ public java.lang.String getAppProfileId() { return (java.lang.String) ref; } } + /** * * @@ -932,6 +1256,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -949,11 +1274,12 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -967,11 +1293,12 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -990,13 +1317,14 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -1012,6 +1340,7 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getRowKey() { return rowKey_; } + /** * * @@ -1028,11 +1357,12 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1045,7 +1375,7 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearRowKey() { - + bitField0_ = (bitField0_ & ~0x00000008); rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; @@ -1055,13 +1385,13 @@ public Builder clearRowKey() { java.util.Collections.emptyList(); private void ensureMutationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000010) != 0)) { mutations_ = new java.util.ArrayList(mutations_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000010; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> @@ -1071,9 +1401,9 @@ private void ensureMutationsIsMutable() { * * *
    -     * 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.
    +     * 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.
          * 
    * * @@ -1087,13 +1417,14 @@ public java.util.List getMutationsList() { 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.
    +     * 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.
          * 
    * * @@ -1107,13 +1438,14 @@ public int getMutationsCount() { 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.
    +     * 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.
          * 
    * * @@ -1127,13 +1459,14 @@ public com.google.bigtable.v2.Mutation getMutations(int index) { 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.
    +     * 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.
          * 
    * * @@ -1153,13 +1486,14 @@ public Builder setMutations(int index, com.google.bigtable.v2.Mutation 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.
    +     * 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.
          * 
    * * @@ -1177,13 +1511,14 @@ public Builder setMutations( } 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.
    +     * 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.
          * 
    * * @@ -1203,13 +1538,14 @@ public Builder addMutations(com.google.bigtable.v2.Mutation 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.
    +     * 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.
          * 
    * * @@ -1229,13 +1565,14 @@ public Builder addMutations(int index, com.google.bigtable.v2.Mutation 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.
    +     * 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.
          * 
    * * @@ -1252,13 +1589,14 @@ public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForVa } 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.
    +     * 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.
          * 
    * * @@ -1276,13 +1614,14 @@ public Builder addMutations( } 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.
    +     * 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.
          * 
    * * @@ -1300,13 +1639,14 @@ public Builder addAllMutations( } 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.
    +     * 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.
          * 
    * * @@ -1316,20 +1656,21 @@ public Builder addAllMutations( public Builder clearMutations() { if (mutationsBuilder_ == null) { mutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + 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.
    +     * 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.
          * 
    * * @@ -1346,13 +1687,14 @@ public Builder removeMutations(int 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.
    +     * 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.
          * 
    * * @@ -1360,15 +1702,16 @@ public Builder removeMutations(int index) { * */ public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(int index) { - return getMutationsFieldBuilder().getBuilder(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.
    +     * 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.
          * 
    * * @@ -1382,13 +1725,14 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) 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.
    +     * 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.
          * 
    * * @@ -1403,13 +1747,14 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) 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.
    +     * 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.
          * 
    * * @@ -1417,16 +1762,17 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) * */ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { - return getMutationsFieldBuilder() + 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.
    +     * 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.
          * 
    * * @@ -1434,16 +1780,17 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { * */ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { - return getMutationsFieldBuilder() + 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.
    +     * 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.
          * 
    * * @@ -1451,35 +1798,227 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { * */ public java.util.List getMutationsBuilderList() { - return getMutationsFieldBuilder().getBuilderList(); + return internalGetMutationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> - getMutationsFieldBuilder() { + internalGetMutationsFieldBuilder() { if (mutationsBuilder_ == null) { mutationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder>( - mutations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + mutations_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); mutations_ = null; } return mutationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -1503,7 +2042,18 @@ public MutateRowRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new MutateRowRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java index cd0791f7d3..653a6fb7e7 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,35 +30,78 @@ public interface MutateRowRequestOrBuilder * * *
    -   * Required. The unique name of the table to which the mutation should be applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. */ java.lang.String getTableName(); + /** * * *
    -   * Required. The unique name of the table to which the mutation should be applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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(); + /** * * @@ -69,6 +115,7 @@ public interface MutateRowRequestOrBuilder * @return The appProfileId. */ java.lang.String getAppProfileId(); + /** * * @@ -100,9 +147,9 @@ public interface MutateRowRequestOrBuilder * * *
    -   * 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.
    +   * 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.
        * 
    * * @@ -110,13 +157,14 @@ public interface MutateRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -124,13 +172,14 @@ public interface MutateRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -138,13 +187,14 @@ public interface MutateRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -152,13 +202,14 @@ public interface MutateRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -166,4 +217,44 @@ public interface MutateRowRequestOrBuilder * */ 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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java index 1a7e77ded5..8abbb58859 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,65 +29,29 @@ * * Protobuf type {@code google.bigtable.v2.MutateRowResponse} */ -public final class MutateRowResponse extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use MutateRowResponse.newBuilder() to construct. - private MutateRowResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private MutateRowResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MutateRowResponse(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MutateRowResponse"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use MutateRowResponse.newBuilder() to construct. + private MutateRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private MutateRowResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private MutateRowResponse() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto @@ -93,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable @@ -116,7 +82,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -125,7 +91,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -140,7 +106,7 @@ public boolean equals(final java.lang.Object obj) { } com.google.bigtable.v2.MutateRowResponse other = (com.google.bigtable.v2.MutateRowResponse) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -151,7 +117,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -193,38 +159,38 @@ public static com.google.bigtable.v2.MutateRowResponse parseFrom( public static com.google.bigtable.v2.MutateRowResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -247,10 +213,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -260,7 +227,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.MutateRowResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -270,7 +237,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowResponse_fieldAccessorTable @@ -280,17 +247,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.MutateRowResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -327,39 +287,6 @@ public com.google.bigtable.v2.MutateRowResponse buildPartial() { return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.bigtable.v2.MutateRowResponse) { @@ -372,7 +299,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.MutateRowResponse other) { if (other == com.google.bigtable.v2.MutateRowResponse.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -387,31 +314,34 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.MutateRowResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.MutateRowResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowResponse) } @@ -433,7 +363,18 @@ public MutateRowResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new MutateRowResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java index 54dffa3f98..099ede3648 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java index 49650dcd89..3c4a869639 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,107 +29,42 @@ * * Protobuf type {@code google.bigtable.v2.MutateRowsRequest} */ -public final class MutateRowsRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private MutateRowsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private MutateRowsRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; entries_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MutateRowsRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private MutateRowsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - entries_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entries_.add( - input.readMessage( - com.google.bigtable.v2.MutateRowsRequest.Entry.parser(), extensionRegistry)); - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); - - appProfileId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable @@ -158,10 +95,9 @@ public interface EntryOrBuilder * * *
    -     * 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.
    +     * 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.
          * 
    * * @@ -169,14 +105,14 @@ public interface EntryOrBuilder * */ 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.
    +     * 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.
          * 
    * * @@ -184,14 +120,14 @@ public interface EntryOrBuilder * */ 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.
    +     * 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.
          * 
    * * @@ -199,14 +135,14 @@ public interface EntryOrBuilder * */ 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.
    +     * 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.
          * 
    * * @@ -214,14 +150,14 @@ public interface EntryOrBuilder * */ 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.
    +     * 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.
          * 
    * * @@ -229,7 +165,48 @@ public interface EntryOrBuilder * */ 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(); } + /** * * @@ -239,13 +216,24 @@ public interface EntryOrBuilder * * Protobuf type {@code google.bigtable.v2.MutateRowsRequest.Entry} */ - public static final class Entry extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -254,80 +242,13 @@ private Entry() { mutations_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Entry(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Entry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - rowKey_ = input.readBytes(); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - mutations_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - mutations_.add( - input.readMessage(com.google.bigtable.v2.Mutation.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - mutations_ = java.util.Collections.unmodifiableList(mutations_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable @@ -336,8 +257,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -355,15 +278,17 @@ public com.google.protobuf.ByteString getRowKey() { } 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.
    +     * 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.
          * 
    * * @@ -374,14 +299,14 @@ public com.google.protobuf.ByteString getRowKey() { 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.
    +     * 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.
          * 
    * * @@ -393,14 +318,14 @@ public java.util.List getMutationsList() { 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.
    +     * 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.
          * 
    * * @@ -411,14 +336,14 @@ public java.util.List getMutationsList() { 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.
    +     * 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.
          * 
    * * @@ -429,14 +354,14 @@ public int getMutationsCount() { 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.
    +     * 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.
          * 
    * * @@ -448,6 +373,62 @@ 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 @@ -468,7 +449,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < mutations_.size(); i++) { output.writeMessage(2, mutations_.get(i)); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getIdempotency()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -483,7 +467,10 @@ public int getSerializedSize() { for (int i = 0; i < mutations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, mutations_.get(i)); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIdempotency()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -501,7 +488,11 @@ public boolean equals(final java.lang.Object obj) { if (!getRowKey().equals(other.getRowKey())) return false; if (!getMutationsList().equals(other.getMutationsList())) return false; - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -518,7 +509,11 @@ public int hashCode() { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + if (hasIdempotency()) { + hash = (37 * hash) + IDEMPOTENCY_FIELD_NUMBER; + hash = (53 * hash) + getIdempotency().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -560,38 +555,38 @@ public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( public static com.google.bigtable.v2.MutateRowsRequest.Entry parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -614,11 +609,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -628,8 +623,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.MutateRowsRequest.Entry} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -639,7 +633,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsRequest_Entry_fieldAccessorTable @@ -653,28 +647,35 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMutationsFieldBuilder(); + 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(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + mutations_ = null; mutationsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); + idempotency_ = null; + if (idempotencyBuilder_ != null) { + idempotencyBuilder_.dispose(); + idempotencyBuilder_ = null; + } return this; } @@ -702,54 +703,39 @@ public com.google.bigtable.v2.MutateRowsRequest.Entry build() { public com.google.bigtable.v2.MutateRowsRequest.Entry buildPartial() { com.google.bigtable.v2.MutateRowsRequest.Entry result = new com.google.bigtable.v2.MutateRowsRequest.Entry(this); - int from_bitField0_ = bitField0_; - result.rowKey_ = rowKey_; + 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_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { mutations_ = java.util.Collections.unmodifiableList(mutations_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.mutations_ = mutations_; } else { result.mutations_ = mutationsBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -765,14 +751,14 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest.Entry other) { if (other == com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance()) return this; - if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getRowKey().isEmpty()) { setRowKey(other.getRowKey()); } if (mutationsBuilder_ == null) { if (!other.mutations_.isEmpty()) { if (mutations_.isEmpty()) { mutations_ = other.mutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureMutationsIsMutable(); mutations_.addAll(other.mutations_); @@ -785,17 +771,20 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest.Entry other) { mutationsBuilder_.dispose(); mutationsBuilder_ = null; mutations_ = other.mutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); mutationsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getMutationsFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetMutationsFieldBuilder() : null; } else { mutationsBuilder_.addAllMessages(other.mutations_); } } } - this.mergeUnknownFields(other.unknownFields); + if (other.hasIdempotency()) { + mergeIdempotency(other.getIdempotency()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -810,23 +799,64 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.MutateRowsRequest.Entry parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.MutateRowsRequest.Entry) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -842,6 +872,7 @@ public Builder mergeFrom( public com.google.protobuf.ByteString getRowKey() { return rowKey_; } + /** * * @@ -858,11 +889,12 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -875,7 +907,7 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearRowKey() { - + bitField0_ = (bitField0_ & ~0x00000001); rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; @@ -885,13 +917,13 @@ public Builder clearRowKey() { java.util.Collections.emptyList(); private void ensureMutationsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { mutations_ = new java.util.ArrayList(mutations_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> @@ -901,10 +933,9 @@ private void ensureMutationsIsMutable() { * * *
    -       * 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.
    +       * 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.
            * 
    * * @@ -918,14 +949,14 @@ public java.util.List getMutationsList() { 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.
    +       * 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.
            * 
    * * @@ -939,14 +970,14 @@ public int getMutationsCount() { 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.
    +       * 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.
            * 
    * * @@ -960,14 +991,14 @@ public com.google.bigtable.v2.Mutation getMutations(int index) { 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.
    +       * 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.
            * 
    * * @@ -987,14 +1018,14 @@ public Builder setMutations(int index, com.google.bigtable.v2.Mutation 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.
    +       * 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.
            * 
    * * @@ -1012,14 +1043,14 @@ public Builder setMutations( } 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.
    +       * 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.
            * 
    * * @@ -1039,14 +1070,14 @@ public Builder addMutations(com.google.bigtable.v2.Mutation 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.
    +       * 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.
            * 
    * * @@ -1066,14 +1097,14 @@ public Builder addMutations(int index, com.google.bigtable.v2.Mutation 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.
    +       * 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.
            * 
    * * @@ -1090,14 +1121,14 @@ public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForVa } 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.
    +       * 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.
            * 
    * * @@ -1115,14 +1146,14 @@ public Builder addMutations( } 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.
    +       * 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.
            * 
    * * @@ -1140,14 +1171,14 @@ public Builder addAllMutations( } 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.
    +       * 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.
            * 
    * * @@ -1157,21 +1188,21 @@ public Builder addAllMutations( public Builder clearMutations() { if (mutationsBuilder_ == null) { mutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + 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.
    +       * 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.
            * 
    * * @@ -1188,14 +1219,14 @@ public Builder removeMutations(int 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.
    +       * 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.
            * 
    * * @@ -1203,16 +1234,16 @@ public Builder removeMutations(int index) { * */ public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(int index) { - return getMutationsFieldBuilder().getBuilder(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.
    +       * 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.
            * 
    * * @@ -1226,14 +1257,14 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) 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.
    +       * 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.
            * 
    * * @@ -1248,14 +1279,14 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) 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.
    +       * 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.
            * 
    * * @@ -1263,17 +1294,17 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(int index) * */ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { - return getMutationsFieldBuilder() + 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.
    +       * 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.
            * 
    * * @@ -1281,17 +1312,17 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { * */ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { - return getMutationsFieldBuilder() + 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.
    +       * 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.
            * 
    * * @@ -1299,36 +1330,227 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(int index) { * */ public java.util.List getMutationsBuilderList() { - return getMutationsFieldBuilder().getBuilderList(); + return internalGetMutationsFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder> - getMutationsFieldBuilder() { + internalGetMutationsFieldBuilder() { if (mutationsBuilder_ == null) { mutationsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Mutation, com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder>( - mutations_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + mutations_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); mutations_ = null; } return mutationsBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +       * 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) @@ -1352,7 +1574,19 @@ public Entry parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Entry(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1360,64 +1594,141 @@ public static com.google.protobuf.Parser parser() { return PARSER; } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - 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; - @java.lang.Override - public com.google.bigtable.v2.MutateRowsRequest.Entry getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; - public static final int TABLE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object tableName_; /** * * *
    -   * Required. The unique name of the table to which the mutations should be applied.
    +   * 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 table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * - * @return The tableName. + * @return The authorizedViewName. */ @java.lang.Override - public java.lang.String getTableName() { - java.lang.Object ref = tableName_; + 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(); - tableName_ = s; + authorizedViewName_ = s; return s; } } + /** * * *
    -   * Required. The unique name of the table to which the mutations should be applied.
    +   * 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 table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * - * @return The bytes for tableName. + * @return The bytes for authorizedViewName. */ @java.lang.Override - public com.google.protobuf.ByteString getTableNameBytes() { - java.lang.Object ref = tableName_; + 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); - tableName_ = b; + authorizedViewName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -1425,7 +1736,10 @@ public com.google.protobuf.ByteString getTableNameBytes() { } public static final int APP_PROFILE_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + /** * * @@ -1450,6 +1764,7 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * @@ -1476,7 +1791,10 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { } public static final int ENTRIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List entries_; + /** * * @@ -1496,6 +1814,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { public java.util.List getEntriesList() { return entries_; } + /** * * @@ -1516,6 +1835,7 @@ public java.util.List getEntries getEntriesOrBuilderList() { return entries_; } + /** * * @@ -1535,6 +1855,7 @@ public java.util.List getEntries public int getEntriesCount() { return entries_.size(); } + /** * * @@ -1554,6 +1875,7 @@ public int getEntriesCount() { public com.google.bigtable.v2.MutateRowsRequest.Entry getEntries(int index) { return entries_.get(index); } + /** * * @@ -1588,16 +1910,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + 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 (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, appProfileId_); + 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_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1606,16 +1931,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + 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 (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1631,9 +1959,10 @@ public boolean equals(final java.lang.Object 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 (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1646,13 +1975,15 @@ public int hashCode() { 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) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1694,38 +2025,38 @@ public static com.google.bigtable.v2.MutateRowsRequest parseFrom( public static com.google.bigtable.v2.MutateRowsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1748,10 +2079,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1761,7 +2093,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.MutateRowsRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1771,7 +2103,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsRequest_fieldAccessorTable @@ -1781,34 +2113,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.MutateRowsRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEntriesFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; tableName_ = ""; - + authorizedViewName_ = ""; appProfileId_ = ""; - if (entriesBuilder_ == null) { entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + entries_ = null; entriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -1836,53 +2160,37 @@ public com.google.bigtable.v2.MutateRowsRequest build() { public com.google.bigtable.v2.MutateRowsRequest buildPartial() { com.google.bigtable.v2.MutateRowsRequest result = new com.google.bigtable.v2.MutateRowsRequest(this); - int from_bitField0_ = bitField0_; - result.tableName_ = tableName_; - result.appProfileId_ = appProfileId_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.MutateRowsRequest result) { if (entriesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000008) != 0)) { entries_ = java.util.Collections.unmodifiableList(entries_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); } result.entries_ = entries_; } else { result.entries_ = entriesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -1899,17 +2207,24 @@ 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_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureEntriesIsMutable(); entries_.addAll(other.entries_); @@ -1922,17 +2237,17 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest other) { entriesBuilder_.dispose(); entriesBuilder_ = null; entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); entriesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEntriesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEntriesFieldBuilder() : null; } else { entriesBuilder_.addAllMessages(other.entries_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1947,32 +2262,82 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.MutateRowsRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.MutateRowsRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object tableName_ = ""; + /** * * *
    -     * Required. The unique name of the table to which the mutations should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -1988,15 +2353,20 @@ public java.lang.String getTableName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the mutations should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -2012,15 +2382,20 @@ public com.google.protobuf.ByteString getTableNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the mutations should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The tableName to set. @@ -2030,39 +2405,49 @@ 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 to which the mutations should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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; } + /** * * *
    -     * Required. The unique name of the table to which the mutations should be applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The bytes for tableName to set. @@ -2073,13 +2458,155 @@ public Builder setTableNameBytes(com.google.protobuf.ByteString value) { 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_ = ""; + /** * * @@ -2103,6 +2630,7 @@ public java.lang.String getAppProfileId() { return (java.lang.String) ref; } } + /** * * @@ -2126,6 +2654,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -2143,11 +2672,12 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -2161,11 +2691,12 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -2184,8 +2715,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -2194,14 +2725,14 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureEntriesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000008) != 0)) { entries_ = new java.util.ArrayList(entries_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000008; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.MutateRowsRequest.Entry, com.google.bigtable.v2.MutateRowsRequest.Entry.Builder, com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder> @@ -2229,6 +2760,7 @@ public java.util.List getEntries return entriesBuilder_.getMessageList(); } } + /** * * @@ -2251,6 +2783,7 @@ public int getEntriesCount() { return entriesBuilder_.getCount(); } } + /** * * @@ -2273,6 +2806,7 @@ public com.google.bigtable.v2.MutateRowsRequest.Entry getEntries(int index) { return entriesBuilder_.getMessage(index); } } + /** * * @@ -2301,6 +2835,7 @@ public Builder setEntries(int index, com.google.bigtable.v2.MutateRowsRequest.En } return this; } + /** * * @@ -2327,6 +2862,7 @@ public Builder setEntries( } return this; } + /** * * @@ -2355,6 +2891,7 @@ public Builder addEntries(com.google.bigtable.v2.MutateRowsRequest.Entry value) } return this; } + /** * * @@ -2383,6 +2920,7 @@ public Builder addEntries(int index, com.google.bigtable.v2.MutateRowsRequest.En } return this; } + /** * * @@ -2409,6 +2947,7 @@ public Builder addEntries( } return this; } + /** * * @@ -2435,6 +2974,7 @@ public Builder addEntries( } return this; } + /** * * @@ -2461,6 +3001,7 @@ public Builder addAllEntries( } return this; } + /** * * @@ -2479,13 +3020,14 @@ public Builder addAllEntries( public Builder clearEntries() { if (entriesBuilder_ == null) { entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { entriesBuilder_.clear(); } return this; } + /** * * @@ -2511,6 +3053,7 @@ public Builder removeEntries(int index) { } return this; } + /** * * @@ -2527,8 +3070,9 @@ public Builder removeEntries(int index) { *
    */ public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder getEntriesBuilder(int index) { - return getEntriesFieldBuilder().getBuilder(index); + return internalGetEntriesFieldBuilder().getBuilder(index); } + /** * * @@ -2551,6 +3095,7 @@ public com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder getEntriesOrBuild return entriesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2574,6 +3119,7 @@ public com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder getEntriesOrBuild return java.util.Collections.unmodifiableList(entries_); } } + /** * * @@ -2590,9 +3136,10 @@ public com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder getEntriesOrBuild *
    */ public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder() { - return getEntriesFieldBuilder() + return internalGetEntriesFieldBuilder() .addBuilder(com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance()); } + /** * * @@ -2609,9 +3156,10 @@ public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder( *
    */ public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder(int index) { - return getEntriesFieldBuilder() + return internalGetEntriesFieldBuilder() .addBuilder(index, com.google.bigtable.v2.MutateRowsRequest.Entry.getDefaultInstance()); } + /** * * @@ -2629,37 +3177,26 @@ public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder( */ public java.util.List getEntriesBuilderList() { - return getEntriesFieldBuilder().getBuilderList(); + return internalGetEntriesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.MutateRowsRequest.Entry, com.google.bigtable.v2.MutateRowsRequest.Entry.Builder, com.google.bigtable.v2.MutateRowsRequest.EntryOrBuilder> - getEntriesFieldBuilder() { + internalGetEntriesFieldBuilder() { if (entriesBuilder_ == null) { entriesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + 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_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entries_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); entries_ = null; } return entriesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowsRequest) } @@ -2681,7 +3218,18 @@ public MutateRowsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new MutateRowsRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java index 7c877bd876..2bf701791c 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,31 +30,78 @@ public interface MutateRowsRequestOrBuilder * * *
    -   * Required. The unique name of the table to which the mutations should be applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. */ java.lang.String getTableName(); + /** * * *
    -   * Required. The unique name of the table to which the mutations should be applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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(); + /** * * @@ -65,6 +115,7 @@ public interface MutateRowsRequestOrBuilder * @return The appProfileId. */ java.lang.String getAppProfileId(); + /** * * @@ -95,6 +146,7 @@ public interface MutateRowsRequestOrBuilder * */ java.util.List getEntriesList(); + /** * * @@ -111,6 +163,7 @@ public interface MutateRowsRequestOrBuilder * */ com.google.bigtable.v2.MutateRowsRequest.Entry getEntries(int index); + /** * * @@ -127,6 +180,7 @@ public interface MutateRowsRequestOrBuilder * */ int getEntriesCount(); + /** * * @@ -144,6 +198,7 @@ public interface MutateRowsRequestOrBuilder */ java.util.List getEntriesOrBuilderList(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java index d158a5c789..2a664cc9c9 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.v2.MutateRowsResponse} */ -public final class MutateRowsResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private MutateRowsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,77 +55,13 @@ private MutateRowsResponse() { entries_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MutateRowsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private MutateRowsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - entries_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entries_.add( - input.readMessage( - com.google.bigtable.v2.MutateRowsResponse.Entry.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable @@ -154,6 +104,7 @@ public interface EntryOrBuilder * @return Whether the status field is set. */ boolean hasStatus(); + /** * * @@ -169,6 +120,7 @@ public interface EntryOrBuilder * @return The status. */ com.google.rpc.Status getStatus(); + /** * * @@ -183,6 +135,7 @@ public interface EntryOrBuilder */ com.google.rpc.StatusOrBuilder getStatusOrBuilder(); } + /** * * @@ -192,84 +145,28 @@ public interface EntryOrBuilder * * Protobuf type {@code google.bigtable.v2.MutateRowsResponse.Entry} */ - public static final class Entry extends com.google.protobuf.GeneratedMessageV3 + 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; - // Use Entry.newBuilder() to construct. - private Entry(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Entry() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Entry(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Entry"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use Entry.newBuilder() to construct. + private Entry(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private Entry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - index_ = input.readInt64(); - break; - } - case 18: - { - com.google.rpc.Status.Builder subBuilder = null; - if (status_ != null) { - subBuilder = status_.toBuilder(); - } - status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(status_); - status_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private Entry() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto @@ -277,7 +174,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable @@ -286,8 +183,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.v2.MutateRowsResponse.Entry.Builder.class); } + private int bitField0_; public static final int INDEX_FIELD_NUMBER = 1; - private long index_; + private long index_ = 0L; + /** * * @@ -307,6 +206,7 @@ public long getIndex() { public static final int STATUS_FIELD_NUMBER = 2; private com.google.rpc.Status status_; + /** * * @@ -323,8 +223,9 @@ public long getIndex() { */ @java.lang.Override public boolean hasStatus() { - return status_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -343,6 +244,7 @@ public boolean hasStatus() { public com.google.rpc.Status getStatus() { return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } + /** * * @@ -357,7 +259,7 @@ public com.google.rpc.Status getStatus() { */ @java.lang.Override public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { - return getStatus(); + return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } private byte memoizedIsInitialized = -1; @@ -377,10 +279,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (index_ != 0L) { output.writeInt64(1, index_); } - if (status_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getStatus()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -392,10 +294,10 @@ public int getSerializedSize() { if (index_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, index_); } - if (status_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -416,7 +318,7 @@ public boolean equals(final java.lang.Object obj) { if (hasStatus()) { if (!getStatus().equals(other.getStatus())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -433,7 +335,7 @@ public int hashCode() { hash = (37 * hash) + STATUS_FIELD_NUMBER; hash = (53 * hash) + getStatus().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -475,38 +377,38 @@ public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( public static com.google.bigtable.v2.MutateRowsResponse.Entry parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -529,11 +431,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -543,8 +445,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.MutateRowsResponse.Entry} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -554,7 +455,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_fieldAccessorTable @@ -568,24 +469,25 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetStatusFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; index_ = 0L; - - if (statusBuilder_ == null) { - status_ = null; - } else { - status_ = null; + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); statusBuilder_ = null; } return this; @@ -615,49 +517,24 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry build() { public com.google.bigtable.v2.MutateRowsResponse.Entry buildPartial() { com.google.bigtable.v2.MutateRowsResponse.Entry result = new com.google.bigtable.v2.MutateRowsResponse.Entry(this); - result.index_ = index_; - if (statusBuilder_ == null) { - result.status_ = status_; - } else { - result.status_ = statusBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -679,7 +556,7 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsResponse.Entry other) if (other.hasStatus()) { mergeStatus(other.getStatus()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -694,22 +571,51 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.MutateRowsResponse.Entry parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.v2.MutateRowsResponse.Entry) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private long index_; + /** * * @@ -726,6 +632,7 @@ public Builder mergeFrom( public long getIndex() { return index_; } + /** * * @@ -742,9 +649,11 @@ public long getIndex() { public Builder setIndex(long value) { index_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -758,16 +667,17 @@ public Builder setIndex(long value) { * @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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_; + /** * * @@ -783,8 +693,9 @@ public Builder clearIndex() { * @return Whether the status field is set. */ public boolean hasStatus() { - return statusBuilder_ != null || status_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -806,6 +717,7 @@ public com.google.rpc.Status getStatus() { return statusBuilder_.getMessage(); } } + /** * * @@ -824,13 +736,14 @@ public Builder setStatus(com.google.rpc.Status value) { throw new NullPointerException(); } status_ = value; - onChanged(); } else { statusBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -846,13 +759,14 @@ public Builder setStatus(com.google.rpc.Status value) { public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { if (statusBuilder_ == null) { status_ = builderForValue.build(); - onChanged(); } else { statusBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -867,18 +781,23 @@ public Builder setStatus(com.google.rpc.Status.Builder builderForValue) { */ public Builder mergeStatus(com.google.rpc.Status value) { if (statusBuilder_ == null) { - if (status_ != null) { - status_ = com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && status_ != null + && status_ != com.google.rpc.Status.getDefaultInstance()) { + getStatusBuilder().mergeFrom(value); } else { status_ = value; } - onChanged(); } else { statusBuilder_.mergeFrom(value); } - + if (status_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -892,16 +811,16 @@ public Builder mergeStatus(com.google.rpc.Status value) { * .google.rpc.Status status = 2; */ public Builder clearStatus() { - if (statusBuilder_ == null) { - status_ = null; - onChanged(); - } else { - status_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + status_ = null; + if (statusBuilder_ != null) { + statusBuilder_.dispose(); statusBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -915,10 +834,11 @@ public Builder clearStatus() { * .google.rpc.Status status = 2; */ public com.google.rpc.Status.Builder getStatusBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getStatusFieldBuilder().getBuilder(); + return internalGetStatusFieldBuilder().getBuilder(); } + /** * * @@ -938,6 +858,7 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_; } } + /** * * @@ -950,12 +871,12 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { * * .google.rpc.Status status = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getStatusFieldBuilder() { + internalGetStatusFieldBuilder() { if (statusBuilder_ == null) { statusBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean()); @@ -964,18 +885,6 @@ public com.google.rpc.StatusOrBuilder getStatusOrBuilder() { return statusBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.MutateRowsResponse.Entry) } @@ -997,7 +906,19 @@ public Entry parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Entry(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1016,8 +937,12 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry getDefaultInstanceForType } } + private int bitField0_; public static final int ENTRIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List entries_; + /** * * @@ -1031,6 +956,7 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry getDefaultInstanceForType public java.util.List getEntriesList() { return entries_; } + /** * * @@ -1045,6 +971,7 @@ public java.util.List getEntrie getEntriesOrBuilderList() { return entries_; } + /** * * @@ -1058,6 +985,7 @@ public java.util.List getEntrie public int getEntriesCount() { return entries_.size(); } + /** * * @@ -1071,6 +999,7 @@ public int getEntriesCount() { public com.google.bigtable.v2.MutateRowsResponse.Entry getEntries(int index) { return entries_.get(index); } + /** * * @@ -1085,6 +1014,65 @@ public com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuil 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 @@ -1102,7 +1090,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < entries_.size(); i++) { output.writeMessage(1, entries_.get(i)); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRateLimitInfo()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1114,7 +1105,10 @@ public int getSerializedSize() { for (int i = 0; i < entries_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entries_.get(i)); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRateLimitInfo()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1131,7 +1125,11 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.v2.MutateRowsResponse) obj; if (!getEntriesList().equals(other.getEntriesList())) return false; - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -1146,7 +1144,11 @@ public int hashCode() { hash = (37 * hash) + ENTRIES_FIELD_NUMBER; hash = (53 * hash) + getEntriesList().hashCode(); } - hash = (29 * hash) + unknownFields.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; } @@ -1188,38 +1190,38 @@ public static com.google.bigtable.v2.MutateRowsResponse parseFrom( public static com.google.bigtable.v2.MutateRowsResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1242,10 +1244,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1255,7 +1258,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.MutateRowsResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1265,7 +1268,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsResponse_fieldAccessorTable @@ -1279,26 +1282,34 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getEntriesFieldBuilder(); + 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(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + entries_ = null; entriesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); + rateLimitInfo_ = null; + if (rateLimitInfoBuilder_ != null) { + rateLimitInfoBuilder_.dispose(); + rateLimitInfoBuilder_ = null; + } return this; } @@ -1326,7 +1337,15 @@ public com.google.bigtable.v2.MutateRowsResponse build() { public com.google.bigtable.v2.MutateRowsResponse buildPartial() { com.google.bigtable.v2.MutateRowsResponse result = new com.google.bigtable.v2.MutateRowsResponse(this); - int from_bitField0_ = bitField0_; + 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_); @@ -1336,41 +1355,17 @@ public com.google.bigtable.v2.MutateRowsResponse buildPartial() { } else { result.entries_ = entriesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -1404,15 +1399,18 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsResponse other) { entries_ = other.entries_; bitField0_ = (bitField0_ & ~0x00000001); entriesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getEntriesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetEntriesFieldBuilder() : null; } else { entriesBuilder_.addAllMessages(other.entries_); } } } - this.mergeUnknownFields(other.unknownFields); + if (other.hasRateLimitInfo()) { + mergeRateLimitInfo(other.getRateLimitInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1427,17 +1425,52 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.MutateRowsResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.MutateRowsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1454,7 +1487,7 @@ private void ensureEntriesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.MutateRowsResponse.Entry, com.google.bigtable.v2.MutateRowsResponse.Entry.Builder, com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder> @@ -1476,6 +1509,7 @@ public java.util.List getEntrie return entriesBuilder_.getMessageList(); } } + /** * * @@ -1492,6 +1526,7 @@ public int getEntriesCount() { return entriesBuilder_.getCount(); } } + /** * * @@ -1508,6 +1543,7 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry getEntries(int index) { return entriesBuilder_.getMessage(index); } } + /** * * @@ -1530,6 +1566,7 @@ public Builder setEntries(int index, com.google.bigtable.v2.MutateRowsResponse.E } return this; } + /** * * @@ -1550,6 +1587,7 @@ public Builder setEntries( } return this; } + /** * * @@ -1572,6 +1610,7 @@ public Builder addEntries(com.google.bigtable.v2.MutateRowsResponse.Entry value) } return this; } + /** * * @@ -1594,6 +1633,7 @@ public Builder addEntries(int index, com.google.bigtable.v2.MutateRowsResponse.E } return this; } + /** * * @@ -1614,6 +1654,7 @@ public Builder addEntries( } return this; } + /** * * @@ -1634,6 +1675,7 @@ public Builder addEntries( } return this; } + /** * * @@ -1654,6 +1696,7 @@ public Builder addAllEntries( } return this; } + /** * * @@ -1673,6 +1716,7 @@ public Builder clearEntries() { } return this; } + /** * * @@ -1692,6 +1736,7 @@ public Builder removeEntries(int index) { } return this; } + /** * * @@ -1702,8 +1747,9 @@ public Builder removeEntries(int index) { * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; */ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder getEntriesBuilder(int index) { - return getEntriesFieldBuilder().getBuilder(index); + return internalGetEntriesFieldBuilder().getBuilder(index); } + /** * * @@ -1720,6 +1766,7 @@ public com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuil return entriesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1737,6 +1784,7 @@ public com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuil return java.util.Collections.unmodifiableList(entries_); } } + /** * * @@ -1747,9 +1795,10 @@ public com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder getEntriesOrBuil * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; */ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder() { - return getEntriesFieldBuilder() + return internalGetEntriesFieldBuilder() .addBuilder(com.google.bigtable.v2.MutateRowsResponse.Entry.getDefaultInstance()); } + /** * * @@ -1760,9 +1809,10 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; */ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder(int index) { - return getEntriesFieldBuilder() + return internalGetEntriesFieldBuilder() .addBuilder(index, com.google.bigtable.v2.MutateRowsResponse.Entry.getDefaultInstance()); } + /** * * @@ -1774,17 +1824,17 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder */ public java.util.List getEntriesBuilderList() { - return getEntriesFieldBuilder().getBuilderList(); + return internalGetEntriesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.MutateRowsResponse.Entry, com.google.bigtable.v2.MutateRowsResponse.Entry.Builder, com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder> - getEntriesFieldBuilder() { + internalGetEntriesFieldBuilder() { if (entriesBuilder_ == null) { entriesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.MutateRowsResponse.Entry, com.google.bigtable.v2.MutateRowsResponse.Entry.Builder, com.google.bigtable.v2.MutateRowsResponse.EntryOrBuilder>( @@ -1794,15 +1844,216 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder return entriesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -1826,7 +2077,18 @@ public MutateRowsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new MutateRowsResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java index ca4b764ba7..1a98432832 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -33,6 +36,7 @@ public interface MutateRowsResponseOrBuilder * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; */ java.util.List getEntriesList(); + /** * * @@ -43,6 +47,7 @@ public interface MutateRowsResponseOrBuilder * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; */ com.google.bigtable.v2.MutateRowsResponse.Entry getEntries(int index); + /** * * @@ -53,6 +58,7 @@ public interface MutateRowsResponseOrBuilder * repeated .google.bigtable.v2.MutateRowsResponse.Entry entries = 1; */ int getEntriesCount(); + /** * * @@ -64,6 +70,7 @@ public interface MutateRowsResponseOrBuilder */ java.util.List getEntriesOrBuilderList(); + /** * * @@ -74,4 +81,47 @@ public interface MutateRowsResponseOrBuilder * 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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java index 14123e4975..9aff81a132 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Mutation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,139 +29,36 @@ * * Protobuf type {@code google.bigtable.v2.Mutation} */ -public final class Mutation extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use Mutation.newBuilder() to construct. - private Mutation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Mutation() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Mutation(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "Mutation"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use Mutation.newBuilder() to construct. + private Mutation(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private Mutation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.v2.Mutation.SetCell.Builder subBuilder = null; - if (mutationCase_ == 1) { - subBuilder = ((com.google.bigtable.v2.Mutation.SetCell) mutation_).toBuilder(); - } - mutation_ = - input.readMessage( - com.google.bigtable.v2.Mutation.SetCell.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.Mutation.SetCell) mutation_); - mutation_ = subBuilder.buildPartial(); - } - mutationCase_ = 1; - break; - } - case 18: - { - com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder subBuilder = null; - if (mutationCase_ == 2) { - subBuilder = - ((com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_).toBuilder(); - } - mutation_ = - input.readMessage( - com.google.bigtable.v2.Mutation.DeleteFromColumn.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromColumn) mutation_); - mutation_ = subBuilder.buildPartial(); - } - mutationCase_ = 2; - break; - } - case 26: - { - com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder subBuilder = null; - if (mutationCase_ == 3) { - subBuilder = - ((com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_).toBuilder(); - } - mutation_ = - input.readMessage( - com.google.bigtable.v2.Mutation.DeleteFromFamily.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromFamily) mutation_); - mutation_ = subBuilder.buildPartial(); - } - mutationCase_ = 3; - break; - } - case 34: - { - com.google.bigtable.v2.Mutation.DeleteFromRow.Builder subBuilder = null; - if (mutationCase_ == 4) { - subBuilder = - ((com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_).toBuilder(); - } - mutation_ = - input.readMessage( - com.google.bigtable.v2.Mutation.DeleteFromRow.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_); - mutation_ = subBuilder.buildPartial(); - } - mutationCase_ = 4; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_fieldAccessorTable @@ -185,6 +84,7 @@ public interface SetCellOrBuilder * @return The familyName. */ java.lang.String getFamilyName(); + /** * * @@ -243,6 +143,7 @@ public interface SetCellOrBuilder */ com.google.protobuf.ByteString getValue(); } + /** * * @@ -252,13 +153,24 @@ public interface SetCellOrBuilder * * Protobuf type {@code google.bigtable.v2.Mutation.SetCell} */ - public static final class SetCell extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private SetCell(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -268,83 +180,13 @@ private SetCell() { value_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SetCell(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SetCell( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - familyName_ = s; - break; - } - case 18: - { - columnQualifier_ = input.readBytes(); - break; - } - case 24: - { - timestampMicros_ = input.readInt64(); - break; - } - case 34: - { - value_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_SetCell_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable @@ -354,7 +196,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int FAMILY_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object familyName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + /** * * @@ -379,6 +224,7 @@ public java.lang.String getFamilyName() { return s; } } + /** * * @@ -405,7 +251,8 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { } public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString columnQualifier_; + private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -424,7 +271,8 @@ public com.google.protobuf.ByteString getColumnQualifier() { } public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 3; - private long timestampMicros_; + private long timestampMicros_ = 0L; + /** * * @@ -446,7 +294,8 @@ public long getTimestampMicros() { } public static final int VALUE_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString value_; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -477,8 +326,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getFamilyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, familyName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); } if (!columnQualifier_.isEmpty()) { output.writeBytes(2, columnQualifier_); @@ -489,7 +338,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!value_.isEmpty()) { output.writeBytes(4, value_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -498,8 +347,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getFamilyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, familyName_); + 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_); @@ -510,7 +359,7 @@ public int getSerializedSize() { if (!value_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, value_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -529,7 +378,7 @@ public boolean equals(final java.lang.Object obj) { if (!getColumnQualifier().equals(other.getColumnQualifier())) return false; if (getTimestampMicros() != other.getTimestampMicros()) return false; if (!getValue().equals(other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -548,7 +397,7 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTimestampMicros()); hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -590,38 +439,38 @@ public static com.google.bigtable.v2.Mutation.SetCell parseFrom( public static com.google.bigtable.v2.Mutation.SetCell parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -644,11 +493,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -658,8 +507,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.Mutation.SetCell} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -669,7 +517,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_SetCell_fieldAccessorTable @@ -679,30 +527,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Mutation.SetCell.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @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; } @@ -730,47 +568,27 @@ public com.google.bigtable.v2.Mutation.SetCell build() { public com.google.bigtable.v2.Mutation.SetCell buildPartial() { com.google.bigtable.v2.Mutation.SetCell result = new com.google.bigtable.v2.Mutation.SetCell(this); - result.familyName_ = familyName_; - result.columnQualifier_ = columnQualifier_; - result.timestampMicros_ = timestampMicros_; - result.value_ = value_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -787,18 +605,19 @@ 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() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getColumnQualifier().isEmpty()) { setColumnQualifier(other.getColumnQualifier()); } if (other.getTimestampMicros() != 0L) { setTimestampMicros(other.getTimestampMicros()); } - if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getValue().isEmpty()) { setValue(other.getValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -813,21 +632,62 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Mutation.SetCell parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.Mutation.SetCell) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object familyName_ = ""; + /** * * @@ -851,6 +711,7 @@ public java.lang.String getFamilyName() { return (java.lang.String) ref; } } + /** * * @@ -874,6 +735,7 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -891,11 +753,12 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -909,11 +772,12 @@ public Builder setFamilyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFamilyName() { - familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -932,14 +796,15 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -956,6 +821,7 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getColumnQualifier() { return columnQualifier_; } + /** * * @@ -973,11 +839,12 @@ public Builder setColumnQualifier(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - columnQualifier_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -991,13 +858,14 @@ public Builder setColumnQualifier(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearColumnQualifier() { - + bitField0_ = (bitField0_ & ~0x00000002); columnQualifier_ = getDefaultInstance().getColumnQualifier(); onChanged(); return this; } private long timestampMicros_; + /** * * @@ -1017,6 +885,7 @@ public Builder clearColumnQualifier() { public long getTimestampMicros() { return timestampMicros_; } + /** * * @@ -1036,9 +905,11 @@ public long getTimestampMicros() { public Builder setTimestampMicros(long value) { timestampMicros_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -1055,13 +926,14 @@ public Builder setTimestampMicros(long value) { * @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; + /** * * @@ -1077,6 +949,7 @@ public Builder clearTimestampMicros() { public com.google.protobuf.ByteString getValue() { return value_; } + /** * * @@ -1093,11 +966,12 @@ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -1110,24 +984,12 @@ public Builder setValue(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearValue() { - + bitField0_ = (bitField0_ & ~0x00000008); value_ = getDefaultInstance().getValue(); onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.SetCell) } @@ -1149,7 +1011,19 @@ public SetCell parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SetCell(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1168,17 +1042,18 @@ public com.google.bigtable.v2.Mutation.SetCell getDefaultInstanceForType() { } } - public interface DeleteFromColumnOrBuilder + public interface AddToCellOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromColumn) + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.AddToCell) com.google.protobuf.MessageOrBuilder { /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -1186,12 +1061,14 @@ public interface DeleteFromColumnOrBuilder * @return The familyName. */ java.lang.String getFamilyName(); + /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -1204,175 +1081,185 @@ public interface DeleteFromColumnOrBuilder * * *
    -     * The qualifier of the column from which cells should be deleted.
    -     * Can be any byte string, including the empty string.
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
          * 
    * - * bytes column_qualifier = 2; + * .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.protobuf.ByteString getColumnQualifier(); + com.google.bigtable.v2.Value getColumnQualifier(); /** * * *
    -     * The range of timestamps within which cells should be deleted.
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
          * 
    * - * .google.bigtable.v2.TimestampRange time_range = 3; + * .google.bigtable.v2.Value column_qualifier = 2; + */ + com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder(); + + /** * - * @return Whether the timeRange field is set. + * + *
    +     * 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 hasTimeRange(); + boolean hasTimestamp(); + /** * * *
    -     * The range of timestamps within which cells should be deleted.
    +     * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; * - * @return The timeRange. + * @return The timestamp. */ - com.google.bigtable.v2.TimestampRange getTimeRange(); + com.google.bigtable.v2.Value getTimestamp(); + /** * * *
    -     * The range of timestamps within which cells should be deleted.
    +     * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder(); + 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 deletes cells from the specified column, optionally
    -   * restricting the deletions to a given timestamp range.
    +   * A Mutation which incrementally updates a cell in an `Aggregate` family.
        * 
    * - * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromColumn} + * Protobuf type {@code google.bigtable.v2.Mutation.AddToCell} */ - public static final class DeleteFromColumn extends com.google.protobuf.GeneratedMessageV3 + public static final class AddToCell extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromColumn) - DeleteFromColumnOrBuilder { + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.AddToCell) + AddToCellOrBuilder { private static final long serialVersionUID = 0L; - // Use DeleteFromColumn.newBuilder() to construct. - private DeleteFromColumn(com.google.protobuf.GeneratedMessageV3.Builder builder) { + + 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 DeleteFromColumn() { + private AddToCell() { familyName_ = ""; - columnQualifier_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteFromColumn(); + 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 - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + 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 DeleteFromColumn( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - familyName_ = s; - break; - } - case 18: - { - columnQualifier_ = input.readBytes(); - break; - } - case 26: - { - com.google.bigtable.v2.TimestampRange.Builder subBuilder = null; - if (timeRange_ != null) { - subBuilder = timeRange_.toBuilder(); - } - timeRange_ = - input.readMessage( - com.google.bigtable.v2.TimestampRange.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timeRange_); - timeRange_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor; - } + private int bitField0_; + public static final int FAMILY_NAME_FIELD_NUMBER = 1; - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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); - } + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; - public static final int FAMILY_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object familyName_; /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -1391,12 +1278,14 @@ public java.lang.String getFamilyName() { return s; } } + /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -1417,70 +1306,163 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { } public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString columnQualifier_; + private com.google.bigtable.v2.Value columnQualifier_; + /** * * *
    -     * The qualifier of the column from which cells should be deleted.
    -     * Can be any byte string, including the empty string.
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
          * 
    * - * bytes column_qualifier = 2; + * .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.protobuf.ByteString getColumnQualifier() { - return columnQualifier_; + public com.google.bigtable.v2.Value getColumnQualifier() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : 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.
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
          * 
    * - * .google.bigtable.v2.TimestampRange time_range = 3; + * .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_; + + /** * - * @return Whether the timeRange field is set. + * + *
    +     * 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 hasTimeRange() { - return timeRange_ != null; + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); } + /** * * *
    -     * The range of timestamps within which cells should be deleted.
    +     * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; * - * @return The timeRange. + * @return The timestamp. */ @java.lang.Override - public com.google.bigtable.v2.TimestampRange getTimeRange() { - return timeRange_ == null - ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() - : timeRange_; + public com.google.bigtable.v2.Value getTimestamp() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; } + /** * * *
    -     * The range of timestamps within which cells should be deleted.
    +     * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ @java.lang.Override - public com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder() { - return getTimeRange(); + 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; @@ -1497,16 +1479,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getFamilyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, familyName_); + 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(2, getColumnQualifier()); } - if (timeRange_ != null) { - output.writeMessage(3, getTimeRange()); + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getTimestamp()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getInput()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1515,16 +1500,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getFamilyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, familyName_); + 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(2, getColumnQualifier()); } - if (timeRange_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTimeRange()); + 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 += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1534,19 +1522,26 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.bigtable.v2.Mutation.DeleteFromColumn)) { + if (!(obj instanceof com.google.bigtable.v2.Mutation.AddToCell)) { return super.equals(obj); } - com.google.bigtable.v2.Mutation.DeleteFromColumn other = - (com.google.bigtable.v2.Mutation.DeleteFromColumn) obj; + com.google.bigtable.v2.Mutation.AddToCell other = + (com.google.bigtable.v2.Mutation.AddToCell) 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 (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 (!unknownFields.equals(other.unknownFields)) 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; } @@ -1559,86 +1554,92 @@ public int hashCode() { 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(); + 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) + unknownFields.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 { + 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.DeleteFromColumn parseFrom( + 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.DeleteFromColumn parseFrom( + 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.DeleteFromColumn parseFrom( + 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.DeleteFromColumn parseFrom(byte[] data) + 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.DeleteFromColumn parseFrom( + 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.DeleteFromColumn parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.DeleteFromColumn parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseDelimitedFrom( + public static com.google.bigtable.v2.Mutation.AddToCell parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } - public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseDelimitedFrom( + 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.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } - public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } - public static com.google.bigtable.v2.Mutation.DeleteFromColumn parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1651,7 +1652,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.bigtable.v2.Mutation.DeleteFromColumn prototype) { + public static Builder newBuilder(com.google.bigtable.v2.Mutation.AddToCell prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -1661,67 +1662,76 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.
    +     * A Mutation which incrementally updates a cell in an `Aggregate` family.
          * 
    * - * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromColumn} + * Protobuf type {@code google.bigtable.v2.Mutation.AddToCell} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { + // @@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_DeleteFromColumn_descriptor; + .internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable + .internal_static_google_bigtable_v2_Mutation_AddToCell_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.bigtable.v2.Mutation.DeleteFromColumn.class, - com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder.class); + com.google.bigtable.v2.Mutation.AddToCell.class, + com.google.bigtable.v2.Mutation.AddToCell.Builder.class); } - // Construct using com.google.bigtable.v2.Mutation.DeleteFromColumn.newBuilder() + // Construct using com.google.bigtable.v2.Mutation.AddToCell.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetColumnQualifierFieldBuilder(); + internalGetTimestampFieldBuilder(); + internalGetInputFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; familyName_ = ""; - - columnQualifier_ = com.google.protobuf.ByteString.EMPTY; - - if (timeRangeBuilder_ == null) { - timeRange_ = null; - } else { - timeRange_ = null; - timeRangeBuilder_ = null; + 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; } @@ -1729,17 +1739,17 @@ public Builder clear() { @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor; + .internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor; } @java.lang.Override - public com.google.bigtable.v2.Mutation.DeleteFromColumn getDefaultInstanceForType() { - return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); + 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.DeleteFromColumn build() { - com.google.bigtable.v2.Mutation.DeleteFromColumn result = buildPartial(); + public com.google.bigtable.v2.Mutation.AddToCell build() { + com.google.bigtable.v2.Mutation.AddToCell result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1747,79 +1757,65 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn build() { } @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); - result.familyName_ = familyName_; - result.columnQualifier_ = columnQualifier_; - if (timeRangeBuilder_ == null) { - result.timeRange_ = timeRange_; - } else { - result.timeRange_ = timeRangeBuilder_.build(); + 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; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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.DeleteFromColumn) { - return mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromColumn) 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.DeleteFromColumn other) { - if (other == com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance()) - 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.getColumnQualifier() != com.google.protobuf.ByteString.EMPTY) { - setColumnQualifier(other.getColumnQualifier()); + if (other.hasColumnQualifier()) { + mergeColumnQualifier(other.getColumnQualifier()); } - if (other.hasTimeRange()) { - mergeTimeRange(other.getTimeRange()); + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.hasInput()) { + mergeInput(other.getInput()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1834,28 +1830,71 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Mutation.DeleteFromColumn parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.v2.Mutation.DeleteFromColumn) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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]+`
    +       * 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; @@ -1873,12 +1912,14 @@ public java.lang.String getFamilyName() { return (java.lang.String) ref; } } + /** * * *
    -       * The name of the family from which cells should be deleted.
    -       * Must match `[-_.a-zA-Z0-9]+`
    +       * 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; @@ -1896,12 +1937,14 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -       * The name of the family from which cells should be deleted.
    -       * Must match `[-_.a-zA-Z0-9]+`
    +       * 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; @@ -1913,17 +1956,19 @@ 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]+`
    +       * 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; @@ -1931,17 +1976,19 @@ public Builder setFamilyName(java.lang.String value) { * @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]+`
    +       * 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; @@ -1954,319 +2001,681 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - private com.google.protobuf.ByteString columnQualifier_ = - com.google.protobuf.ByteString.EMPTY; + 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 from which cells should be deleted.
    -       * Can be any byte string, including the empty string.
    +       * The qualifier of the column into which new data should be added. This
    +       * must be a `raw_value`.
            * 
    * - * bytes column_qualifier = 2; + * .google.bigtable.v2.Value column_qualifier = 2; * - * @return The columnQualifier. + * @return Whether the columnQualifier field is set. */ - @java.lang.Override - public com.google.protobuf.ByteString getColumnQualifier() { - return columnQualifier_; + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000002) != 0); } + /** * * *
    -       * The qualifier of the column from which cells should be deleted.
    -       * Can be any byte string, including the empty string.
    +       * The qualifier of the column into which new data should be added. This
    +       * must be a `raw_value`.
            * 
    * - * bytes column_qualifier = 2; + * .google.bigtable.v2.Value column_qualifier = 2; * - * @param value The columnQualifier to set. - * @return This builder for chaining. + * @return The columnQualifier. */ - public Builder setColumnQualifier(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public com.google.bigtable.v2.Value getColumnQualifier() { + if (columnQualifierBuilder_ == null) { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } else { + return columnQualifierBuilder_.getMessage(); } + } - columnQualifier_ = value; + /** + * + * + *
    +       * 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 from which cells should be deleted.
    -       * Can be any byte string, including the empty string.
    +       * The qualifier of the column into which new data should be added. This
    +       * must be a `raw_value`.
            * 
    * - * bytes column_qualifier = 2; + * .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; + } + + /** * - * @return This builder for chaining. + * + *
    +       * 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() { + 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; + } - columnQualifier_ = getDefaultInstance().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; + */ + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = null; + if (columnQualifierBuilder_ != null) { + columnQualifierBuilder_.dispose(); + columnQualifierBuilder_ = null; + } onChanged(); return this; } - private com.google.bigtable.v2.TimestampRange timeRange_; - private com.google.protobuf.SingleFieldBuilderV3< - 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.
    +       * The qualifier of the column into which new data should be added. This
    +       * must be a `raw_value`.
            * 
    * - * .google.bigtable.v2.TimestampRange time_range = 3; + * .google.bigtable.v2.Value column_qualifier = 2; + */ + public com.google.bigtable.v2.Value.Builder getColumnQualifierBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetColumnQualifierFieldBuilder().getBuilder(); + } + + /** * - * @return Whether the timeRange field is set. + * + *
    +       * 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 boolean hasTimeRange() { - return timeRangeBuilder_ != null || timeRange_ != null; + 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 range of timestamps within which cells should be deleted.
    +       * The qualifier of the column into which new data should be added. This
    +       * must be a `raw_value`.
            * 
    * - * .google.bigtable.v2.TimestampRange time_range = 3; + * .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_; + + /** * - * @return The timeRange. + * + *
    +       * 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 com.google.bigtable.v2.TimestampRange getTimeRange() { - if (timeRangeBuilder_ == null) { - return timeRange_ == null - ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() - : timeRange_; + 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 timeRangeBuilder_.getMessage(); + return timestampBuilder_.getMessage(); } } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - public Builder setTimeRange(com.google.bigtable.v2.TimestampRange value) { - if (timeRangeBuilder_ == null) { + public Builder setTimestamp(com.google.bigtable.v2.Value value) { + if (timestampBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - timeRange_ = value; - onChanged(); + timestamp_ = value; } else { - timeRangeBuilder_.setMessage(value); + timestampBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - public Builder setTimeRange(com.google.bigtable.v2.TimestampRange.Builder builderForValue) { - if (timeRangeBuilder_ == null) { - timeRange_ = builderForValue.build(); - onChanged(); + public Builder setTimestamp(com.google.bigtable.v2.Value.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); } else { - timeRangeBuilder_.setMessage(builderForValue.build()); + timestampBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - public Builder mergeTimeRange(com.google.bigtable.v2.TimestampRange value) { - if (timeRangeBuilder_ == null) { - if (timeRange_ != null) { - timeRange_ = - com.google.bigtable.v2.TimestampRange.newBuilder(timeRange_) - .mergeFrom(value) - .buildPartial(); + 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 { - timeRange_ = value; + timestamp_ = value; } - onChanged(); } else { - timeRangeBuilder_.mergeFrom(value); + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000004; + onChanged(); } - return this; } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - public Builder clearTimeRange() { - if (timeRangeBuilder_ == null) { - timeRange_ = null; - onChanged(); - } else { - timeRange_ = null; - timeRangeBuilder_ = null; + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000004); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; } - + onChanged(); return this; } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - public com.google.bigtable.v2.TimestampRange.Builder getTimeRangeBuilder() { - + public com.google.bigtable.v2.Value.Builder getTimestampBuilder() { + bitField0_ |= 0x00000004; onChanged(); - return getTimeRangeFieldBuilder().getBuilder(); + return internalGetTimestampFieldBuilder().getBuilder(); } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - public com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder() { - if (timeRangeBuilder_ != null) { - return timeRangeBuilder_.getMessageOrBuilder(); + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); } else { - return timeRange_ == null - ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() - : timeRange_; + return timestamp_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : timestamp_; } } + /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value timestamp = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.v2.TimestampRange, - com.google.bigtable.v2.TimestampRange.Builder, - com.google.bigtable.v2.TimestampRangeOrBuilder> - getTimeRangeFieldBuilder() { - if (timeRangeBuilder_ == null) { - timeRangeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.v2.TimestampRange, - com.google.bigtable.v2.TimestampRange.Builder, - com.google.bigtable.v2.TimestampRangeOrBuilder>( - getTimeRange(), getParentForChildren(), isClean()); - timeRange_ = null; + 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 timeRangeBuilder_; + return timestampBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + 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_; - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +       * 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); } - // @@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; - } + /** + * + * + *
    +       * 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(); + } + } - 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 { - return new DeleteFromColumn(input, extensionRegistry); + /** + * + * + *
    +       * 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(); } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + 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.bigtable.v2.Mutation.DeleteFromColumn getDefaultInstanceForType() { + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } - public interface DeleteFromFamilyOrBuilder + public interface MergeToCellOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromFamily) + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.MergeToCell) com.google.protobuf.MessageOrBuilder { /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -2274,12 +2683,14 @@ public interface DeleteFromFamilyOrBuilder * @return The familyName. */ java.lang.String getFamilyName(); + /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -2287,108 +2698,194 @@ public interface DeleteFromFamilyOrBuilder * @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 deletes all cells from the specified column family.
    +   * A Mutation which merges accumulated state into a cell in an `Aggregate`
    +   * family.
        * 
    * - * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromFamily} + * Protobuf type {@code google.bigtable.v2.Mutation.MergeToCell} */ - public static final class DeleteFromFamily extends com.google.protobuf.GeneratedMessageV3 + public static final class MergeToCell extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromFamily) - DeleteFromFamilyOrBuilder { + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.MergeToCell) + MergeToCellOrBuilder { private static final long serialVersionUID = 0L; - // Use DeleteFromFamily.newBuilder() to construct. - private DeleteFromFamily(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteFromFamily() { - familyName_ = ""; - } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteFromFamily(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "MergeToCell"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use MergeToCell.newBuilder() to construct. + private MergeToCell(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private DeleteFromFamily( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - familyName_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + private MergeToCell() { + familyName_ = ""; } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor; + .internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable + .internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.bigtable.v2.Mutation.DeleteFromFamily.class, - com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder.class); + 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; - private volatile java.lang.Object familyName_; + + @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]+`
    +     * 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; @@ -2407,12 +2904,14 @@ public java.lang.String getFamilyName() { return s; } } + /** * * *
    -     * The name of the family from which cells should be deleted.
    -     * Must match `[-_.a-zA-Z0-9]+`
    +     * 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; @@ -2432,24 +2931,196 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { } } - private byte memoizedIsInitialized = -1; + 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 final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000001) != 0); } - @java.lang.Override + /** + * + * + *
    +     * 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 (!getFamilyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, familyName_); + 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()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2458,10 +3129,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getFamilyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, familyName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, familyName_); } - size += unknownFields.getSerializedSize(); + 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; } @@ -2471,14 +3151,26 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.bigtable.v2.Mutation.DeleteFromFamily)) { + if (!(obj instanceof com.google.bigtable.v2.Mutation.MergeToCell)) { return super.equals(obj); } - com.google.bigtable.v2.Mutation.DeleteFromFamily other = - (com.google.bigtable.v2.Mutation.DeleteFromFamily) obj; + com.google.bigtable.v2.Mutation.MergeToCell other = + (com.google.bigtable.v2.Mutation.MergeToCell) obj; if (!getFamilyName().equals(other.getFamilyName())) return false; - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -2491,80 +3183,92 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + FAMILY_NAME_FIELD_NUMBER; hash = (53 * hash) + getFamilyName().hashCode(); - hash = (29 * hash) + unknownFields.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.DeleteFromFamily parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + 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.DeleteFromFamily parseFrom( + 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.DeleteFromFamily parseFrom( + 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.DeleteFromFamily parseFrom( + 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.DeleteFromFamily parseFrom(byte[] data) + 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.DeleteFromFamily parseFrom( + 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.DeleteFromFamily parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.DeleteFromFamily parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseDelimitedFrom( + public static com.google.bigtable.v2.Mutation.MergeToCell parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } - public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseDelimitedFrom( + 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.GeneratedMessageV3.parseDelimitedWithIOException( + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } - public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } - public static com.google.bigtable.v2.Mutation.DeleteFromFamily parseFrom( + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2577,7 +3281,7 @@ public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(com.google.bigtable.v2.Mutation.DeleteFromFamily prototype) { + public static Builder newBuilder(com.google.bigtable.v2.Mutation.MergeToCell prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -2587,76 +3291,95 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + 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.
    +     * A Mutation which merges accumulated state into a cell in an `Aggregate`
    +     * family.
          * 
    * - * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromFamily} + * Protobuf type {@code google.bigtable.v2.Mutation.MergeToCell} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { + // @@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_DeleteFromFamily_descriptor; + .internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable + .internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.bigtable.v2.Mutation.DeleteFromFamily.class, - com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder.class); + com.google.bigtable.v2.Mutation.MergeToCell.class, + com.google.bigtable.v2.Mutation.MergeToCell.Builder.class); } - // Construct using com.google.bigtable.v2.Mutation.DeleteFromFamily.newBuilder() + // Construct using com.google.bigtable.v2.Mutation.MergeToCell.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + 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_DeleteFromFamily_descriptor; + .internal_static_google_bigtable_v2_Mutation_MergeToCell_descriptor; } @java.lang.Override - public com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstanceForType() { - return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); + 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.DeleteFromFamily build() { - com.google.bigtable.v2.Mutation.DeleteFromFamily result = buildPartial(); + public com.google.bigtable.v2.Mutation.MergeToCell build() { + com.google.bigtable.v2.Mutation.MergeToCell result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -2664,67 +3387,65 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily build() { } @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); - result.familyName_ = familyName_; + 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; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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.DeleteFromFamily) { - return mergeFrom((com.google.bigtable.v2.Mutation.DeleteFromFamily) 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.DeleteFromFamily other) { - if (other == com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance()) - 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(); } - this.mergeUnknownFields(other.unknownFields); + 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; } @@ -2739,28 +3460,71 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Mutation.DeleteFromFamily parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.v2.Mutation.DeleteFromFamily) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + 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]+`
    +       * 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; @@ -2778,12 +3542,14 @@ public java.lang.String getFamilyName() { return (java.lang.String) ref; } } + /** * * *
    -       * The name of the family from which cells should be deleted.
    -       * Must match `[-_.a-zA-Z0-9]+`
    +       * 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; @@ -2801,12 +3567,14 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -       * The name of the family from which cells should be deleted.
    -       * Must match `[-_.a-zA-Z0-9]+`
    +       * 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; @@ -2818,17 +3586,19 @@ 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]+`
    +       * 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; @@ -2836,17 +3606,19 @@ public Builder setFamilyName(java.lang.String value) { * @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]+`
    +       * 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; @@ -2859,32 +3631,2316 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + 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_; - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +       * 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); } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.DeleteFromFamily) - } + /** + * + * + *
    +       * 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(); + } + } - // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromFamily) - private static final com.google.bigtable.v2.Mutation.DeleteFromFamily DEFAULT_INSTANCE; + /** + * + * + *
    +       * 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; + } - static { - DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.DeleteFromFamily(); + /** + * + * + *
    +       * 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() { @@ -2898,7 +5954,19 @@ public DeleteFromFamily parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteFromFamily(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -2921,6 +5989,7 @@ public interface DeleteFromRowOrBuilder extends // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromRow) com.google.protobuf.MessageOrBuilder {} + /** * * @@ -2930,65 +5999,28 @@ public interface DeleteFromRowOrBuilder * * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromRow} */ - public static final class DeleteFromRow extends com.google.protobuf.GeneratedMessageV3 + 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; - // Use DeleteFromRow.newBuilder() to construct. - private DeleteFromRow(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private DeleteFromRow() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteFromRow(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "DeleteFromRow"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use DeleteFromRow.newBuilder() to construct. + private DeleteFromRow(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private DeleteFromRow( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private DeleteFromRow() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto @@ -2996,7 +6028,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable @@ -3019,7 +6051,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3028,7 +6060,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3044,7 +6076,7 @@ public boolean equals(final java.lang.Object obj) { com.google.bigtable.v2.Mutation.DeleteFromRow other = (com.google.bigtable.v2.Mutation.DeleteFromRow) obj; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3055,7 +6087,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3097,38 +6129,38 @@ public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom( public static com.google.bigtable.v2.Mutation.DeleteFromRow parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -3151,11 +6183,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -3165,8 +6197,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromRow} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -3176,7 +6207,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable @@ -3186,17 +6217,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Mutation.DeleteFromRow.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -3233,41 +6257,6 @@ public com.google.bigtable.v2.Mutation.DeleteFromRow buildPartial() { return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.bigtable.v2.Mutation.DeleteFromRow) { @@ -3281,7 +6270,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.Mutation.DeleteFromRow other) { if (other == com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3296,30 +6285,32 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Mutation.DeleteFromRow parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.Mutation.DeleteFromRow) e.getUnfinishedMessage(); throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + } finally { + onChanged(); + } // finally + return this; } // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.DeleteFromRow) @@ -3343,7 +6334,19 @@ public DeleteFromRow parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteFromRow(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -3363,6 +6366,8 @@ public com.google.bigtable.v2.Mutation.DeleteFromRow getDefaultInstanceForType() } private int mutationCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object mutation_; public enum MutationCase @@ -3370,6 +6375,8 @@ public enum MutationCase 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), @@ -3379,6 +6386,7 @@ public enum MutationCase 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. @@ -3393,6 +6401,10 @@ 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: @@ -3416,6 +6428,7 @@ public MutationCase getMutationCase() { } public static final int SET_CELL_FIELD_NUMBER = 1; + /** * * @@ -3431,6 +6444,7 @@ public MutationCase getMutationCase() { public boolean hasSetCell() { return mutationCase_ == 1; } + /** * * @@ -3449,6 +6463,7 @@ public com.google.bigtable.v2.Mutation.SetCell getSetCell() { } return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); } + /** * * @@ -3466,7 +6481,116 @@ public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { 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; + /** * * @@ -3482,6 +6606,7 @@ public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { public boolean hasDeleteFromColumn() { return mutationCase_ == 2; } + /** * * @@ -3500,6 +6625,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn getDeleteFromColumn() { } return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); } + /** * * @@ -3518,6 +6644,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder getDeleteFromCo } public static final int DELETE_FROM_FAMILY_FIELD_NUMBER = 3; + /** * * @@ -3533,6 +6660,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder getDeleteFromCo public boolean hasDeleteFromFamily() { return mutationCase_ == 3; } + /** * * @@ -3551,6 +6679,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily getDeleteFromFamily() { } return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); } + /** * * @@ -3569,6 +6698,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder getDeleteFromFa } public static final int DELETE_FROM_ROW_FIELD_NUMBER = 4; + /** * * @@ -3584,6 +6714,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder getDeleteFromFa public boolean hasDeleteFromRow() { return mutationCase_ == 4; } + /** * * @@ -3602,6 +6733,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromRow getDeleteFromRow() { } return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); } + /** * * @@ -3645,7 +6777,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (mutationCase_ == 4) { output.writeMessage(4, (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_); } - unknownFields.writeTo(output); + 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 @@ -3674,7 +6812,17 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 4, (com.google.bigtable.v2.Mutation.DeleteFromRow) mutation_); } - size += unknownFields.getSerializedSize(); + 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; } @@ -3694,6 +6842,12 @@ public boolean equals(final java.lang.Object obj) { 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; @@ -3706,7 +6860,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -3722,6 +6876,14 @@ public int hashCode() { 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(); @@ -3737,7 +6899,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3778,38 +6940,38 @@ public static com.google.bigtable.v2.Mutation parseFrom( public static com.google.bigtable.v2.Mutation parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -3832,10 +6994,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -3845,7 +7008,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.Mutation} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -3855,7 +7018,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_fieldAccessorTable @@ -3864,299 +7027,787 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Mutation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + @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_); } - @java.lang.Override - public Builder clear() { - super.clear(); + public Builder clearMutation() { mutationCase_ = 0; mutation_ = null; + onChanged(); 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; - } + 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 com.google.bigtable.v2.Mutation getDefaultInstanceForType() { - return com.google.bigtable.v2.Mutation.getDefaultInstance(); + 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 build() { - com.google.bigtable.v2.Mutation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + 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(); } - 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 (mutationCase_ == 1) { - if (setCellBuilder_ == null) { - result.mutation_ = mutation_; - } else { - result.mutation_ = setCellBuilder_.build(); + /** + * + * + *
    +     * 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()); } - if (mutationCase_ == 2) { - if (deleteFromColumnBuilder_ == null) { - result.mutation_ = mutation_; + 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 { - result.mutation_ = deleteFromColumnBuilder_.build(); + mutation_ = value; } - } - if (mutationCase_ == 3) { - if (deleteFromFamilyBuilder_ == null) { - result.mutation_ = mutation_; + onChanged(); + } else { + if (mutationCase_ == 1) { + setCellBuilder_.mergeFrom(value); } else { - result.mutation_ = deleteFromFamilyBuilder_.build(); + setCellBuilder_.setMessage(value); } } - if (mutationCase_ == 4) { - if (deleteFromRowBuilder_ == null) { - result.mutation_ = mutation_; - } else { - result.mutation_ = deleteFromRowBuilder_.build(); + 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(); } - result.mutationCase_ = mutationCase_; - onBuilt(); - return result; + return this; } - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
    +     * 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 Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + 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(); + } } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + /** + * + * + *
    +     * 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 Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + 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 Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
    +     * 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; } - @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); + /** + * + * + *
    +     * 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 { - super.mergeFrom(other); - return this; + if (mutationCase_ == 5) { + addToCellBuilder_.mergeFrom(value); + } else { + addToCellBuilder_.setMessage(value); + } } + mutationCase_ = 5; + 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 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; - } + /** + * + * + *
    +     * 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(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); return this; } - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * + * + *
    +     * 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 Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.v2.Mutation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.bigtable.v2.Mutation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + 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(); } - 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; + /** + * + * + *
    +     * 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 this; + return addToCellBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.v2.Mutation.SetCell, - com.google.bigtable.v2.Mutation.SetCell.Builder, - com.google.bigtable.v2.Mutation.SetCellOrBuilder> - setCellBuilder_; + 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_; + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; * - * @return Whether the setCell field is set. + * @return Whether the mergeToCell field is set. */ @java.lang.Override - public boolean hasSetCell() { - return mutationCase_ == 1; + public boolean hasMergeToCell() { + return mutationCase_ == 6; } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; * - * @return The setCell. + * @return The mergeToCell. */ @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_; + 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.SetCell.getDefaultInstance(); + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); } else { - if (mutationCase_ == 1) { - return setCellBuilder_.getMessage(); + if (mutationCase_ == 6) { + return mergeToCellBuilder_.getMessage(); } - return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); } } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ - public Builder setSetCell(com.google.bigtable.v2.Mutation.SetCell value) { - if (setCellBuilder_ == null) { + public Builder setMergeToCell(com.google.bigtable.v2.Mutation.MergeToCell value) { + if (mergeToCellBuilder_ == null) { if (value == null) { throw new NullPointerException(); } mutation_ = value; onChanged(); } else { - setCellBuilder_.setMessage(value); + mergeToCellBuilder_.setMessage(value); } - mutationCase_ = 1; + mutationCase_ = 6; return this; } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ - public Builder setSetCell(com.google.bigtable.v2.Mutation.SetCell.Builder builderForValue) { - if (setCellBuilder_ == null) { + public Builder setMergeToCell( + com.google.bigtable.v2.Mutation.MergeToCell.Builder builderForValue) { + if (mergeToCellBuilder_ == null) { mutation_ = builderForValue.build(); onChanged(); } else { - setCellBuilder_.setMessage(builderForValue.build()); + mergeToCellBuilder_.setMessage(builderForValue.build()); } - mutationCase_ = 1; + mutationCase_ = 6; return this; } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ - public Builder mergeSetCell(com.google.bigtable.v2.Mutation.SetCell value) { - if (setCellBuilder_ == null) { - if (mutationCase_ == 1 - && mutation_ != com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance()) { + 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.SetCell.newBuilder( - (com.google.bigtable.v2.Mutation.SetCell) mutation_) + com.google.bigtable.v2.Mutation.MergeToCell.newBuilder( + (com.google.bigtable.v2.Mutation.MergeToCell) mutation_) .mergeFrom(value) .buildPartial(); } else { @@ -4164,110 +7815,115 @@ public Builder mergeSetCell(com.google.bigtable.v2.Mutation.SetCell value) { } onChanged(); } else { - if (mutationCase_ == 1) { - setCellBuilder_.mergeFrom(value); + if (mutationCase_ == 6) { + mergeToCellBuilder_.mergeFrom(value); + } else { + mergeToCellBuilder_.setMessage(value); } - setCellBuilder_.setMessage(value); } - mutationCase_ = 1; + mutationCase_ = 6; return this; } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ - public Builder clearSetCell() { - if (setCellBuilder_ == null) { - if (mutationCase_ == 1) { + public Builder clearMergeToCell() { + if (mergeToCellBuilder_ == null) { + if (mutationCase_ == 6) { mutationCase_ = 0; mutation_ = null; onChanged(); } } else { - if (mutationCase_ == 1) { + if (mutationCase_ == 6) { mutationCase_ = 0; mutation_ = null; } - setCellBuilder_.clear(); + mergeToCellBuilder_.clear(); } return this; } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ - public com.google.bigtable.v2.Mutation.SetCell.Builder getSetCellBuilder() { - return getSetCellFieldBuilder().getBuilder(); + public com.google.bigtable.v2.Mutation.MergeToCell.Builder getMergeToCellBuilder() { + return internalGetMergeToCellFieldBuilder().getBuilder(); } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ @java.lang.Override - public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { - if ((mutationCase_ == 1) && (setCellBuilder_ != null)) { - return setCellBuilder_.getMessageOrBuilder(); + public com.google.bigtable.v2.Mutation.MergeToCellOrBuilder getMergeToCellOrBuilder() { + if ((mutationCase_ == 6) && (mergeToCellBuilder_ != null)) { + return mergeToCellBuilder_.getMessageOrBuilder(); } else { - if (mutationCase_ == 1) { - return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + if (mutationCase_ == 6) { + return (com.google.bigtable.v2.Mutation.MergeToCell) mutation_; } - return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); } } + /** * * *
    -     * Set a cell's value.
    +     * Merges accumulated state to an `Aggregate` cell.
          * 
    * - * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.bigtable.v2.Mutation.SetCell, - com.google.bigtable.v2.Mutation.SetCell.Builder, - com.google.bigtable.v2.Mutation.SetCellOrBuilder> - getSetCellFieldBuilder() { - if (setCellBuilder_ == null) { - if (!(mutationCase_ == 1)) { - mutation_ = com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + 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(); } - setCellBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - 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_, + 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_ = 1; + mutationCase_ = 6; onChanged(); - ; - return setCellBuilder_; + return mergeToCellBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -4283,6 +7939,7 @@ public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { public boolean hasDeleteFromColumn() { return mutationCase_ == 2; } + /** * * @@ -4308,6 +7965,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn getDeleteFromColumn() { return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); } } + /** * * @@ -4330,6 +7988,7 @@ public Builder setDeleteFromColumn(com.google.bigtable.v2.Mutation.DeleteFromCol mutationCase_ = 2; return this; } + /** * * @@ -4350,6 +8009,7 @@ public Builder setDeleteFromColumn( mutationCase_ = 2; return this; } + /** * * @@ -4375,12 +8035,14 @@ public Builder mergeDeleteFromColumn(com.google.bigtable.v2.Mutation.DeleteFromC } else { if (mutationCase_ == 2) { deleteFromColumnBuilder_.mergeFrom(value); + } else { + deleteFromColumnBuilder_.setMessage(value); } - deleteFromColumnBuilder_.setMessage(value); } mutationCase_ = 2; return this; } + /** * * @@ -4406,6 +8068,7 @@ public Builder clearDeleteFromColumn() { } return this; } + /** * * @@ -4416,8 +8079,9 @@ public Builder clearDeleteFromColumn() { * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; */ public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromColumnBuilder() { - return getDeleteFromColumnFieldBuilder().getBuilder(); + return internalGetDeleteFromColumnFieldBuilder().getBuilder(); } + /** * * @@ -4439,6 +8103,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromCol return com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); } } + /** * * @@ -4448,17 +8113,17 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromCol * * .google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Mutation.DeleteFromColumn, com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder, com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder> - getDeleteFromColumnFieldBuilder() { + internalGetDeleteFromColumnFieldBuilder() { if (deleteFromColumnBuilder_ == null) { if (!(mutationCase_ == 2)) { mutation_ = com.google.bigtable.v2.Mutation.DeleteFromColumn.getDefaultInstance(); } deleteFromColumnBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Mutation.DeleteFromColumn, com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder, com.google.bigtable.v2.Mutation.DeleteFromColumnOrBuilder>( @@ -4469,15 +8134,15 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromCol } mutationCase_ = 2; onChanged(); - ; return deleteFromColumnBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -4493,6 +8158,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromCol public boolean hasDeleteFromFamily() { return mutationCase_ == 3; } + /** * * @@ -4518,6 +8184,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily getDeleteFromFamily() { return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); } } + /** * * @@ -4540,6 +8207,7 @@ public Builder setDeleteFromFamily(com.google.bigtable.v2.Mutation.DeleteFromFam mutationCase_ = 3; return this; } + /** * * @@ -4560,6 +8228,7 @@ public Builder setDeleteFromFamily( mutationCase_ = 3; return this; } + /** * * @@ -4585,12 +8254,14 @@ public Builder mergeDeleteFromFamily(com.google.bigtable.v2.Mutation.DeleteFromF } else { if (mutationCase_ == 3) { deleteFromFamilyBuilder_.mergeFrom(value); + } else { + deleteFromFamilyBuilder_.setMessage(value); } - deleteFromFamilyBuilder_.setMessage(value); } mutationCase_ = 3; return this; } + /** * * @@ -4616,6 +8287,7 @@ public Builder clearDeleteFromFamily() { } return this; } + /** * * @@ -4626,8 +8298,9 @@ public Builder clearDeleteFromFamily() { * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; */ public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFamilyBuilder() { - return getDeleteFromFamilyFieldBuilder().getBuilder(); + return internalGetDeleteFromFamilyFieldBuilder().getBuilder(); } + /** * * @@ -4649,6 +8322,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFam return com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); } } + /** * * @@ -4658,17 +8332,17 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFam * * .google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Mutation.DeleteFromFamily, com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder, com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder> - getDeleteFromFamilyFieldBuilder() { + internalGetDeleteFromFamilyFieldBuilder() { if (deleteFromFamilyBuilder_ == null) { if (!(mutationCase_ == 3)) { mutation_ = com.google.bigtable.v2.Mutation.DeleteFromFamily.getDefaultInstance(); } deleteFromFamilyBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Mutation.DeleteFromFamily, com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder, com.google.bigtable.v2.Mutation.DeleteFromFamilyOrBuilder>( @@ -4679,15 +8353,15 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFam } mutationCase_ = 3; onChanged(); - ; return deleteFromFamilyBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -4703,6 +8377,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFam public boolean hasDeleteFromRow() { return mutationCase_ == 4; } + /** * * @@ -4728,6 +8403,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromRow getDeleteFromRow() { return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); } } + /** * * @@ -4750,6 +8426,7 @@ public Builder setDeleteFromRow(com.google.bigtable.v2.Mutation.DeleteFromRow va mutationCase_ = 4; return this; } + /** * * @@ -4770,6 +8447,7 @@ public Builder setDeleteFromRow( mutationCase_ = 4; return this; } + /** * * @@ -4795,12 +8473,14 @@ public Builder mergeDeleteFromRow(com.google.bigtable.v2.Mutation.DeleteFromRow } else { if (mutationCase_ == 4) { deleteFromRowBuilder_.mergeFrom(value); + } else { + deleteFromRowBuilder_.setMessage(value); } - deleteFromRowBuilder_.setMessage(value); } mutationCase_ = 4; return this; } + /** * * @@ -4826,6 +8506,7 @@ public Builder clearDeleteFromRow() { } return this; } + /** * * @@ -4836,8 +8517,9 @@ public Builder clearDeleteFromRow() { * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; */ public com.google.bigtable.v2.Mutation.DeleteFromRow.Builder getDeleteFromRowBuilder() { - return getDeleteFromRowFieldBuilder().getBuilder(); + return internalGetDeleteFromRowFieldBuilder().getBuilder(); } + /** * * @@ -4858,6 +8540,7 @@ public com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOr return com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); } } + /** * * @@ -4867,17 +8550,17 @@ public com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOr * * .google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Mutation.DeleteFromRow, com.google.bigtable.v2.Mutation.DeleteFromRow.Builder, com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder> - getDeleteFromRowFieldBuilder() { + internalGetDeleteFromRowFieldBuilder() { if (deleteFromRowBuilder_ == null) { if (!(mutationCase_ == 4)) { mutation_ = com.google.bigtable.v2.Mutation.DeleteFromRow.getDefaultInstance(); } deleteFromRowBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Mutation.DeleteFromRow, com.google.bigtable.v2.Mutation.DeleteFromRow.Builder, com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder>( @@ -4888,21 +8571,9 @@ public com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOr } mutationCase_ = 4; onChanged(); - ; return deleteFromRowBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation) } @@ -4924,7 +8595,18 @@ public Mutation parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Mutation(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java index 61a6bb4cce..0463a62ec1 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutationOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface MutationOrBuilder * @return Whether the setCell field is set. */ boolean hasSetCell(); + /** * * @@ -47,6 +51,7 @@ public interface MutationOrBuilder * @return The setCell. */ com.google.bigtable.v2.Mutation.SetCell getSetCell(); + /** * * @@ -58,6 +63,80 @@ public interface MutationOrBuilder */ 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(); + /** * * @@ -70,6 +149,7 @@ public interface MutationOrBuilder * @return Whether the deleteFromColumn field is set. */ boolean hasDeleteFromColumn(); + /** * * @@ -82,6 +162,7 @@ public interface MutationOrBuilder * @return The deleteFromColumn. */ com.google.bigtable.v2.Mutation.DeleteFromColumn getDeleteFromColumn(); + /** * * @@ -105,6 +186,7 @@ public interface MutationOrBuilder * @return Whether the deleteFromFamily field is set. */ boolean hasDeleteFromFamily(); + /** * * @@ -117,6 +199,7 @@ public interface MutationOrBuilder * @return The deleteFromFamily. */ com.google.bigtable.v2.Mutation.DeleteFromFamily getDeleteFromFamily(); + /** * * @@ -140,6 +223,7 @@ public interface MutationOrBuilder * @return Whether the deleteFromRow field is set. */ boolean hasDeleteFromRow(); + /** * * @@ -152,6 +236,7 @@ public interface MutationOrBuilder * @return The deleteFromRow. */ com.google.bigtable.v2.Mutation.DeleteFromRow getDeleteFromRow(); + /** * * @@ -163,5 +248,5 @@ public interface MutationOrBuilder */ com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOrBuilder(); - public com.google.bigtable.v2.Mutation.MutationCase getMutationCase(); + com.google.bigtable.v2.Mutation.MutationCase getMutationCase(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSet.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSet.java new file mode 100644 index 0000000000..ca2dd85f01 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSetOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSetOrBuilder.java new file mode 100644 index 0000000000..b0f0454d61 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java new file mode 100644 index 0000000000..55fdd628c2 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfo.java @@ -0,0 +1,1399 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language 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() { + 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_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; + * + * @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 Cloud 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; + } + } + + 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 the zone 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 the zone 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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!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_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; + 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.applicationFrontendZone_ = applicationFrontendZone_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.applicationFrontendSubzone_ = applicationFrontendSubzone_; + } + if (((from_bitField0_ & 0x00000010) != 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.getApplicationFrontendZone().isEmpty()) { + applicationFrontendZone_ = other.applicationFrontendZone_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getApplicationFrontendSubzone().isEmpty()) { + applicationFrontendSubzone_ = other.applicationFrontendSubzone_; + bitField0_ |= 0x00000008; + 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_ |= 0x00000004; + break; + } // case 26 + case 34: + { + applicationFrontendSubzone_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + transportType_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an 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 Cloud 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 Cloud 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 Cloud 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 Cloud 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 Cloud 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; + } + + private java.lang.Object applicationFrontendSubzone_ = ""; + + /** + * + * + *
    +     * The subzone of the application frontend that served this request, e.g. an
    +     * identifier for where within the zone 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 the zone 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 the zone 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_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
    +     * The subzone of the application frontend that served this request, e.g. an
    +     * identifier for where within the zone the application frontend is.
    +     * 
    + * + * string application_frontend_subzone = 4; + * + * @return This builder for chaining. + */ + public Builder clearApplicationFrontendSubzone() { + applicationFrontendSubzone_ = getDefaultInstance().getApplicationFrontendSubzone(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
    +     * The subzone of the application frontend that served this request, e.g. an
    +     * identifier for where within the zone 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_ |= 0x00000008; + 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_ |= 0x00000010; + 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_ |= 0x00000010; + transportType_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .google.bigtable.v2.PeerInfo.TransportType transport_type = 5; + * + * @return This builder for chaining. + */ + public Builder clearTransportType() { + bitField0_ = (bitField0_ & ~0x00000010); + 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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.java new file mode 100644 index 0000000000..b5d5121c68 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoOrBuilder.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/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 zone of the application frontend that served this request.
    +   * 
    + * + * string application_frontend_zone = 3; + * + * @return The applicationFrontendZone. + */ + java.lang.String getApplicationFrontendZone(); + + /** + * + * + *
    +   * The Cloud zone of the application frontend that served this request.
    +   * 
    + * + * string application_frontend_zone = 3; + * + * @return The bytes for applicationFrontendZone. + */ + com.google.protobuf.ByteString getApplicationFrontendZoneBytes(); + + /** + * + * + *
    +   * The subzone of the application frontend that served this request, e.g. an
    +   * identifier for where within the zone 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 the zone 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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.java new file mode 100644 index 0000000000..79838d76c8 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PeerInfoProto.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/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\"\372\003\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\031application_frontend_zone\030" + + "\003 \001(\t\022$\n\034application_frontend_subzone\030\004 " + + "\001(\t\022B\n\016transport_type\030\005 \001(\0162*.google.big" + + "table.v2.PeerInfo.TransportType\"\243\002\n\rTran" + + "sportType\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_DIRE" + + "CT_ACCESS\020\003\022\"\n\036TRANSPORT_TYPE_SESSION_UN" + + "KNOWN\020\004\022#\n\037TRANSPORT_TYPE_SESSION_EXTERN" + + "AL\020\005\022%\n!TRANSPORT_TYPE_SESSION_CLOUD_PAT" + + "H\020\006\022(\n$TRANSPORT_TYPE_SESSION_DIRECT_ACC" + + "ESS\020\007B\267\001\n\026com.google.bigtable.v2B\rPeerIn" + + "foProtoP\001Z8cloud.google.com/go/bigtable/" + + "apiv2/bigtablepb;bigtablepb\252\002\030Google.Clo" + + "ud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\V" + + "2\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", + "ApplicationFrontendZone", + "ApplicationFrontendSubzone", + "TransportType", + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java new file mode 100644 index 0000000000..a215684dfa --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java new file mode 100644 index 0000000000..4fb5debf80 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java new file mode 100644 index 0000000000..0b086c3d74 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.java new file mode 100644 index 0000000000..ae5f4c612b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequest.java new file mode 100644 index 0000000000..0f81145c0e --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryRequestOrBuilder.java new file mode 100644 index 0000000000..02cacd393d --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponse.java new file mode 100644 index 0000000000..4f4fc8fa5c --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PrepareQueryResponseOrBuilder.java new file mode 100644 index 0000000000..95fd497e2a --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java new file mode 100644 index 0000000000..4328352d16 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormatOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormatOrBuilder.java new file mode 100644 index 0000000000..f3e1dd600f --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRows.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRows.java new file mode 100644 index 0000000000..7d06b910a4 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatch.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatch.java new file mode 100644 index 0000000000..4f2b966975 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatchOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatchOrBuilder.java new file mode 100644 index 0000000000..58abe56591 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsOrBuilder.java new file mode 100644 index 0000000000..928f4b54ed --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchema.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchema.java new file mode 100644 index 0000000000..e8efbf52a3 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchemaOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchemaOrBuilder.java new file mode 100644 index 0000000000..1b29f94d7c --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfo.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfo.java new file mode 100644 index 0000000000..eb4d942003 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfoOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfoOrBuilder.java new file mode 100644 index 0000000000..f6798ac14a --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequest.java new file mode 100644 index 0000000000..5ce915028b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequestOrBuilder.java new file mode 100644 index 0000000000..6f675afcd7 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponse.java new file mode 100644 index 0000000000..b6e30ba04b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponseOrBuilder.java new file mode 100644 index 0000000000..f38885c8ac --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStats.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStats.java new file mode 100644 index 0000000000..c7120cf557 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStatsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStatsOrBuilder.java new file mode 100644 index 0000000000..1c84e56f7b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java index 27745ee9f9..3976466576 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,112 +29,43 @@ * * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowRequest} */ -public final class ReadModifyWriteRowRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + 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(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadModifyWriteRowRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ReadModifyWriteRowRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; - break; - } - case 18: - { - rowKey_ = input.readBytes(); - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - rules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - rules_.add( - input.readMessage( - com.google.bigtable.v2.ReadModifyWriteRule.parser(), extensionRegistry)); - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - - appProfileId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - rules_ = java.util.Collections.unmodifiableList(rules_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable @@ -142,19 +75,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int TABLE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object tableName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + /** * * *
    -   * Required. The unique name of the table to which the read/modify/write rules should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -171,18 +108,20 @@ public java.lang.String getTableName() { return s; } } + /** * * *
    -   * Required. The unique name of the table to which the read/modify/write rules should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -200,8 +139,76 @@ public com.google.protobuf.ByteString getTableNameBytes() { } } + 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; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + /** * * @@ -226,6 +233,7 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * @@ -252,12 +260,14 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { } public static final int ROW_KEY_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString rowKey_; + 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.
    +   * 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]; @@ -270,14 +280,18 @@ public com.google.protobuf.ByteString getRowKey() { } 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.
    +   * 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.
        * 
    * * @@ -288,13 +302,15 @@ public com.google.protobuf.ByteString getRowKey() { 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.
    +   * 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.
        * 
    * * @@ -306,13 +322,15 @@ public java.util.List getRulesList() 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.
    +   * 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.
        * 
    * * @@ -323,13 +341,15 @@ public java.util.List getRulesList() 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.
    +   * 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.
        * 
    * * @@ -340,13 +360,15 @@ public int getRulesCount() { 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.
    +   * 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.
        * 
    * * @@ -372,8 +394,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, tableName_); } if (!rowKey_.isEmpty()) { output.writeBytes(2, rowKey_); @@ -381,10 +403,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < rules_.size(); i++) { output.writeMessage(3, rules_.get(i)); } - if (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, appProfileId_); + 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_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -393,8 +418,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + 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_); @@ -402,10 +427,13 @@ public int getSerializedSize() { for (int i = 0; i < rules_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, rules_.get(i)); } - if (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(6, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -422,10 +450,11 @@ public boolean equals(final java.lang.Object obj) { (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 (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -438,6 +467,8 @@ public int hashCode() { 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; @@ -446,7 +477,7 @@ public int hashCode() { hash = (37 * hash) + RULES_FIELD_NUMBER; hash = (53 * hash) + getRulesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -488,38 +519,38 @@ public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( public static com.google.bigtable.v2.ReadModifyWriteRowRequest parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -542,10 +573,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -555,7 +587,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -565,7 +597,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable @@ -575,36 +607,27 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.ReadModifyWriteRowRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getRulesFieldBuilder(); - } } @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(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + rules_ = null; rulesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000010); return this; } @@ -632,54 +655,41 @@ public com.google.bigtable.v2.ReadModifyWriteRowRequest build() { public com.google.bigtable.v2.ReadModifyWriteRowRequest buildPartial() { com.google.bigtable.v2.ReadModifyWriteRowRequest result = new com.google.bigtable.v2.ReadModifyWriteRowRequest(this); - int from_bitField0_ = bitField0_; - result.tableName_ = tableName_; - result.appProfileId_ = appProfileId_; - result.rowKey_ = rowKey_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.bigtable.v2.ReadModifyWriteRowRequest result) { if (rulesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000010) != 0)) { rules_ = java.util.Collections.unmodifiableList(rules_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } result.rules_ = rules_; } else { result.rules_ = rulesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -697,20 +707,27 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowRequest other) 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() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getRowKey().isEmpty()) { setRowKey(other.getRowKey()); } if (rulesBuilder_ == null) { if (!other.rules_.isEmpty()) { if (rules_.isEmpty()) { rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureRulesIsMutable(); rules_.addAll(other.rules_); @@ -723,17 +740,17 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowRequest other) rulesBuilder_.dispose(); rulesBuilder_ = null; rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); rulesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRulesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRulesFieldBuilder() : null; } else { rulesBuilder_.addAllMessages(other.rules_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -748,35 +765,88 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ReadModifyWriteRowRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.ReadModifyWriteRowRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private java.lang.Object tableName_ = ""; + /** * * *
    -     * Required. The unique name of the table to which the read/modify/write rules should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -792,18 +862,20 @@ public java.lang.String getTableName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the read/modify/write rules should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -819,18 +891,20 @@ public com.google.protobuf.ByteString getTableNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the table to which the read/modify/write rules should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The tableName to set. @@ -840,45 +914,49 @@ 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 to which the read/modify/write rules should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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; } + /** * * *
    -     * Required. The unique name of the table to which the read/modify/write rules should be
    -     * applied.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The bytes for tableName to set. @@ -889,13 +967,155 @@ public Builder setTableNameBytes(com.google.protobuf.ByteString value) { 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_ = ""; + /** * * @@ -919,6 +1139,7 @@ public java.lang.String getAppProfileId() { return (java.lang.String) ref; } } + /** * * @@ -942,6 +1163,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -959,11 +1181,12 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * @@ -977,11 +1200,12 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * @@ -1000,18 +1224,20 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { 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.
    +     * 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]; @@ -1022,11 +1248,13 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getRowKey() { return rowKey_; } + /** * * *
    -     * Required. The key of the row to which the read/modify/write rules should be applied.
    +     * 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]; @@ -1038,16 +1266,18 @@ 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.
    +     * 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]; @@ -1055,7 +1285,7 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearRowKey() { - + bitField0_ = (bitField0_ & ~0x00000008); rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; @@ -1065,13 +1295,13 @@ public Builder clearRowKey() { java.util.Collections.emptyList(); private void ensureRulesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000010) != 0)) { rules_ = new java.util.ArrayList(rules_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000010; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.ReadModifyWriteRule, com.google.bigtable.v2.ReadModifyWriteRule.Builder, com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder> @@ -1081,9 +1311,10 @@ private void ensureRulesIsMutable() { * * *
    -     * 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.
    +     * 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.
          * 
    * * @@ -1097,13 +1328,15 @@ public java.util.List getRulesList() 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.
    +     * 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.
          * 
    * * @@ -1117,13 +1350,15 @@ public int getRulesCount() { 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.
    +     * 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.
          * 
    * * @@ -1137,13 +1372,15 @@ public com.google.bigtable.v2.ReadModifyWriteRule getRules(int index) { 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.
    +     * 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.
          * 
    * * @@ -1163,13 +1400,15 @@ public Builder setRules(int index, com.google.bigtable.v2.ReadModifyWriteRule va } 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.
    +     * 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.
          * 
    * * @@ -1187,13 +1426,15 @@ public Builder setRules( } 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.
    +     * 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.
          * 
    * * @@ -1213,13 +1454,15 @@ public Builder addRules(com.google.bigtable.v2.ReadModifyWriteRule 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.
    +     * 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.
          * 
    * * @@ -1239,13 +1482,15 @@ public Builder addRules(int index, com.google.bigtable.v2.ReadModifyWriteRule va } 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.
    +     * 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.
          * 
    * * @@ -1262,13 +1507,15 @@ public Builder addRules(com.google.bigtable.v2.ReadModifyWriteRule.Builder 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.
    +     * 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.
          * 
    * * @@ -1286,13 +1533,15 @@ public Builder addRules( } 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.
    +     * 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.
          * 
    * * @@ -1310,13 +1559,15 @@ public Builder addAllRules( } 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.
    +     * 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.
          * 
    * * @@ -1326,20 +1577,22 @@ public Builder addAllRules( public Builder clearRules() { if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + 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.
    +     * 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.
          * 
    * * @@ -1356,13 +1609,15 @@ public Builder removeRules(int 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.
    +     * 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.
          * 
    * * @@ -1370,15 +1625,17 @@ public Builder removeRules(int index) { * */ public com.google.bigtable.v2.ReadModifyWriteRule.Builder getRulesBuilder(int index) { - return getRulesFieldBuilder().getBuilder(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.
    +     * 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.
          * 
    * * @@ -1392,13 +1649,15 @@ public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int 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.
    +     * 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.
          * 
    * * @@ -1413,13 +1672,15 @@ public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int 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.
    +     * 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.
          * 
    * * @@ -1427,16 +1688,18 @@ public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int * */ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder() { - return getRulesFieldBuilder() + 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.
    +     * 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.
          * 
    * * @@ -1444,16 +1707,18 @@ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder() { * */ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder(int index) { - return getRulesFieldBuilder() + 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.
    +     * 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.
          * 
    * * @@ -1462,37 +1727,26 @@ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder(int in */ public java.util.List getRulesBuilderList() { - return getRulesFieldBuilder().getBuilderList(); + return internalGetRulesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.ReadModifyWriteRule, com.google.bigtable.v2.ReadModifyWriteRule.Builder, com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder> - getRulesFieldBuilder() { + internalGetRulesFieldBuilder() { if (rulesBuilder_ == null) { rulesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.ReadModifyWriteRule, com.google.bigtable.v2.ReadModifyWriteRule.Builder, com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder>( - rules_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rules_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); rules_ = null; } return rulesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadModifyWriteRowRequest) } @@ -1514,7 +1768,18 @@ public ReadModifyWriteRowRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadModifyWriteRowRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java index e8a39483e1..fdda803980 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,37 +30,78 @@ public interface ReadModifyWriteRowRequestOrBuilder * * *
    -   * Required. The unique name of the table to which the read/modify/write rules should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. */ java.lang.String getTableName(); + /** * * *
    -   * Required. The unique name of the table to which the read/modify/write rules should be
    -   * applied.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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(); + /** * * @@ -71,6 +115,7 @@ public interface ReadModifyWriteRowRequestOrBuilder * @return The appProfileId. */ java.lang.String getAppProfileId(); + /** * * @@ -89,7 +134,8 @@ public interface ReadModifyWriteRowRequestOrBuilder * * *
    -   * Required. The key of the row to which the read/modify/write rules should be applied.
    +   * 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]; @@ -102,9 +148,10 @@ public interface ReadModifyWriteRowRequestOrBuilder * * *
    -   * 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.
    +   * 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.
        * 
    * * @@ -112,13 +159,15 @@ public interface ReadModifyWriteRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -126,13 +175,15 @@ public interface ReadModifyWriteRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -140,13 +191,15 @@ public interface ReadModifyWriteRowRequestOrBuilder * */ 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.
    +   * 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.
        * 
    * * @@ -155,13 +208,15 @@ public interface ReadModifyWriteRowRequestOrBuilder */ 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.
    +   * 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.
        * 
    * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java index dd779712c5..e9bb1ff2ac 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,79 +29,29 @@ * * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowResponse} */ -public final class ReadModifyWriteRowResponse extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use ReadModifyWriteRowResponse.newBuilder() to construct. - private ReadModifyWriteRowResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ReadModifyWriteRowResponse() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadModifyWriteRowResponse(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ReadModifyWriteRowResponse"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use ReadModifyWriteRowResponse.newBuilder() to construct. + private ReadModifyWriteRowResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private ReadModifyWriteRowResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.v2.Row.Builder subBuilder = null; - if (row_ != null) { - subBuilder = row_.toBuilder(); - } - row_ = input.readMessage(com.google.bigtable.v2.Row.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(row_); - row_ = subBuilder.buildPartial(); - } - - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private ReadModifyWriteRowResponse() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto @@ -107,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable @@ -116,8 +68,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; + /** * * @@ -131,8 +85,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasRow() { - return row_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -148,6 +103,7 @@ public boolean hasRow() { public com.google.bigtable.v2.Row getRow() { return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; } + /** * * @@ -159,7 +115,7 @@ public com.google.bigtable.v2.Row getRow() { */ @java.lang.Override public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { - return getRow(); + return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; } private byte memoizedIsInitialized = -1; @@ -176,10 +132,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (row_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getRow()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -188,10 +144,10 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (row_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRow()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -211,7 +167,7 @@ public boolean equals(final java.lang.Object obj) { if (hasRow()) { if (!getRow().equals(other.getRow())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -226,7 +182,7 @@ public int hashCode() { hash = (37 * hash) + ROW_FIELD_NUMBER; hash = (53 * hash) + getRow().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -268,38 +224,38 @@ public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( public static com.google.bigtable.v2.ReadModifyWriteRowResponse parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -322,10 +278,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -335,7 +292,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRowResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -345,7 +302,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable @@ -359,22 +316,24 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (rowBuilder_ == null) { - row_ = null; - } else { - row_ = null; + bitField0_ = 0; + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); rowBuilder_ = null; } return this; @@ -404,46 +363,21 @@ public com.google.bigtable.v2.ReadModifyWriteRowResponse build() { public com.google.bigtable.v2.ReadModifyWriteRowResponse buildPartial() { com.google.bigtable.v2.ReadModifyWriteRowResponse result = new com.google.bigtable.v2.ReadModifyWriteRowResponse(this); - if (rowBuilder_ == null) { - result.row_ = row_; - } else { - result.row_ = rowBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -462,7 +396,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowResponse other if (other.hasRow()) { mergeRow(other.getRow()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -477,27 +411,49 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ReadModifyWriteRowResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.v2.ReadModifyWriteRowResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.v2.Row row_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Row, com.google.bigtable.v2.Row.Builder, com.google.bigtable.v2.RowOrBuilder> rowBuilder_; + /** * * @@ -510,8 +466,9 @@ public Builder mergeFrom( * @return Whether the row field is set. */ public boolean hasRow() { - return rowBuilder_ != null || row_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -530,6 +487,7 @@ public com.google.bigtable.v2.Row getRow() { return rowBuilder_.getMessage(); } } + /** * * @@ -545,13 +503,14 @@ public Builder setRow(com.google.bigtable.v2.Row value) { throw new NullPointerException(); } row_ = value; - onChanged(); } else { rowBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -564,13 +523,14 @@ public Builder setRow(com.google.bigtable.v2.Row value) { public Builder setRow(com.google.bigtable.v2.Row.Builder builderForValue) { if (rowBuilder_ == null) { row_ = builderForValue.build(); - onChanged(); } else { rowBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } + /** * * @@ -582,18 +542,23 @@ public Builder setRow(com.google.bigtable.v2.Row.Builder builderForValue) { */ public Builder mergeRow(com.google.bigtable.v2.Row value) { if (rowBuilder_ == null) { - if (row_ != null) { - row_ = com.google.bigtable.v2.Row.newBuilder(row_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && row_ != null + && row_ != com.google.bigtable.v2.Row.getDefaultInstance()) { + getRowBuilder().mergeFrom(value); } else { row_ = value; } - onChanged(); } else { rowBuilder_.mergeFrom(value); } - + if (row_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } + /** * * @@ -604,16 +569,16 @@ public Builder mergeRow(com.google.bigtable.v2.Row value) { * .google.bigtable.v2.Row row = 1; */ public Builder clearRow() { - if (rowBuilder_ == null) { - row_ = null; - onChanged(); - } else { - row_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + row_ = null; + if (rowBuilder_ != null) { + rowBuilder_.dispose(); rowBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -624,10 +589,11 @@ public Builder clearRow() { * .google.bigtable.v2.Row row = 1; */ public com.google.bigtable.v2.Row.Builder getRowBuilder() { - + bitField0_ |= 0x00000001; onChanged(); - return getRowFieldBuilder().getBuilder(); + return internalGetRowFieldBuilder().getBuilder(); } + /** * * @@ -644,6 +610,7 @@ public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { return row_ == null ? com.google.bigtable.v2.Row.getDefaultInstance() : row_; } } + /** * * @@ -653,14 +620,14 @@ public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { * * .google.bigtable.v2.Row row = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Row, com.google.bigtable.v2.Row.Builder, com.google.bigtable.v2.RowOrBuilder> - getRowFieldBuilder() { + internalGetRowFieldBuilder() { if (rowBuilder_ == null) { rowBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.Row, com.google.bigtable.v2.Row.Builder, com.google.bigtable.v2.RowOrBuilder>(getRow(), getParentForChildren(), isClean()); @@ -669,17 +636,6 @@ public com.google.bigtable.v2.RowOrBuilder getRowOrBuilder() { return rowBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadModifyWriteRowResponse) } @@ -701,7 +657,18 @@ public ReadModifyWriteRowResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadModifyWriteRowResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java index c0b096ad7f..73de2685c3 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRowResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface ReadModifyWriteRowResponseOrBuilder * @return Whether the row field is set. */ boolean hasRow(); + /** * * @@ -47,6 +51,7 @@ public interface ReadModifyWriteRowResponseOrBuilder * @return The row. */ com.google.bigtable.v2.Row getRow(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java index 347eda1b58..8d740aa7d0 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRule} */ -public final class ReadModifyWriteRule extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ReadModifyWriteRule(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,85 +57,13 @@ private ReadModifyWriteRule() { columnQualifier_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadModifyWriteRule(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ReadModifyWriteRule( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - familyName_ = s; - break; - } - case 18: - { - columnQualifier_ = input.readBytes(); - break; - } - case 26: - { - ruleCase_ = 3; - rule_ = input.readBytes(); - break; - } - case 32: - { - ruleCase_ = 4; - rule_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable @@ -131,6 +73,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int ruleCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object rule_; public enum RuleCase @@ -145,6 +89,7 @@ public enum RuleCase 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. @@ -178,7 +123,10 @@ public RuleCase getRuleCase() { } public static final int FAMILY_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object familyName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object familyName_ = ""; + /** * * @@ -203,6 +151,7 @@ public java.lang.String getFamilyName() { return s; } } + /** * * @@ -229,7 +178,8 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { } public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString columnQualifier_; + private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -249,6 +199,7 @@ public com.google.protobuf.ByteString getColumnQualifier() { } public static final int APPEND_VALUE_FIELD_NUMBER = 3; + /** * * @@ -266,6 +217,7 @@ public com.google.protobuf.ByteString getColumnQualifier() { public boolean hasAppendValue() { return ruleCase_ == 3; } + /** * * @@ -288,6 +240,7 @@ public com.google.protobuf.ByteString getAppendValue() { } public static final int INCREMENT_AMOUNT_FIELD_NUMBER = 4; + /** * * @@ -306,6 +259,7 @@ public com.google.protobuf.ByteString getAppendValue() { public boolean hasIncrementAmount() { return ruleCase_ == 4; } + /** * * @@ -342,8 +296,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getFamilyNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, familyName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, familyName_); } if (!columnQualifier_.isEmpty()) { output.writeBytes(2, columnQualifier_); @@ -354,7 +308,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (ruleCase_ == 4) { output.writeInt64(4, (long) ((java.lang.Long) rule_)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -363,8 +317,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getFamilyNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, familyName_); + 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_); @@ -379,7 +333,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeInt64Size( 4, (long) ((java.lang.Long) rule_)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -408,7 +362,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -435,7 +389,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -477,38 +431,38 @@ public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom( public static com.google.bigtable.v2.ReadModifyWriteRule parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -531,10 +485,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -545,7 +500,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ReadModifyWriteRule} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -555,7 +510,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable @@ -565,26 +520,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.ReadModifyWriteRule.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; familyName_ = ""; - columnQualifier_ = com.google.protobuf.ByteString.EMPTY; - ruleCase_ = 0; rule_ = null; return this; @@ -614,50 +561,27 @@ public com.google.bigtable.v2.ReadModifyWriteRule build() { public com.google.bigtable.v2.ReadModifyWriteRule buildPartial() { com.google.bigtable.v2.ReadModifyWriteRule result = new com.google.bigtable.v2.ReadModifyWriteRule(this); - result.familyName_ = familyName_; - result.columnQualifier_ = columnQualifier_; - if (ruleCase_ == 3) { - result.rule_ = rule_; - } - if (ruleCase_ == 4) { - result.rule_ = rule_; + if (bitField0_ != 0) { + buildPartial0(result); } - result.ruleCase_ = ruleCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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_; + } } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.bigtable.v2.ReadModifyWriteRule result) { + result.ruleCase_ = ruleCase_; + result.rule_ = this.rule_; } @java.lang.Override @@ -674,9 +598,10 @@ 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() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getColumnQualifier().isEmpty()) { setColumnQualifier(other.getColumnQualifier()); } switch (other.getRuleCase()) { @@ -695,7 +620,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRule other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -710,17 +635,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ReadModifyWriteRule parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.ReadModifyWriteRule) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -738,7 +701,10 @@ public Builder clearRule() { return this; } + private int bitField0_; + private java.lang.Object familyName_ = ""; + /** * * @@ -762,6 +728,7 @@ public java.lang.String getFamilyName() { return (java.lang.String) ref; } } + /** * * @@ -785,6 +752,7 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -802,11 +770,12 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -820,11 +789,12 @@ public Builder setFamilyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFamilyName() { - familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } + /** * * @@ -843,13 +813,14 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.ByteString columnQualifier_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -867,6 +838,7 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getColumnQualifier() { return columnQualifier_; } + /** * * @@ -885,11 +857,12 @@ public Builder setColumnQualifier(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - columnQualifier_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -904,7 +877,7 @@ public Builder setColumnQualifier(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearColumnQualifier() { - + bitField0_ = (bitField0_ & ~0x00000002); columnQualifier_ = getDefaultInstance().getColumnQualifier(); onChanged(); return this; @@ -926,6 +899,7 @@ public Builder clearColumnQualifier() { public boolean hasAppendValue() { return ruleCase_ == 3; } + /** * * @@ -945,6 +919,7 @@ public com.google.protobuf.ByteString getAppendValue() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -968,6 +943,7 @@ public Builder setAppendValue(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1007,6 +983,7 @@ public Builder clearAppendValue() { public boolean hasIncrementAmount() { return ruleCase_ == 4; } + /** * * @@ -1027,6 +1004,7 @@ public long getIncrementAmount() { } return 0L; } + /** * * @@ -1043,11 +1021,13 @@ public long getIncrementAmount() { * @return This builder for chaining. */ public Builder setIncrementAmount(long value) { + ruleCase_ = 4; rule_ = value; onChanged(); return this; } + /** * * @@ -1071,17 +1051,6 @@ public Builder clearIncrementAmount() { return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadModifyWriteRule) } @@ -1103,7 +1072,18 @@ public ReadModifyWriteRule parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadModifyWriteRule(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java index c406c4fe3d..50c9e47b53 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadModifyWriteRuleOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -36,6 +39,7 @@ public interface ReadModifyWriteRuleOrBuilder * @return The familyName. */ java.lang.String getFamilyName(); + /** * * @@ -79,6 +83,7 @@ public interface ReadModifyWriteRuleOrBuilder * @return Whether the appendValue field is set. */ boolean hasAppendValue(); + /** * * @@ -109,6 +114,7 @@ public interface ReadModifyWriteRuleOrBuilder * @return Whether the incrementAmount field is set. */ boolean hasIncrementAmount(); + /** * * @@ -125,5 +131,5 @@ public interface ReadModifyWriteRuleOrBuilder */ long getIncrementAmount(); - public com.google.bigtable.v2.ReadModifyWriteRule.RuleCase getRuleCase(); + com.google.bigtable.v2.ReadModifyWriteRule.RuleCase getRuleCase(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java index 0f14e8994c..b257416746 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,145 +29,246 @@ * * Protobuf type {@code google.bigtable.v2.ReadRowsRequest} */ -public final class ReadRowsRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ReadRowsRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private ReadRowsRequest() { tableName_ = ""; + authorizedViewName_ = ""; + materializedViewName_ = ""; appProfileId_ = ""; + requestStatsView_ = 0; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadRowsRequest(); + 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 - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + 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); } - private ReadRowsRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; - break; - } - case 18: - { - com.google.bigtable.v2.RowSet.Builder subBuilder = null; - if (rows_ != null) { - subBuilder = rows_.toBuilder(); - } - rows_ = input.readMessage(com.google.bigtable.v2.RowSet.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(rows_); - rows_ = subBuilder.buildPartial(); - } + /** + * + * + *
    +   * 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), + ; - break; - } - case 26: - { - com.google.bigtable.v2.RowFilter.Builder subBuilder = null; - if (filter_ != null) { - subBuilder = filter_.toBuilder(); - } - filter_ = - input.readMessage(com.google.bigtable.v2.RowFilter.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(filter_); - filter_ = subBuilder.buildPartial(); - } + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RequestStatsView"); + } - break; - } - case 32: - { - rowsLimit_ = input.readInt64(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); + /** + * + * + *
    +     * 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; - appProfileId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; + /** + * + * + *
    +     * 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); } - break; - } - } + }; + + 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."); } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + return getDescriptor().getValues().get(ordinal()); } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.bigtable.v2.BigtableProto - .internal_static_google_bigtable_v2_ReadRowsRequest_descriptor; - } + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.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); + 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; - private volatile java.lang.Object tableName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + /** * * *
    -   * Required. The unique name of the table from which to read.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -182,17 +285,19 @@ public java.lang.String getTableName() { return s; } } + /** * * *
    -   * Required. The unique name of the table from which to read.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -210,8 +315,137 @@ public com.google.protobuf.ByteString getTableNameBytes() { } } + 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; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + /** * * @@ -236,6 +470,7 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * @@ -263,11 +498,13 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { public static final int ROWS_FIELD_NUMBER = 2; private com.google.bigtable.v2.RowSet rows_; + /** * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -276,13 +513,15 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { */ @java.lang.Override public boolean hasRows() { - return rows_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -293,22 +532,25 @@ public boolean hasRows() { 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. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; */ @java.lang.Override public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { - return getRows(); + 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_; + /** * * @@ -323,8 +565,9 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { */ @java.lang.Override public boolean hasFilter() { - return filter_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -341,6 +584,7 @@ public boolean hasFilter() { public com.google.bigtable.v2.RowFilter getFilter() { return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; } + /** * * @@ -353,16 +597,17 @@ public com.google.bigtable.v2.RowFilter getFilter() { */ @java.lang.Override public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { - return getFilter(); + return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; } public static final int ROWS_LIMIT_FIELD_NUMBER = 4; - private long rowsLimit_; + private long rowsLimit_ = 0L; + /** * * *
    -   * The read will terminate after committing to N rows' worth of results. The
    +   * The read will stop after committing to N rows' worth of results. The
        * default (zero) is to return all results.
        * 
    * @@ -375,36 +620,119 @@ public long getRowsLimit() { return rowsLimit_; } - private byte memoizedIsInitialized = -1; + 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 final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; + 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 void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); - } - if (rows_ != null) { - output.writeMessage(2, getRows()); - } - if (filter_ != null) { + 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 (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, appProfileId_); + 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_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -413,22 +741,36 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, tableName_); } - if (rows_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRows()); } - if (filter_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFilter()); } if (rowsLimit_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, rowsLimit_); } - if (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, appProfileId_); } - size += unknownFields.getSerializedSize(); + 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; } @@ -444,6 +786,8 @@ public boolean equals(final java.lang.Object 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()) { @@ -454,7 +798,9 @@ public boolean equals(final java.lang.Object obj) { if (!getFilter().equals(other.getFilter())) return false; } if (getRowsLimit() != other.getRowsLimit()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (requestStatsView_ != other.requestStatsView_) return false; + if (getReversed() != other.getReversed()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -467,6 +813,10 @@ public int hashCode() { 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()) { @@ -479,7 +829,11 @@ public int hashCode() { } hash = (37 * hash) + ROWS_LIMIT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRowsLimit()); - hash = (29 * hash) + unknownFields.hashCode(); + 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; } @@ -521,38 +875,38 @@ public static com.google.bigtable.v2.ReadRowsRequest parseFrom( public static com.google.bigtable.v2.ReadRowsRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -575,10 +929,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -588,7 +943,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ReadRowsRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -598,7 +953,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsRequest_fieldAccessorTable @@ -612,36 +967,39 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetRowsFieldBuilder(); + internalGetFilterFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; tableName_ = ""; - + authorizedViewName_ = ""; + materializedViewName_ = ""; appProfileId_ = ""; - - if (rowsBuilder_ == null) { - rows_ = null; - } else { - rows_ = null; + rows_ = null; + if (rowsBuilder_ != null) { + rowsBuilder_.dispose(); rowsBuilder_ = null; } - if (filterBuilder_ == null) { - filter_ = null; - } else { - filter_ = null; + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); filterBuilder_ = null; } rowsLimit_ = 0L; - + requestStatsView_ = 0; + reversed_ = false; return this; } @@ -669,54 +1027,46 @@ public com.google.bigtable.v2.ReadRowsRequest build() { public com.google.bigtable.v2.ReadRowsRequest buildPartial() { com.google.bigtable.v2.ReadRowsRequest result = new com.google.bigtable.v2.ReadRowsRequest(this); - result.tableName_ = tableName_; - result.appProfileId_ = appProfileId_; - if (rowsBuilder_ == null) { - result.rows_ = rows_; - } else { - result.rows_ = rowsBuilder_.build(); - } - if (filterBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = filterBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.rowsLimit_ = rowsLimit_; onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -733,10 +1083,22 @@ 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()) { @@ -748,162 +1110,521 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadRowsRequest other) { if (other.getRowsLimit() != 0L) { setRowsLimit(other.getRowsLimit()); } - this.mergeUnknownFields(other.unknownFields); + 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; } - @java.lang.Override - public final boolean isInitialized() { - return true; + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.v2.ReadRowsRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.bigtable.v2.ReadRowsRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } + /** + * + * + *
    +     * 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 tableName_ = ""; + private java.lang.Object materializedViewName_ = ""; + /** * * *
    -     * Required. The unique name of the table from which to read.
    +     * Optional. The unique name of the MaterializedView from which to read.
    +     *
          * Values are of the form
    -     * `projects/<project>/instances/<instance>/tables/<table>`.
    +     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
          * 
    * * - * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * - * @return The tableName. + * @return The materializedViewName. */ - public java.lang.String getTableName() { - java.lang.Object ref = tableName_; + 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(); - tableName_ = s; + materializedViewName_ = s; return s; } else { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the table from which to read.
    +     * Optional. The unique name of the MaterializedView from which to read.
    +     *
          * Values are of the form
    -     * `projects/<project>/instances/<instance>/tables/<table>`.
    +     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
          * 
    * * - * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * - * @return The bytes for tableName. + * @return The bytes for materializedViewName. */ - public com.google.protobuf.ByteString getTableNameBytes() { - java.lang.Object ref = tableName_; + 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); - tableName_ = b; + materializedViewName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the table from which to read.
    +     * Optional. The unique name of the MaterializedView from which to read.
    +     *
          * Values are of the form
    -     * `projects/<project>/instances/<instance>/tables/<table>`.
    +     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
          * 
    * * - * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * - * @param value The tableName to set. + * @param value The materializedViewName to set. * @return This builder for chaining. */ - public Builder setTableName(java.lang.String value) { + public Builder setMaterializedViewName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - - tableName_ = value; + materializedViewName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } + /** * * *
    -     * Required. The unique name of the table from which to read.
    +     * Optional. The unique name of the MaterializedView from which to read.
    +     *
          * Values are of the form
    -     * `projects/<project>/instances/<instance>/tables/<table>`.
    +     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
          * 
    * * - * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return This builder for chaining. */ - public Builder clearTableName() { - - tableName_ = getDefaultInstance().getTableName(); + public Builder clearMaterializedViewName() { + materializedViewName_ = getDefaultInstance().getMaterializedViewName(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } + /** * * *
    -     * Required. The unique name of the table from which to read.
    +     * Optional. The unique name of the MaterializedView from which to read.
    +     *
          * Values are of the form
    -     * `projects/<project>/instances/<instance>/tables/<table>`.
    +     * `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
          * 
    * * - * string table_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * string materialized_view_name = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * - * @param value The bytes for tableName to set. + * @param value The bytes for materializedViewName to set. * @return This builder for chaining. */ - public Builder setTableNameBytes(com.google.protobuf.ByteString value) { + public Builder setMaterializedViewNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - - tableName_ = value; + materializedViewName_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object appProfileId_ = ""; + /** * * @@ -927,6 +1648,7 @@ public java.lang.String getAppProfileId() { return (java.lang.String) ref; } } + /** * * @@ -950,6 +1672,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -967,11 +1690,12 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -985,11 +1709,12 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -1008,23 +1733,25 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } private com.google.bigtable.v2.RowSet rows_; - private com.google.protobuf.SingleFieldBuilderV3< + 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. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1032,13 +1759,15 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * @return Whether the rows field is set. */ public boolean hasRows() { - return rowsBuilder_ != null || rows_ != null; + return ((bitField0_ & 0x00000010) != 0); } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1052,11 +1781,13 @@ public com.google.bigtable.v2.RowSet getRows() { return rowsBuilder_.getMessage(); } } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1067,18 +1798,20 @@ public Builder setRows(com.google.bigtable.v2.RowSet value) { throw new NullPointerException(); } rows_ = value; - onChanged(); } else { rowsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1086,75 +1819,86 @@ public Builder setRows(com.google.bigtable.v2.RowSet value) { public Builder setRows(com.google.bigtable.v2.RowSet.Builder builderForValue) { if (rowsBuilder_ == null) { rows_ = builderForValue.build(); - onChanged(); } else { rowsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; */ public Builder mergeRows(com.google.bigtable.v2.RowSet value) { if (rowsBuilder_ == null) { - if (rows_ != null) { - rows_ = com.google.bigtable.v2.RowSet.newBuilder(rows_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000010) != 0) + && rows_ != null + && rows_ != com.google.bigtable.v2.RowSet.getDefaultInstance()) { + getRowsBuilder().mergeFrom(value); } else { rows_ = value; } - onChanged(); } else { rowsBuilder_.mergeFrom(value); } - + if (rows_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } return this; } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; */ public Builder clearRows() { - if (rowsBuilder_ == null) { - rows_ = null; - onChanged(); - } else { - rows_ = null; + bitField0_ = (bitField0_ & ~0x00000010); + rows_ = null; + if (rowsBuilder_ != null) { + rowsBuilder_.dispose(); rowsBuilder_ = null; } - + onChanged(); return this; } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; */ public com.google.bigtable.v2.RowSet.Builder getRowsBuilder() { - + bitField0_ |= 0x00000010; onChanged(); - return getRowsFieldBuilder().getBuilder(); + return internalGetRowsFieldBuilder().getBuilder(); } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1166,23 +1910,25 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { return rows_ == null ? com.google.bigtable.v2.RowSet.getDefaultInstance() : rows_; } } + /** * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowSet, com.google.bigtable.v2.RowSet.Builder, com.google.bigtable.v2.RowSetOrBuilder> - getRowsFieldBuilder() { + internalGetRowsFieldBuilder() { if (rowsBuilder_ == null) { rowsBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowSet, com.google.bigtable.v2.RowSet.Builder, com.google.bigtable.v2.RowSetOrBuilder>( @@ -1193,11 +1939,12 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { } private com.google.bigtable.v2.RowFilter filter_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> filterBuilder_; + /** * * @@ -1211,8 +1958,9 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { * @return Whether the filter field is set. */ public boolean hasFilter() { - return filterBuilder_ != null || filter_ != null; + return ((bitField0_ & 0x00000020) != 0); } + /** * * @@ -1232,6 +1980,7 @@ public com.google.bigtable.v2.RowFilter getFilter() { return filterBuilder_.getMessage(); } } + /** * * @@ -1248,13 +1997,14 @@ public Builder setFilter(com.google.bigtable.v2.RowFilter value) { throw new NullPointerException(); } filter_ = value; - onChanged(); } else { filterBuilder_.setMessage(value); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * @@ -1268,13 +2018,14 @@ public Builder setFilter(com.google.bigtable.v2.RowFilter value) { public Builder setFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) { if (filterBuilder_ == null) { filter_ = builderForValue.build(); - onChanged(); } else { filterBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } + /** * * @@ -1287,19 +2038,23 @@ public Builder setFilter(com.google.bigtable.v2.RowFilter.Builder builderForValu */ public Builder mergeFilter(com.google.bigtable.v2.RowFilter value) { if (filterBuilder_ == null) { - if (filter_ != null) { - filter_ = - com.google.bigtable.v2.RowFilter.newBuilder(filter_).mergeFrom(value).buildPartial(); + if (((bitField0_ & 0x00000020) != 0) + && filter_ != null + && filter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) { + getFilterBuilder().mergeFrom(value); } else { filter_ = value; } - onChanged(); } else { filterBuilder_.mergeFrom(value); } - + if (filter_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } return this; } + /** * * @@ -1311,16 +2066,16 @@ public Builder mergeFilter(com.google.bigtable.v2.RowFilter value) { * .google.bigtable.v2.RowFilter filter = 3; */ public Builder clearFilter() { - if (filterBuilder_ == null) { - filter_ = null; - onChanged(); - } else { - filter_ = null; + bitField0_ = (bitField0_ & ~0x00000020); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); filterBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1332,10 +2087,11 @@ public Builder clearFilter() { * .google.bigtable.v2.RowFilter filter = 3; */ public com.google.bigtable.v2.RowFilter.Builder getFilterBuilder() { - + bitField0_ |= 0x00000020; onChanged(); - return getFilterFieldBuilder().getBuilder(); + return internalGetFilterFieldBuilder().getBuilder(); } + /** * * @@ -1353,6 +2109,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { return filter_ == null ? com.google.bigtable.v2.RowFilter.getDefaultInstance() : filter_; } } + /** * * @@ -1363,14 +2120,14 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { * * .google.bigtable.v2.RowFilter filter = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> - getFilterFieldBuilder() { + internalGetFilterFieldBuilder() { if (filterBuilder_ == null) { filterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder>( @@ -1381,11 +2138,12 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { } private long rowsLimit_; + /** * * *
    -     * The read will terminate after committing to N rows' worth of results. The
    +     * The read will stop after committing to N rows' worth of results. The
          * default (zero) is to return all results.
          * 
    * @@ -1397,11 +2155,12 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { public long getRowsLimit() { return rowsLimit_; } + /** * * *
    -     * The read will terminate after committing to N rows' worth of results. The
    +     * The read will stop after committing to N rows' worth of results. The
          * default (zero) is to return all results.
          * 
    * @@ -1413,14 +2172,16 @@ public long getRowsLimit() { public Builder setRowsLimit(long value) { rowsLimit_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * *
    -     * The read will terminate after committing to N rows' worth of results. The
    +     * The read will stop after committing to N rows' worth of results. The
          * default (zero) is to return all results.
          * 
    * @@ -1429,21 +2190,197 @@ public Builder setRowsLimit(long value) { * @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 final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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 final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + 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) @@ -1467,7 +2404,18 @@ public ReadRowsRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadRowsRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java index a38045db61..b5d0dc2438 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,35 +30,110 @@ public interface ReadRowsRequestOrBuilder * * *
    -   * Required. The unique name of the table from which to read.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. */ java.lang.String getTableName(); + /** * * *
    -   * Required. The unique name of the table from which to read.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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(); + /** * * @@ -69,6 +147,7 @@ public interface ReadRowsRequestOrBuilder * @return The appProfileId. */ java.lang.String getAppProfileId(); + /** * * @@ -87,7 +166,8 @@ public interface ReadRowsRequestOrBuilder * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -95,11 +175,13 @@ public interface ReadRowsRequestOrBuilder * @return Whether the rows field is set. */ boolean hasRows(); + /** * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -107,11 +189,13 @@ public interface ReadRowsRequestOrBuilder * @return The rows. */ com.google.bigtable.v2.RowSet getRows(); + /** * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -131,6 +215,7 @@ public interface ReadRowsRequestOrBuilder * @return Whether the filter field is set. */ boolean hasFilter(); + /** * * @@ -144,6 +229,7 @@ public interface ReadRowsRequestOrBuilder * @return The filter. */ com.google.bigtable.v2.RowFilter getFilter(); + /** * * @@ -160,7 +246,7 @@ public interface ReadRowsRequestOrBuilder * * *
    -   * The read will terminate after committing to N rows' worth of results. The
    +   * The read will stop after committing to N rows' worth of results. The
        * default (zero) is to return all results.
        * 
    * @@ -169,4 +255,54 @@ public interface ReadRowsRequestOrBuilder * @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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java index d4c707ac0b..ff3dc5309f 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.v2.ReadRowsResponse} */ -public final class ReadRowsResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private ReadRowsResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -42,83 +56,13 @@ private ReadRowsResponse() { lastScannedRowKey_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ReadRowsResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ReadRowsResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - chunks_ = - new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - chunks_.add( - input.readMessage( - com.google.bigtable.v2.ReadRowsResponse.CellChunk.parser(), - extensionRegistry)); - break; - } - case 18: - { - lastScannedRowKey_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - chunks_ = java.util.Collections.unmodifiableList(chunks_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable @@ -165,6 +109,7 @@ public interface CellChunkOrBuilder * @return Whether the familyName field is set. */ boolean hasFamilyName(); + /** * * @@ -182,6 +127,7 @@ public interface CellChunkOrBuilder * @return The familyName. */ com.google.protobuf.StringValue getFamilyName(); + /** * * @@ -214,6 +160,7 @@ public interface CellChunkOrBuilder * @return Whether the qualifier field is set. */ boolean hasQualifier(); + /** * * @@ -230,6 +177,7 @@ public interface CellChunkOrBuilder * @return The qualifier. */ com.google.protobuf.BytesValue getQualifier(); + /** * * @@ -279,6 +227,7 @@ public interface CellChunkOrBuilder * @return A list containing the labels. */ java.util.List getLabelsList(); + /** * * @@ -293,6 +242,7 @@ public interface CellChunkOrBuilder * @return The count of labels. */ int getLabelsCount(); + /** * * @@ -308,6 +258,7 @@ public interface CellChunkOrBuilder * @return The labels at the given index. */ java.lang.String getLabels(int index); + /** * * @@ -370,6 +321,7 @@ public interface CellChunkOrBuilder * @return Whether the resetRow field is set. */ boolean hasResetRow(); + /** * * @@ -397,6 +349,7 @@ public interface CellChunkOrBuilder * @return Whether the commitRow field is set. */ boolean hasCommitRow(); + /** * * @@ -411,8 +364,9 @@ public interface CellChunkOrBuilder */ boolean getCommitRow(); - public com.google.bigtable.v2.ReadRowsResponse.CellChunk.RowStatusCase getRowStatusCase(); + com.google.bigtable.v2.ReadRowsResponse.CellChunk.RowStatusCase getRowStatusCase(); } + /** * * @@ -423,153 +377,40 @@ public interface CellChunkOrBuilder * * Protobuf type {@code google.bigtable.v2.ReadRowsResponse.CellChunk} */ - public static final class CellChunk extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private CellChunk(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private CellChunk() { rowKey_ = com.google.protobuf.ByteString.EMPTY; - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); value_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new CellChunk(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private CellChunk( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - rowKey_ = input.readBytes(); - break; - } - case 18: - { - com.google.protobuf.StringValue.Builder subBuilder = null; - if (familyName_ != null) { - subBuilder = familyName_.toBuilder(); - } - familyName_ = - input.readMessage(com.google.protobuf.StringValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(familyName_); - familyName_ = subBuilder.buildPartial(); - } - - break; - } - case 26: - { - com.google.protobuf.BytesValue.Builder subBuilder = null; - if (qualifier_ != null) { - subBuilder = qualifier_.toBuilder(); - } - qualifier_ = - input.readMessage(com.google.protobuf.BytesValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(qualifier_); - qualifier_ = subBuilder.buildPartial(); - } - - break; - } - case 32: - { - timestampMicros_ = input.readInt64(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - labels_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - labels_.add(s); - break; - } - case 50: - { - value_ = input.readBytes(); - break; - } - case 56: - { - valueSize_ = input.readInt32(); - break; - } - case 64: - { - rowStatusCase_ = 8; - rowStatus_ = input.readBool(); - break; - } - case 72: - { - rowStatusCase_ = 9; - rowStatus_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - labels_ = labels_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable @@ -578,7 +419,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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 @@ -593,6 +437,7 @@ public enum RowStatusCase 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. @@ -626,7 +471,8 @@ public RowStatusCase getRowStatusCase() { } public static final int ROW_KEY_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString rowKey_; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -648,6 +494,7 @@ public com.google.protobuf.ByteString getRowKey() { public static final int FAMILY_NAME_FIELD_NUMBER = 2; private com.google.protobuf.StringValue familyName_; + /** * * @@ -666,8 +513,9 @@ public com.google.protobuf.ByteString getRowKey() { */ @java.lang.Override public boolean hasFamilyName() { - return familyName_ != null; + return ((bitField0_ & 0x00000001) != 0); } + /** * * @@ -690,6 +538,7 @@ public com.google.protobuf.StringValue getFamilyName() { ? com.google.protobuf.StringValue.getDefaultInstance() : familyName_; } + /** * * @@ -706,11 +555,14 @@ public com.google.protobuf.StringValue getFamilyName() { */ @java.lang.Override public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { - return getFamilyName(); + return familyName_ == null + ? com.google.protobuf.StringValue.getDefaultInstance() + : familyName_; } public static final int QUALIFIER_FIELD_NUMBER = 3; private com.google.protobuf.BytesValue qualifier_; + /** * * @@ -728,8 +580,9 @@ public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { */ @java.lang.Override public boolean hasQualifier() { - return qualifier_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -749,6 +602,7 @@ public boolean hasQualifier() { public com.google.protobuf.BytesValue getQualifier() { return qualifier_ == null ? com.google.protobuf.BytesValue.getDefaultInstance() : qualifier_; } + /** * * @@ -764,11 +618,12 @@ public com.google.protobuf.BytesValue getQualifier() { */ @java.lang.Override public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { - return getQualifier(); + return qualifier_ == null ? com.google.protobuf.BytesValue.getDefaultInstance() : qualifier_; } public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 4; - private long timestampMicros_; + private long timestampMicros_ = 0L; + /** * * @@ -793,7 +648,11 @@ public long getTimestampMicros() { } public static final int LABELS_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList labels_; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** * * @@ -810,6 +669,7 @@ public long getTimestampMicros() { public com.google.protobuf.ProtocolStringList getLabelsList() { return labels_; } + /** * * @@ -826,6 +686,7 @@ public com.google.protobuf.ProtocolStringList getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -843,6 +704,7 @@ public int getLabelsCount() { public java.lang.String getLabels(int index) { return labels_.get(index); } + /** * * @@ -862,7 +724,8 @@ public com.google.protobuf.ByteString getLabelsBytes(int index) { } public static final int VALUE_FIELD_NUMBER = 6; - private com.google.protobuf.ByteString value_; + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -884,7 +747,8 @@ public com.google.protobuf.ByteString getValue() { } public static final int VALUE_SIZE_FIELD_NUMBER = 7; - private int valueSize_; + private int valueSize_ = 0; + /** * * @@ -905,6 +769,7 @@ public int getValueSize() { } public static final int RESET_ROW_FIELD_NUMBER = 8; + /** * * @@ -921,6 +786,7 @@ public int getValueSize() { public boolean hasResetRow() { return rowStatusCase_ == 8; } + /** * * @@ -942,6 +808,7 @@ public boolean getResetRow() { } public static final int COMMIT_ROW_FIELD_NUMBER = 9; + /** * * @@ -958,6 +825,7 @@ public boolean getResetRow() { public boolean hasCommitRow() { return rowStatusCase_ == 9; } + /** * * @@ -995,17 +863,17 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!rowKey_.isEmpty()) { output.writeBytes(1, rowKey_); } - if (familyName_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getFamilyName()); } - if (qualifier_ != null) { + 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.GeneratedMessageV3.writeString(output, 5, labels_.getRaw(i)); + com.google.protobuf.GeneratedMessage.writeString(output, 5, labels_.getRaw(i)); } if (!value_.isEmpty()) { output.writeBytes(6, value_); @@ -1019,7 +887,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (rowStatusCase_ == 9) { output.writeBool(9, (boolean) ((java.lang.Boolean) rowStatus_)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1031,10 +899,10 @@ public int getSerializedSize() { if (!rowKey_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, rowKey_); } - if (familyName_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFamilyName()); } - if (qualifier_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getQualifier()); } if (timestampMicros_ != 0L) { @@ -1064,7 +932,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBoolSize( 9, (boolean) ((java.lang.Boolean) rowStatus_)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1104,7 +972,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1147,7 +1015,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1189,38 +1057,38 @@ public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( public static com.google.bigtable.v2.ReadRowsResponse.CellChunk parseFrom( java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1243,11 +1111,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1258,8 +1126,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.ReadRowsResponse.CellChunk} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1269,7 +1136,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsResponse_CellChunk_fieldAccessorTable @@ -1283,40 +1150,37 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetFamilyNameFieldBuilder(); + internalGetQualifierFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; rowKey_ = com.google.protobuf.ByteString.EMPTY; - - if (familyNameBuilder_ == null) { - familyName_ = null; - } else { - familyName_ = null; + familyName_ = null; + if (familyNameBuilder_ != null) { + familyNameBuilder_.dispose(); familyNameBuilder_ = null; } - if (qualifierBuilder_ == null) { - qualifier_ = null; - } else { - qualifier_ = null; + qualifier_ = null; + if (qualifierBuilder_ != null) { + qualifierBuilder_.dispose(); qualifierBuilder_ = null; } timestampMicros_ = 0L; - - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); value_ = com.google.protobuf.ByteString.EMPTY; - valueSize_ = 0; - rowStatusCase_ = 0; rowStatus_ = null; return this; @@ -1346,70 +1210,48 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk build() { 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_; - result.rowKey_ = rowKey_; - if (familyNameBuilder_ == null) { - result.familyName_ = familyName_; - } else { - result.familyName_ = familyNameBuilder_.build(); + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowKey_ = rowKey_; } - if (qualifierBuilder_ == null) { - result.qualifier_ = qualifier_; - } else { - result.qualifier_ = qualifierBuilder_.build(); + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.familyName_ = + familyNameBuilder_ == null ? familyName_ : familyNameBuilder_.build(); + to_bitField0_ |= 0x00000001; } - result.timestampMicros_ = timestampMicros_; - if (((bitField0_ & 0x00000001) != 0)) { - labels_ = labels_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); + if (((from_bitField0_ & 0x00000004) != 0)) { + result.qualifier_ = qualifierBuilder_ == null ? qualifier_ : qualifierBuilder_.build(); + to_bitField0_ |= 0x00000002; } - result.labels_ = labels_; - result.value_ = value_; - result.valueSize_ = valueSize_; - if (rowStatusCase_ == 8) { - result.rowStatus_ = rowStatus_; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.timestampMicros_ = timestampMicros_; } - if (rowStatusCase_ == 9) { - result.rowStatus_ = rowStatus_; + if (((from_bitField0_ & 0x00000010) != 0)) { + labels_.makeImmutable(); + result.labels_ = labels_; } - result.rowStatusCase_ = rowStatusCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); + if (((from_bitField0_ & 0x00000020) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.valueSize_ = valueSize_; + } + result.bitField0_ |= to_bitField0_; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartialOneofs(com.google.bigtable.v2.ReadRowsResponse.CellChunk result) { + result.rowStatusCase_ = rowStatusCase_; + result.rowStatus_ = this.rowStatus_; } @java.lang.Override @@ -1425,7 +1267,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse.CellChunk other) { if (other == com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance()) return this; - if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getRowKey().isEmpty()) { setRowKey(other.getRowKey()); } if (other.hasFamilyName()) { @@ -1440,14 +1282,14 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse.CellChunk other if (!other.labels_.isEmpty()) { if (labels_.isEmpty()) { labels_ = other.labels_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ |= 0x00000010; } else { ensureLabelsIsMutable(); labels_.addAll(other.labels_); } onChanged(); } - if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getValue().isEmpty()) { setValue(other.getValue()); } if (other.getValueSize() != 0) { @@ -1469,7 +1311,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse.CellChunk other break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1484,18 +1326,88 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ReadRowsResponse.CellChunk parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = - (com.google.bigtable.v2.ReadRowsResponse.CellChunk) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1516,6 +1428,7 @@ public Builder clearRowStatus() { private int bitField0_; private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -1534,6 +1447,7 @@ public Builder clearRowStatus() { public com.google.protobuf.ByteString getRowKey() { return rowKey_; } + /** * * @@ -1553,11 +1467,12 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -1573,18 +1488,19 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * @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.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.StringValue, com.google.protobuf.StringValue.Builder, com.google.protobuf.StringValueOrBuilder> familyNameBuilder_; + /** * * @@ -1602,8 +1518,9 @@ public Builder clearRowKey() { * @return Whether the familyName field is set. */ public boolean hasFamilyName() { - return familyNameBuilder_ != null || familyName_ != null; + return ((bitField0_ & 0x00000002) != 0); } + /** * * @@ -1629,6 +1546,7 @@ public com.google.protobuf.StringValue getFamilyName() { return familyNameBuilder_.getMessage(); } } + /** * * @@ -1649,13 +1567,14 @@ public Builder setFamilyName(com.google.protobuf.StringValue value) { throw new NullPointerException(); } familyName_ = value; - onChanged(); } else { familyNameBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -1673,13 +1592,14 @@ public Builder setFamilyName(com.google.protobuf.StringValue value) { public Builder setFamilyName(com.google.protobuf.StringValue.Builder builderForValue) { if (familyNameBuilder_ == null) { familyName_ = builderForValue.build(); - onChanged(); } else { familyNameBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } + /** * * @@ -1696,21 +1616,23 @@ public Builder setFamilyName(com.google.protobuf.StringValue.Builder builderForV */ public Builder mergeFamilyName(com.google.protobuf.StringValue value) { if (familyNameBuilder_ == null) { - if (familyName_ != null) { - familyName_ = - com.google.protobuf.StringValue.newBuilder(familyName_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && familyName_ != null + && familyName_ != com.google.protobuf.StringValue.getDefaultInstance()) { + getFamilyNameBuilder().mergeFrom(value); } else { familyName_ = value; } - onChanged(); } else { familyNameBuilder_.mergeFrom(value); } - + if (familyName_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } + /** * * @@ -1726,16 +1648,16 @@ public Builder mergeFamilyName(com.google.protobuf.StringValue value) { * .google.protobuf.StringValue family_name = 2; */ public Builder clearFamilyName() { - if (familyNameBuilder_ == null) { - familyName_ = null; - onChanged(); - } else { - familyName_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + familyName_ = null; + if (familyNameBuilder_ != null) { + familyNameBuilder_.dispose(); familyNameBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1751,10 +1673,11 @@ public Builder clearFamilyName() { * .google.protobuf.StringValue family_name = 2; */ public com.google.protobuf.StringValue.Builder getFamilyNameBuilder() { - + bitField0_ |= 0x00000002; onChanged(); - return getFamilyNameFieldBuilder().getBuilder(); + return internalGetFamilyNameFieldBuilder().getBuilder(); } + /** * * @@ -1778,6 +1701,7 @@ public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { : familyName_; } } + /** * * @@ -1792,14 +1716,14 @@ public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { * * .google.protobuf.StringValue family_name = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.StringValue, com.google.protobuf.StringValue.Builder, com.google.protobuf.StringValueOrBuilder> - getFamilyNameFieldBuilder() { + internalGetFamilyNameFieldBuilder() { if (familyNameBuilder_ == null) { familyNameBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.StringValue, com.google.protobuf.StringValue.Builder, com.google.protobuf.StringValueOrBuilder>( @@ -1810,11 +1734,12 @@ public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { } private com.google.protobuf.BytesValue qualifier_; - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.BytesValue, com.google.protobuf.BytesValue.Builder, com.google.protobuf.BytesValueOrBuilder> qualifierBuilder_; + /** * * @@ -1831,8 +1756,9 @@ public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { * @return Whether the qualifier field is set. */ public boolean hasQualifier() { - return qualifierBuilder_ != null || qualifier_ != null; + return ((bitField0_ & 0x00000004) != 0); } + /** * * @@ -1857,6 +1783,7 @@ public com.google.protobuf.BytesValue getQualifier() { return qualifierBuilder_.getMessage(); } } + /** * * @@ -1876,13 +1803,14 @@ public Builder setQualifier(com.google.protobuf.BytesValue value) { throw new NullPointerException(); } qualifier_ = value; - onChanged(); } else { qualifierBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1899,13 +1827,14 @@ public Builder setQualifier(com.google.protobuf.BytesValue value) { public Builder setQualifier(com.google.protobuf.BytesValue.Builder builderForValue) { if (qualifierBuilder_ == null) { qualifier_ = builderForValue.build(); - onChanged(); } else { qualifierBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } + /** * * @@ -1921,21 +1850,23 @@ public Builder setQualifier(com.google.protobuf.BytesValue.Builder builderForVal */ public Builder mergeQualifier(com.google.protobuf.BytesValue value) { if (qualifierBuilder_ == null) { - if (qualifier_ != null) { - qualifier_ = - com.google.protobuf.BytesValue.newBuilder(qualifier_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && qualifier_ != null + && qualifier_ != com.google.protobuf.BytesValue.getDefaultInstance()) { + getQualifierBuilder().mergeFrom(value); } else { qualifier_ = value; } - onChanged(); } else { qualifierBuilder_.mergeFrom(value); } - + if (qualifier_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } + /** * * @@ -1950,16 +1881,16 @@ public Builder mergeQualifier(com.google.protobuf.BytesValue value) { * .google.protobuf.BytesValue qualifier = 3; */ public Builder clearQualifier() { - if (qualifierBuilder_ == null) { - qualifier_ = null; - onChanged(); - } else { - qualifier_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + qualifier_ = null; + if (qualifierBuilder_ != null) { + qualifierBuilder_.dispose(); qualifierBuilder_ = null; } - + onChanged(); return this; } + /** * * @@ -1974,10 +1905,11 @@ public Builder clearQualifier() { * .google.protobuf.BytesValue qualifier = 3; */ public com.google.protobuf.BytesValue.Builder getQualifierBuilder() { - + bitField0_ |= 0x00000004; onChanged(); - return getQualifierFieldBuilder().getBuilder(); + return internalGetQualifierFieldBuilder().getBuilder(); } + /** * * @@ -2000,6 +1932,7 @@ public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { : qualifier_; } } + /** * * @@ -2013,14 +1946,14 @@ public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { * * .google.protobuf.BytesValue qualifier = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.protobuf.BytesValue, com.google.protobuf.BytesValue.Builder, com.google.protobuf.BytesValueOrBuilder> - getQualifierFieldBuilder() { + internalGetQualifierFieldBuilder() { if (qualifierBuilder_ == null) { qualifierBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.protobuf.BytesValue, com.google.protobuf.BytesValue.Builder, com.google.protobuf.BytesValueOrBuilder>( @@ -2031,6 +1964,7 @@ public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { } private long timestampMicros_; + /** * * @@ -2053,6 +1987,7 @@ public com.google.protobuf.BytesValueOrBuilder getQualifierOrBuilder() { public long getTimestampMicros() { return timestampMicros_; } + /** * * @@ -2075,9 +2010,11 @@ public long getTimestampMicros() { public Builder setTimestampMicros(long value) { timestampMicros_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -2097,21 +2034,22 @@ public Builder setTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000008); timestampMicros_ = 0L; onChanged(); return this; } - private com.google.protobuf.LazyStringList labels_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + private com.google.protobuf.LazyStringArrayList labels_ = + com.google.protobuf.LazyStringArrayList.emptyList(); private void ensureLabelsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!labels_.isModifiable()) { labels_ = new com.google.protobuf.LazyStringArrayList(labels_); - bitField0_ |= 0x00000001; } + bitField0_ |= 0x00000010; } + /** * * @@ -2126,8 +2064,10 @@ private void ensureLabelsIsMutable() { * @return A list containing the labels. */ public com.google.protobuf.ProtocolStringList getLabelsList() { - return labels_.getUnmodifiableView(); + labels_.makeImmutable(); + return labels_; } + /** * * @@ -2144,6 +2084,7 @@ public com.google.protobuf.ProtocolStringList getLabelsList() { public int getLabelsCount() { return labels_.size(); } + /** * * @@ -2161,6 +2102,7 @@ public int getLabelsCount() { public java.lang.String getLabels(int index) { return labels_.get(index); } + /** * * @@ -2178,6 +2120,7 @@ public java.lang.String getLabels(int index) { public com.google.protobuf.ByteString getLabelsBytes(int index) { return labels_.getByteString(index); } + /** * * @@ -2199,9 +2142,11 @@ public Builder setLabels(int index, java.lang.String value) { } ensureLabelsIsMutable(); labels_.set(index, value); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -2222,9 +2167,11 @@ public Builder addLabels(java.lang.String value) { } ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -2242,9 +2189,11 @@ public Builder addLabels(java.lang.String value) { public Builder addAllLabels(java.lang.Iterable values) { ensureLabelsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_); + bitField0_ |= 0x00000010; onChanged(); return this; } + /** * * @@ -2259,11 +2208,13 @@ public Builder addAllLabels(java.lang.Iterable values) { * @return This builder for chaining. */ public Builder clearLabels() { - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + ; onChanged(); return this; } + /** * * @@ -2285,11 +2236,13 @@ public Builder addLabelsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000010; onChanged(); return this; } private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -2309,6 +2262,7 @@ public Builder addLabelsBytes(com.google.protobuf.ByteString value) { public com.google.protobuf.ByteString getValue() { return value_; } + /** * * @@ -2329,11 +2283,12 @@ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } + /** * * @@ -2350,13 +2305,14 @@ public Builder setValue(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearValue() { - + bitField0_ = (bitField0_ & ~0x00000020); value_ = getDefaultInstance().getValue(); onChanged(); return this; } private int valueSize_; + /** * * @@ -2375,6 +2331,7 @@ public Builder clearValue() { public int getValueSize() { return valueSize_; } + /** * * @@ -2393,9 +2350,11 @@ public int getValueSize() { public Builder setValueSize(int value) { valueSize_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } + /** * * @@ -2411,7 +2370,7 @@ public Builder setValueSize(int value) { * @return This builder for chaining. */ public Builder clearValueSize() { - + bitField0_ = (bitField0_ & ~0x00000040); valueSize_ = 0; onChanged(); return this; @@ -2432,6 +2391,7 @@ public Builder clearValueSize() { public boolean hasResetRow() { return rowStatusCase_ == 8; } + /** * * @@ -2450,6 +2410,7 @@ public boolean getResetRow() { } return false; } + /** * * @@ -2464,11 +2425,13 @@ public boolean getResetRow() { * @return This builder for chaining. */ public Builder setResetRow(boolean value) { + rowStatusCase_ = 8; rowStatus_ = value; onChanged(); return this; } + /** * * @@ -2505,6 +2468,7 @@ public Builder clearResetRow() { public boolean hasCommitRow() { return rowStatusCase_ == 9; } + /** * * @@ -2523,6 +2487,7 @@ public boolean getCommitRow() { } return false; } + /** * * @@ -2537,11 +2502,13 @@ public boolean getCommitRow() { * @return This builder for chaining. */ public Builder setCommitRow(boolean value) { + rowStatusCase_ = 9; rowStatus_ = value; onChanged(); return this; } + /** * * @@ -2563,18 +2530,6 @@ public Builder clearCommitRow() { return this; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ReadRowsResponse.CellChunk) } @@ -2596,7 +2551,19 @@ public CellChunk parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new CellChunk(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -2615,8 +2582,12 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk getDefaultInstanceForTy } } + private int bitField0_; public static final int CHUNKS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List chunks_; + /** * * @@ -2630,6 +2601,7 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk getDefaultInstanceForTy public java.util.List getChunksList() { return chunks_; } + /** * * @@ -2644,6 +2616,7 @@ public java.util.List getChun getChunksOrBuilderList() { return chunks_; } + /** * * @@ -2657,6 +2630,7 @@ public java.util.List getChun public int getChunksCount() { return chunks_.size(); } + /** * * @@ -2670,6 +2644,7 @@ public int getChunksCount() { public com.google.bigtable.v2.ReadRowsResponse.CellChunk getChunks(int index) { return chunks_.get(index); } + /** * * @@ -2685,7 +2660,8 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBui } public static final int LAST_SCANNED_ROW_KEY_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString lastScannedRowKey_; + private com.google.protobuf.ByteString lastScannedRowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -2708,6 +2684,71 @@ 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 @@ -2728,7 +2769,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!lastScannedRowKey_.isEmpty()) { output.writeBytes(2, lastScannedRowKey_); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getRequestStats()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2743,7 +2787,10 @@ public int getSerializedSize() { if (!lastScannedRowKey_.isEmpty()) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, lastScannedRowKey_); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getRequestStats()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -2760,7 +2807,11 @@ public boolean equals(final java.lang.Object obj) { if (!getChunksList().equals(other.getChunksList())) return false; if (!getLastScannedRowKey().equals(other.getLastScannedRowKey())) return false; - if (!unknownFields.equals(other.unknownFields)) 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; } @@ -2777,7 +2828,11 @@ public int hashCode() { } hash = (37 * hash) + LAST_SCANNED_ROW_KEY_FIELD_NUMBER; hash = (53 * hash) + getLastScannedRowKey().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + if (hasRequestStats()) { + hash = (37 * hash) + REQUEST_STATS_FIELD_NUMBER; + hash = (53 * hash) + getRequestStats().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -2819,38 +2874,38 @@ public static com.google.bigtable.v2.ReadRowsResponse parseFrom( public static com.google.bigtable.v2.ReadRowsResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -2873,10 +2928,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -2886,7 +2942,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ReadRowsResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -2896,7 +2952,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadRowsResponse_fieldAccessorTable @@ -2910,28 +2966,35 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getChunksFieldBuilder(); + 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(); - bitField0_ = (bitField0_ & ~0x00000001); } 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; } @@ -2959,7 +3022,15 @@ public com.google.bigtable.v2.ReadRowsResponse build() { public com.google.bigtable.v2.ReadRowsResponse buildPartial() { com.google.bigtable.v2.ReadRowsResponse result = new com.google.bigtable.v2.ReadRowsResponse(this); - int from_bitField0_ = bitField0_; + 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_); @@ -2969,42 +3040,20 @@ public com.google.bigtable.v2.ReadRowsResponse buildPartial() { } else { result.chunks_ = chunksBuilder_.build(); } - result.lastScannedRowKey_ = lastScannedRowKey_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -3038,18 +3087,21 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse other) { chunks_ = other.chunks_; bitField0_ = (bitField0_ & ~0x00000001); chunksBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getChunksFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetChunksFieldBuilder() : null; } else { chunksBuilder_.addAllMessages(other.chunks_); } } } - if (other.getLastScannedRowKey() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getLastScannedRowKey().isEmpty()) { setLastScannedRowKey(other.getLastScannedRowKey()); } - this.mergeUnknownFields(other.unknownFields); + if (other.hasRequestStats()) { + mergeRequestStats(other.getRequestStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3064,17 +3116,58 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ReadRowsResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.ReadRowsResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3091,7 +3184,7 @@ private void ensureChunksIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.ReadRowsResponse.CellChunk, com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder, com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder> @@ -3113,6 +3206,7 @@ public java.util.List getChun return chunksBuilder_.getMessageList(); } } + /** * * @@ -3129,6 +3223,7 @@ public int getChunksCount() { return chunksBuilder_.getCount(); } } + /** * * @@ -3145,6 +3240,7 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk getChunks(int index) { return chunksBuilder_.getMessage(index); } } + /** * * @@ -3167,6 +3263,7 @@ public Builder setChunks(int index, com.google.bigtable.v2.ReadRowsResponse.Cell } return this; } + /** * * @@ -3187,6 +3284,7 @@ public Builder setChunks( } return this; } + /** * * @@ -3209,6 +3307,7 @@ public Builder addChunks(com.google.bigtable.v2.ReadRowsResponse.CellChunk value } return this; } + /** * * @@ -3231,6 +3330,7 @@ public Builder addChunks(int index, com.google.bigtable.v2.ReadRowsResponse.Cell } return this; } + /** * * @@ -3251,6 +3351,7 @@ public Builder addChunks( } return this; } + /** * * @@ -3271,6 +3372,7 @@ public Builder addChunks( } return this; } + /** * * @@ -3291,6 +3393,7 @@ public Builder addAllChunks( } return this; } + /** * * @@ -3310,6 +3413,7 @@ public Builder clearChunks() { } return this; } + /** * * @@ -3329,6 +3433,7 @@ public Builder removeChunks(int index) { } return this; } + /** * * @@ -3339,8 +3444,9 @@ public Builder removeChunks(int index) { * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; */ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder getChunksBuilder(int index) { - return getChunksFieldBuilder().getBuilder(index); + return internalGetChunksFieldBuilder().getBuilder(index); } + /** * * @@ -3358,6 +3464,7 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBui return chunksBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -3375,6 +3482,7 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBui return java.util.Collections.unmodifiableList(chunks_); } } + /** * * @@ -3385,9 +3493,10 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder getChunksOrBui * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; */ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilder() { - return getChunksFieldBuilder() + return internalGetChunksFieldBuilder() .addBuilder(com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance()); } + /** * * @@ -3398,10 +3507,11 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilde * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; */ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilder(int index) { - return getChunksFieldBuilder() + return internalGetChunksFieldBuilder() .addBuilder( index, com.google.bigtable.v2.ReadRowsResponse.CellChunk.getDefaultInstance()); } + /** * * @@ -3413,17 +3523,17 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilde */ public java.util.List getChunksBuilderList() { - return getChunksFieldBuilder().getBuilderList(); + return internalGetChunksFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.ReadRowsResponse.CellChunk, com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder, com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder> - getChunksFieldBuilder() { + internalGetChunksFieldBuilder() { if (chunksBuilder_ == null) { chunksBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.ReadRowsResponse.CellChunk, com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder, com.google.bigtable.v2.ReadRowsResponse.CellChunkOrBuilder>( @@ -3435,6 +3545,7 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilde private com.google.protobuf.ByteString lastScannedRowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -3456,6 +3567,7 @@ public com.google.bigtable.v2.ReadRowsResponse.CellChunk.Builder addChunksBuilde public com.google.protobuf.ByteString getLastScannedRowKey() { return lastScannedRowKey_; } + /** * * @@ -3478,11 +3590,12 @@ public Builder setLastScannedRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - lastScannedRowKey_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -3501,21 +3614,240 @@ public Builder setLastScannedRowKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearLastScannedRowKey() { - + bitField0_ = (bitField0_ & ~0x00000002); lastScannedRowKey_ = getDefaultInstance().getLastScannedRowKey(); onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + 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); } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + /** + * + * + *
    +     * 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) @@ -3539,7 +3871,18 @@ public ReadRowsResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ReadRowsResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java index 84410a4c1e..a1202a4020 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadRowsResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -33,6 +36,7 @@ public interface ReadRowsResponseOrBuilder * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; */ java.util.List getChunksList(); + /** * * @@ -43,6 +47,7 @@ public interface ReadRowsResponseOrBuilder * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; */ com.google.bigtable.v2.ReadRowsResponse.CellChunk getChunks(int index); + /** * * @@ -53,6 +58,7 @@ public interface ReadRowsResponseOrBuilder * repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1; */ int getChunksCount(); + /** * * @@ -64,6 +70,7 @@ public interface ReadRowsResponseOrBuilder */ java.util.List getChunksOrBuilderList(); + /** * * @@ -93,4 +100,53 @@ public interface ReadRowsResponseOrBuilder * @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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStats.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStats.java new file mode 100644 index 0000000000..c84b987d3e --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStatsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStatsOrBuilder.java new file mode 100644 index 0000000000..5ab3acc57f --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStats.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStats.java new file mode 100644 index 0000000000..20a41ad0bf --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsOrBuilder.java new file mode 100644 index 0000000000..34e1e2b00f --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsProto.java new file mode 100644 index 0000000000..f07650ff78 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParams.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParams.java new file mode 100644 index 0000000000..47cf26a024 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsOrBuilder.java new file mode 100644 index 0000000000..b51f794c2e --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsProto.java new file mode 100644 index 0000000000..023c64d587 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadata.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadata.java new file mode 100644 index 0000000000..e5704a7a3d --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadataOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadataOrBuilder.java new file mode 100644 index 0000000000..355dd9eb59 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java index e0d4d311ab..c56f38d4a9 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Row.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -28,13 +30,25 @@ * * Protobuf type {@code google.bigtable.v2.Row} */ -public final class Row extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private Row(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -43,79 +57,12 @@ private Row() { families_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Row(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Row( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - key_ = input.readBytes(); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - families_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - families_.add( - input.readMessage(com.google.bigtable.v2.Family.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - families_ = java.util.Collections.unmodifiableList(families_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Row_fieldAccessorTable @@ -124,7 +71,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int KEY_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString key_; + private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -144,7 +92,10 @@ public com.google.protobuf.ByteString getKey() { } public static final int FAMILIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List families_; + /** * * @@ -159,6 +110,7 @@ public com.google.protobuf.ByteString getKey() { public java.util.List getFamiliesList() { return families_; } + /** * * @@ -174,6 +126,7 @@ public java.util.List getFamiliesList() { getFamiliesOrBuilderList() { return families_; } + /** * * @@ -188,6 +141,7 @@ public java.util.List getFamiliesList() { public int getFamiliesCount() { return families_.size(); } + /** * * @@ -202,6 +156,7 @@ public int getFamiliesCount() { public com.google.bigtable.v2.Family getFamilies(int index) { return families_.get(index); } + /** * * @@ -237,7 +192,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < families_.size(); i++) { output.writeMessage(2, families_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -252,7 +207,7 @@ public int getSerializedSize() { for (int i = 0; i < families_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, families_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -269,7 +224,7 @@ public boolean equals(final java.lang.Object obj) { if (!getKey().equals(other.getKey())) return false; if (!getFamiliesList().equals(other.getFamiliesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -286,7 +241,7 @@ public int hashCode() { hash = (37 * hash) + FAMILIES_FIELD_NUMBER; hash = (53 * hash) + getFamiliesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -327,38 +282,38 @@ public static com.google.bigtable.v2.Row parseFrom( public static com.google.bigtable.v2.Row parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -381,10 +336,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -395,7 +351,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.Row} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -404,7 +360,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Row_fieldAccessorTable @@ -413,32 +369,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.Row.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getFamiliesFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; key_ = com.google.protobuf.ByteString.EMPTY; - if (familiesBuilder_ == null) { families_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + families_ = null; familiesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -464,52 +412,31 @@ public com.google.bigtable.v2.Row build() { @java.lang.Override public com.google.bigtable.v2.Row buildPartial() { com.google.bigtable.v2.Row result = new com.google.bigtable.v2.Row(this); - int from_bitField0_ = bitField0_; - result.key_ = key_; + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.bigtable.v2.Row result) { if (familiesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { families_ = java.util.Collections.unmodifiableList(families_); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } result.families_ = families_; } else { result.families_ = familiesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.bigtable.v2.Row result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } } @java.lang.Override @@ -524,14 +451,14 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.Row other) { if (other == com.google.bigtable.v2.Row.getDefaultInstance()) return this; - if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getKey().isEmpty()) { setKey(other.getKey()); } if (familiesBuilder_ == null) { if (!other.families_.isEmpty()) { if (families_.isEmpty()) { families_ = other.families_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureFamiliesIsMutable(); families_.addAll(other.families_); @@ -544,17 +471,17 @@ public Builder mergeFrom(com.google.bigtable.v2.Row other) { familiesBuilder_.dispose(); familiesBuilder_ = null; families_ = other.families_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); familiesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getFamiliesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFamiliesFieldBuilder() : null; } else { familiesBuilder_.addAllMessages(other.families_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -569,23 +496,56 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.Row parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.Row) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; private com.google.protobuf.ByteString key_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -603,6 +563,7 @@ public Builder mergeFrom( public com.google.protobuf.ByteString getKey() { return key_; } + /** * * @@ -621,11 +582,12 @@ public Builder setKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -640,7 +602,7 @@ public Builder setKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearKey() { - + bitField0_ = (bitField0_ & ~0x00000001); key_ = getDefaultInstance().getKey(); onChanged(); return this; @@ -650,13 +612,13 @@ public Builder clearKey() { java.util.Collections.emptyList(); private void ensureFamiliesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { families_ = new java.util.ArrayList(families_); - bitField0_ |= 0x00000001; + bitField0_ |= 0x00000002; } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Family, com.google.bigtable.v2.Family.Builder, com.google.bigtable.v2.FamilyOrBuilder> @@ -679,6 +641,7 @@ public java.util.List getFamiliesList() { return familiesBuilder_.getMessageList(); } } + /** * * @@ -696,6 +659,7 @@ public int getFamiliesCount() { return familiesBuilder_.getCount(); } } + /** * * @@ -713,6 +677,7 @@ public com.google.bigtable.v2.Family getFamilies(int index) { return familiesBuilder_.getMessage(index); } } + /** * * @@ -736,6 +701,7 @@ public Builder setFamilies(int index, com.google.bigtable.v2.Family value) { } return this; } + /** * * @@ -756,6 +722,7 @@ public Builder setFamilies(int index, com.google.bigtable.v2.Family.Builder buil } return this; } + /** * * @@ -779,6 +746,7 @@ public Builder addFamilies(com.google.bigtable.v2.Family value) { } return this; } + /** * * @@ -802,6 +770,7 @@ public Builder addFamilies(int index, com.google.bigtable.v2.Family value) { } return this; } + /** * * @@ -822,6 +791,7 @@ public Builder addFamilies(com.google.bigtable.v2.Family.Builder builderForValue } return this; } + /** * * @@ -842,6 +812,7 @@ public Builder addFamilies(int index, com.google.bigtable.v2.Family.Builder buil } return this; } + /** * * @@ -863,6 +834,7 @@ public Builder addAllFamilies( } return this; } + /** * * @@ -876,13 +848,14 @@ public Builder addAllFamilies( public Builder clearFamilies() { if (familiesBuilder_ == null) { families_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { familiesBuilder_.clear(); } return this; } + /** * * @@ -903,6 +876,7 @@ public Builder removeFamilies(int index) { } return this; } + /** * * @@ -914,8 +888,9 @@ public Builder removeFamilies(int index) { * repeated .google.bigtable.v2.Family families = 2; */ public com.google.bigtable.v2.Family.Builder getFamiliesBuilder(int index) { - return getFamiliesFieldBuilder().getBuilder(index); + return internalGetFamiliesFieldBuilder().getBuilder(index); } + /** * * @@ -933,6 +908,7 @@ public com.google.bigtable.v2.FamilyOrBuilder getFamiliesOrBuilder(int index) { return familiesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -951,6 +927,7 @@ public com.google.bigtable.v2.FamilyOrBuilder getFamiliesOrBuilder(int index) { return java.util.Collections.unmodifiableList(families_); } } + /** * * @@ -962,9 +939,10 @@ public com.google.bigtable.v2.FamilyOrBuilder getFamiliesOrBuilder(int index) { * repeated .google.bigtable.v2.Family families = 2; */ public com.google.bigtable.v2.Family.Builder addFamiliesBuilder() { - return getFamiliesFieldBuilder() + return internalGetFamiliesFieldBuilder() .addBuilder(com.google.bigtable.v2.Family.getDefaultInstance()); } + /** * * @@ -976,9 +954,10 @@ public com.google.bigtable.v2.Family.Builder addFamiliesBuilder() { * repeated .google.bigtable.v2.Family families = 2; */ public com.google.bigtable.v2.Family.Builder addFamiliesBuilder(int index) { - return getFamiliesFieldBuilder() + return internalGetFamiliesFieldBuilder() .addBuilder(index, com.google.bigtable.v2.Family.getDefaultInstance()); } + /** * * @@ -990,37 +969,26 @@ public com.google.bigtable.v2.Family.Builder addFamiliesBuilder(int index) { * repeated .google.bigtable.v2.Family families = 2; */ public java.util.List getFamiliesBuilderList() { - return getFamiliesFieldBuilder().getBuilderList(); + return internalGetFamiliesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Family, com.google.bigtable.v2.Family.Builder, com.google.bigtable.v2.FamilyOrBuilder> - getFamiliesFieldBuilder() { + internalGetFamiliesFieldBuilder() { if (familiesBuilder_ == null) { familiesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.Family, com.google.bigtable.v2.Family.Builder, com.google.bigtable.v2.FamilyOrBuilder>( - families_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + families_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); families_ = null; } return familiesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Row) } @@ -1042,7 +1010,18 @@ public Row parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Row(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java index d66bc4ee94..7de898b4f3 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -29,9 +31,11 @@ * 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 @@ -41,259 +45,52 @@ * `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 4096 bytes, and RowFilters may not be nested within each other + * exceed 20480 bytes, and RowFilters may not be nested within each other * (in Chains or Interleaves) to a depth of more than 20. * * * Protobuf type {@code google.bigtable.v2.RowFilter} */ -public final class RowFilter extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use RowFilter.newBuilder() to construct. - private RowFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RowFilter() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RowFilter(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RowFilter"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use RowFilter.newBuilder() to construct. + private RowFilter(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private RowFilter( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - com.google.bigtable.v2.RowFilter.Chain.Builder subBuilder = null; - if (filterCase_ == 1) { - subBuilder = ((com.google.bigtable.v2.RowFilter.Chain) filter_).toBuilder(); - } - filter_ = - input.readMessage( - com.google.bigtable.v2.RowFilter.Chain.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.RowFilter.Chain) filter_); - filter_ = subBuilder.buildPartial(); - } - filterCase_ = 1; - break; - } - case 18: - { - com.google.bigtable.v2.RowFilter.Interleave.Builder subBuilder = null; - if (filterCase_ == 2) { - subBuilder = ((com.google.bigtable.v2.RowFilter.Interleave) filter_).toBuilder(); - } - filter_ = - input.readMessage( - com.google.bigtable.v2.RowFilter.Interleave.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.RowFilter.Interleave) filter_); - filter_ = subBuilder.buildPartial(); - } - filterCase_ = 2; - break; - } - case 26: - { - com.google.bigtable.v2.RowFilter.Condition.Builder subBuilder = null; - if (filterCase_ == 3) { - subBuilder = ((com.google.bigtable.v2.RowFilter.Condition) filter_).toBuilder(); - } - filter_ = - input.readMessage( - com.google.bigtable.v2.RowFilter.Condition.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.RowFilter.Condition) filter_); - filter_ = subBuilder.buildPartial(); - } - filterCase_ = 3; - break; - } - case 34: - { - filterCase_ = 4; - filter_ = input.readBytes(); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - filterCase_ = 5; - filter_ = s; - break; - } - case 50: - { - filterCase_ = 6; - filter_ = input.readBytes(); - break; - } - case 58: - { - com.google.bigtable.v2.ColumnRange.Builder subBuilder = null; - if (filterCase_ == 7) { - subBuilder = ((com.google.bigtable.v2.ColumnRange) filter_).toBuilder(); - } - filter_ = - input.readMessage(com.google.bigtable.v2.ColumnRange.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.ColumnRange) filter_); - filter_ = subBuilder.buildPartial(); - } - filterCase_ = 7; - break; - } - case 66: - { - com.google.bigtable.v2.TimestampRange.Builder subBuilder = null; - if (filterCase_ == 8) { - subBuilder = ((com.google.bigtable.v2.TimestampRange) filter_).toBuilder(); - } - filter_ = - input.readMessage( - com.google.bigtable.v2.TimestampRange.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.TimestampRange) filter_); - filter_ = subBuilder.buildPartial(); - } - filterCase_ = 8; - break; - } - case 74: - { - filterCase_ = 9; - filter_ = input.readBytes(); - break; - } - case 80: - { - filterCase_ = 10; - filter_ = input.readInt32(); - break; - } - case 88: - { - filterCase_ = 11; - filter_ = input.readInt32(); - break; - } - case 96: - { - filterCase_ = 12; - filter_ = input.readInt32(); - break; - } - case 104: - { - filterCase_ = 13; - filter_ = input.readBool(); - break; - } - case 113: - { - filterCase_ = 14; - filter_ = input.readDouble(); - break; - } - case 122: - { - com.google.bigtable.v2.ValueRange.Builder subBuilder = null; - if (filterCase_ == 15) { - subBuilder = ((com.google.bigtable.v2.ValueRange) filter_).toBuilder(); - } - filter_ = - input.readMessage(com.google.bigtable.v2.ValueRange.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.v2.ValueRange) filter_); - filter_ = subBuilder.buildPartial(); - } - filterCase_ = 15; - break; - } - case 128: - { - filterCase_ = 16; - filter_ = input.readBool(); - break; - } - case 136: - { - filterCase_ = 17; - filter_ = input.readBool(); - break; - } - case 144: - { - filterCase_ = 18; - filter_ = input.readBool(); - break; - } - case 154: - { - java.lang.String s = input.readStringRequireUtf8(); - filterCase_ = 19; - filter_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable @@ -318,6 +115,7 @@ public interface ChainOrBuilder * repeated .google.bigtable.v2.RowFilter filters = 1; */ java.util.List getFiltersList(); + /** * * @@ -330,6 +128,7 @@ public interface ChainOrBuilder * repeated .google.bigtable.v2.RowFilter filters = 1; */ com.google.bigtable.v2.RowFilter getFilters(int index); + /** * * @@ -342,6 +141,7 @@ public interface ChainOrBuilder * repeated .google.bigtable.v2.RowFilter filters = 1; */ int getFiltersCount(); + /** * * @@ -354,6 +154,7 @@ public interface ChainOrBuilder * repeated .google.bigtable.v2.RowFilter filters = 1; */ java.util.List getFiltersOrBuilderList(); + /** * * @@ -367,6 +168,7 @@ public interface ChainOrBuilder */ com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index); } + /** * * @@ -376,13 +178,24 @@ public interface ChainOrBuilder * * Protobuf type {@code google.bigtable.v2.RowFilter.Chain} */ - public static final class Chain extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private Chain(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -390,76 +203,13 @@ private Chain() { filters_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Chain(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Chain( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - filters_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - filters_.add( - input.readMessage( - com.google.bigtable.v2.RowFilter.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - filters_ = java.util.Collections.unmodifiableList(filters_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable @@ -469,7 +219,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int FILTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List filters_; + /** * * @@ -485,6 +238,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getFiltersList() { return filters_; } + /** * * @@ -501,6 +255,7 @@ public java.util.List getFiltersList() { getFiltersOrBuilderList() { return filters_; } + /** * * @@ -516,6 +271,7 @@ public java.util.List getFiltersList() { public int getFiltersCount() { return filters_.size(); } + /** * * @@ -531,6 +287,7 @@ public int getFiltersCount() { public com.google.bigtable.v2.RowFilter getFilters(int index) { return filters_.get(index); } + /** * * @@ -564,7 +321,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < filters_.size(); i++) { output.writeMessage(1, filters_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -576,7 +333,7 @@ public int getSerializedSize() { for (int i = 0; i < filters_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, filters_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -592,7 +349,7 @@ public boolean equals(final java.lang.Object obj) { com.google.bigtable.v2.RowFilter.Chain other = (com.google.bigtable.v2.RowFilter.Chain) obj; if (!getFiltersList().equals(other.getFiltersList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -607,7 +364,7 @@ public int hashCode() { hash = (37 * hash) + FILTERS_FIELD_NUMBER; hash = (53 * hash) + getFiltersList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -649,38 +406,38 @@ public static com.google.bigtable.v2.RowFilter.Chain parseFrom( public static com.google.bigtable.v2.RowFilter.Chain parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -703,11 +460,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -717,8 +474,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.RowFilter.Chain} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -728,7 +484,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowFilter_Chain_fieldAccessorTable @@ -738,30 +494,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.RowFilter.Chain.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getFiltersFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (filtersBuilder_ == null) { filters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + filters_ = null; filtersBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -789,7 +538,15 @@ public com.google.bigtable.v2.RowFilter.Chain build() { public com.google.bigtable.v2.RowFilter.Chain buildPartial() { com.google.bigtable.v2.RowFilter.Chain result = new com.google.bigtable.v2.RowFilter.Chain(this); - int from_bitField0_ = bitField0_; + 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_); @@ -799,43 +556,10 @@ public com.google.bigtable.v2.RowFilter.Chain buildPartial() { } else { result.filters_ = filtersBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.bigtable.v2.RowFilter.Chain result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -869,15 +593,15 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Chain other) { filters_ = other.filters_; bitField0_ = (bitField0_ & ~0x00000001); filtersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getFiltersFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFiltersFieldBuilder() : null; } else { filtersBuilder_.addAllMessages(other.filters_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -892,17 +616,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.RowFilter.Chain parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.RowFilter.Chain) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -918,7 +669,7 @@ private void ensureFiltersIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> @@ -942,6 +693,7 @@ public java.util.List getFiltersList() { return filtersBuilder_.getMessageList(); } } + /** * * @@ -960,6 +712,7 @@ public int getFiltersCount() { return filtersBuilder_.getCount(); } } + /** * * @@ -978,6 +731,7 @@ public com.google.bigtable.v2.RowFilter getFilters(int index) { return filtersBuilder_.getMessage(index); } } + /** * * @@ -1002,6 +756,7 @@ public Builder setFilters(int index, com.google.bigtable.v2.RowFilter value) { } return this; } + /** * * @@ -1024,6 +779,7 @@ public Builder setFilters( } return this; } + /** * * @@ -1048,6 +804,7 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter value) { } return this; } + /** * * @@ -1072,6 +829,7 @@ public Builder addFilters(int index, com.google.bigtable.v2.RowFilter value) { } return this; } + /** * * @@ -1093,6 +851,7 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter.Builder builderForVal } return this; } + /** * * @@ -1115,6 +874,7 @@ public Builder addFilters( } return this; } + /** * * @@ -1137,6 +897,7 @@ public Builder addAllFilters( } return this; } + /** * * @@ -1158,6 +919,7 @@ public Builder clearFilters() { } return this; } + /** * * @@ -1179,6 +941,7 @@ public Builder removeFilters(int index) { } return this; } + /** * * @@ -1191,8 +954,9 @@ public Builder removeFilters(int index) { * repeated .google.bigtable.v2.RowFilter filters = 1; */ public com.google.bigtable.v2.RowFilter.Builder getFiltersBuilder(int index) { - return getFiltersFieldBuilder().getBuilder(index); + return internalGetFiltersFieldBuilder().getBuilder(index); } + /** * * @@ -1211,6 +975,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) return filtersBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1230,6 +995,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) return java.util.Collections.unmodifiableList(filters_); } } + /** * * @@ -1242,9 +1008,10 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) * repeated .google.bigtable.v2.RowFilter filters = 1; */ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder() { - return getFiltersFieldBuilder() + return internalGetFiltersFieldBuilder() .addBuilder(com.google.bigtable.v2.RowFilter.getDefaultInstance()); } + /** * * @@ -1257,9 +1024,10 @@ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder() { * repeated .google.bigtable.v2.RowFilter filters = 1; */ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder(int index) { - return getFiltersFieldBuilder() + return internalGetFiltersFieldBuilder() .addBuilder(index, com.google.bigtable.v2.RowFilter.getDefaultInstance()); } + /** * * @@ -1272,17 +1040,17 @@ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder(int index) { * repeated .google.bigtable.v2.RowFilter filters = 1; */ public java.util.List getFiltersBuilderList() { - return getFiltersFieldBuilder().getBuilderList(); + return internalGetFiltersFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> - getFiltersFieldBuilder() { + internalGetFiltersFieldBuilder() { if (filtersBuilder_ == null) { filtersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder>( @@ -1292,18 +1060,6 @@ public java.util.List getFiltersBuilde return filtersBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter.Chain) } @@ -1325,7 +1081,19 @@ public Chain parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Chain(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -1358,29 +1126,32 @@ public interface InterleaveOrBuilder * 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 + * + * 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(); + /** * * @@ -1390,29 +1161,32 @@ public interface InterleaveOrBuilder * 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 + * + * 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); + /** * * @@ -1422,29 +1196,32 @@ public interface InterleaveOrBuilder * 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 + * + * 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(); + /** * * @@ -1454,29 +1231,32 @@ public interface InterleaveOrBuilder * 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 + * + * 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(); + /** * * @@ -1486,23 +1266,25 @@ public interface InterleaveOrBuilder * 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 + * + * 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. * * @@ -1510,6 +1292,7 @@ public interface InterleaveOrBuilder */ com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index); } + /** * * @@ -1520,13 +1303,24 @@ public interface InterleaveOrBuilder * * Protobuf type {@code google.bigtable.v2.RowFilter.Interleave} */ - public static final class Interleave extends com.google.protobuf.GeneratedMessageV3 + 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.GeneratedMessageV3.Builder builder) { + private Interleave(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -1534,76 +1328,13 @@ private Interleave() { filters_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Interleave(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Interleave( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - filters_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - filters_.add( - input.readMessage( - com.google.bigtable.v2.RowFilter.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - filters_ = java.util.Collections.unmodifiableList(filters_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable @@ -1613,7 +1344,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int FILTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List filters_; + /** * * @@ -1623,23 +1357,25 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * 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 + * + * 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. * * @@ -1649,6 +1385,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getFiltersList() { return filters_; } + /** * * @@ -1658,23 +1395,25 @@ public java.util.List getFiltersList() { * 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 + * + * 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. * * @@ -1685,6 +1424,7 @@ public java.util.List getFiltersList() { getFiltersOrBuilderList() { return filters_; } + /** * * @@ -1694,23 +1434,25 @@ public java.util.List getFiltersList() { * 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 + * + * 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. * * @@ -1720,6 +1462,7 @@ public java.util.List getFiltersList() { public int getFiltersCount() { return filters_.size(); } + /** * * @@ -1729,23 +1472,25 @@ public int getFiltersCount() { * 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 + * + * 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. * * @@ -1755,6 +1500,7 @@ public int getFiltersCount() { public com.google.bigtable.v2.RowFilter getFilters(int index) { return filters_.get(index); } + /** * * @@ -1764,23 +1510,25 @@ public com.google.bigtable.v2.RowFilter getFilters(int index) { * 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 + * + * 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. * * @@ -1808,7 +1556,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < filters_.size(); i++) { output.writeMessage(1, filters_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1820,7 +1568,7 @@ public int getSerializedSize() { for (int i = 0; i < filters_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, filters_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1837,7 +1585,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.v2.RowFilter.Interleave) obj; if (!getFiltersList().equals(other.getFiltersList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1852,7 +1600,7 @@ public int hashCode() { hash = (37 * hash) + FILTERS_FIELD_NUMBER; hash = (53 * hash) + getFiltersList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1894,38 +1642,38 @@ public static com.google.bigtable.v2.RowFilter.Interleave parseFrom( public static com.google.bigtable.v2.RowFilter.Interleave parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -1948,11 +1696,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -1963,8 +1711,7 @@ protected Builder newBuilderForType( * * Protobuf type {@code google.bigtable.v2.RowFilter.Interleave} */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -1974,7 +1721,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowFilter_Interleave_fieldAccessorTable @@ -1984,30 +1731,23 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.RowFilter.Interleave.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getFiltersFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; if (filtersBuilder_ == null) { filters_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); } else { + filters_ = null; filtersBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -2035,7 +1775,15 @@ public com.google.bigtable.v2.RowFilter.Interleave build() { public com.google.bigtable.v2.RowFilter.Interleave buildPartial() { com.google.bigtable.v2.RowFilter.Interleave result = new com.google.bigtable.v2.RowFilter.Interleave(this); - int from_bitField0_ = bitField0_; + 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_); @@ -2045,43 +1793,10 @@ public com.google.bigtable.v2.RowFilter.Interleave buildPartial() { } else { result.filters_ = filtersBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + private void buildPartial0(com.google.bigtable.v2.RowFilter.Interleave result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -2115,15 +1830,15 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Interleave other) { filters_ = other.filters_; bitField0_ = (bitField0_ & ~0x00000001); filtersBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getFiltersFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetFiltersFieldBuilder() : null; } else { filtersBuilder_.addAllMessages(other.filters_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2138,17 +1853,44 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.RowFilter.Interleave parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.RowFilter.Interleave) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2164,7 +1906,7 @@ private void ensureFiltersIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> @@ -2179,23 +1921,25 @@ private void ensureFiltersIsMutable() { * 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 + * + * 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. * * @@ -2208,6 +1952,7 @@ public java.util.List getFiltersList() { return filtersBuilder_.getMessageList(); } } + /** * * @@ -2217,23 +1962,25 @@ public java.util.List getFiltersList() { * 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 + * + * 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. * * @@ -2246,6 +1993,7 @@ public int getFiltersCount() { return filtersBuilder_.getCount(); } } + /** * * @@ -2255,23 +2003,25 @@ public int getFiltersCount() { * 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 + * + * 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. * * @@ -2284,6 +2034,7 @@ public com.google.bigtable.v2.RowFilter getFilters(int index) { return filtersBuilder_.getMessage(index); } } + /** * * @@ -2293,23 +2044,25 @@ public com.google.bigtable.v2.RowFilter getFilters(int index) { * 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 + * + * 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. * * @@ -2328,6 +2081,7 @@ public Builder setFilters(int index, com.google.bigtable.v2.RowFilter value) { } return this; } + /** * * @@ -2337,23 +2091,25 @@ public Builder setFilters(int index, com.google.bigtable.v2.RowFilter value) { * 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 + * + * 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. * * @@ -2370,6 +2126,7 @@ public Builder setFilters( } return this; } + /** * * @@ -2379,23 +2136,25 @@ public Builder setFilters( * 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 + * + * 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. * * @@ -2414,6 +2173,7 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter value) { } return this; } + /** * * @@ -2423,23 +2183,25 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter value) { * 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 + * + * 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. * * @@ -2458,6 +2220,7 @@ public Builder addFilters(int index, com.google.bigtable.v2.RowFilter value) { } return this; } + /** * * @@ -2467,23 +2230,25 @@ public Builder addFilters(int index, com.google.bigtable.v2.RowFilter value) { * 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 + * + * 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. * * @@ -2499,6 +2264,7 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter.Builder builderForVal } return this; } + /** * * @@ -2508,23 +2274,25 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter.Builder builderForVal * 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 + * + * 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. * * @@ -2541,6 +2309,7 @@ public Builder addFilters( } return this; } + /** * * @@ -2550,23 +2319,25 @@ public Builder addFilters( * 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 + * + * 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. * * @@ -2583,6 +2354,7 @@ public Builder addAllFilters( } return this; } + /** * * @@ -2592,23 +2364,25 @@ public Builder addAllFilters( * 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 + * + * 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. * * @@ -2624,6 +2398,7 @@ public Builder clearFilters() { } return this; } + /** * * @@ -2633,23 +2408,25 @@ public Builder clearFilters() { * 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 + * + * 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. * * @@ -2665,6 +2442,7 @@ public Builder removeFilters(int index) { } return this; } + /** * * @@ -2674,31 +2452,34 @@ public Builder removeFilters(int index) { * 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 + * + * 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 getFiltersFieldBuilder().getBuilder(index); + return internalGetFiltersFieldBuilder().getBuilder(index); } + /** * * @@ -2708,23 +2489,25 @@ public com.google.bigtable.v2.RowFilter.Builder getFiltersBuilder(int index) { * 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 + * + * 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. * * @@ -2737,6 +2520,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) return filtersBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -2746,23 +2530,25 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) * 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 + * + * 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. * * @@ -2776,6 +2562,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) return java.util.Collections.unmodifiableList(filters_); } } + /** * * @@ -2785,32 +2572,35 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) * 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 + * + * 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 getFiltersFieldBuilder() + return internalGetFiltersFieldBuilder() .addBuilder(com.google.bigtable.v2.RowFilter.getDefaultInstance()); } + /** * * @@ -2820,32 +2610,35 @@ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder() { * 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 + * + * 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 getFiltersFieldBuilder() + return internalGetFiltersFieldBuilder() .addBuilder(index, com.google.bigtable.v2.RowFilter.getDefaultInstance()); } + /** * * @@ -2855,40 +2648,42 @@ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder(int index) { * 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 + * + * 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 getFiltersFieldBuilder().getBuilderList(); + return internalGetFiltersFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder> - getFiltersFieldBuilder() { + internalGetFiltersFieldBuilder() { if (filtersBuilder_ == null) { filtersBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowFilter, com.google.bigtable.v2.RowFilter.Builder, com.google.bigtable.v2.RowFilterOrBuilder>( @@ -2898,18 +2693,6 @@ public java.util.List getFiltersBuilde return filtersBuilder_; } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter.Interleave) } @@ -2931,7 +2714,19 @@ public Interleave parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Interleave(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; @@ -2968,6 +2763,7 @@ public interface ConditionOrBuilder * @return Whether the predicateFilter field is set. */ boolean hasPredicateFilter(); + /** * * @@ -2981,6 +2777,7 @@ public interface ConditionOrBuilder * @return The predicateFilter. */ com.google.bigtable.v2.RowFilter getPredicateFilter(); + /** * * @@ -3006,6 +2803,7 @@ public interface ConditionOrBuilder * @return Whether the trueFilter field is set. */ boolean hasTrueFilter(); + /** * * @@ -3019,6 +2817,7 @@ public interface ConditionOrBuilder * @return The trueFilter. */ com.google.bigtable.v2.RowFilter getTrueFilter(); + /** * * @@ -3045,6 +2844,7 @@ public interface ConditionOrBuilder * @return Whether the falseFilter field is set. */ boolean hasFalseFilter(); + /** * * @@ -3059,6 +2859,7 @@ public interface ConditionOrBuilder * @return The falseFilter. */ com.google.bigtable.v2.RowFilter getFalseFilter(); + /** * * @@ -3072,12 +2873,14 @@ public interface ConditionOrBuilder */ 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
    @@ -3086,110 +2889,28 @@ public interface ConditionOrBuilder
        *
        * Protobuf type {@code google.bigtable.v2.RowFilter.Condition}
        */
    -  public static final class Condition extends com.google.protobuf.GeneratedMessageV3
    +  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;
    -    // Use Condition.newBuilder() to construct.
    -    private Condition(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    -      super(builder);
    -    }
    -
    -    private Condition() {}
     
    -    @java.lang.Override
    -    @SuppressWarnings({"unused"})
    -    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    -      return new Condition();
    +    static {
    +      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
    +          com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
    +          /* major= */ 4,
    +          /* minor= */ 33,
    +          /* patch= */ 2,
    +          /* suffix= */ "",
    +          "Condition");
         }
     
    -    @java.lang.Override
    -    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -      return this.unknownFields;
    +    // Use Condition.newBuilder() to construct.
    +    private Condition(com.google.protobuf.GeneratedMessage.Builder builder) {
    +      super(builder);
         }
     
    -    private Condition(
    -        com.google.protobuf.CodedInputStream input,
    -        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
    -        throws com.google.protobuf.InvalidProtocolBufferException {
    -      this();
    -      if (extensionRegistry == null) {
    -        throw new java.lang.NullPointerException();
    -      }
    -      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
    -          com.google.protobuf.UnknownFieldSet.newBuilder();
    -      try {
    -        boolean done = false;
    -        while (!done) {
    -          int tag = input.readTag();
    -          switch (tag) {
    -            case 0:
    -              done = true;
    -              break;
    -            case 10:
    -              {
    -                com.google.bigtable.v2.RowFilter.Builder subBuilder = null;
    -                if (predicateFilter_ != null) {
    -                  subBuilder = predicateFilter_.toBuilder();
    -                }
    -                predicateFilter_ =
    -                    input.readMessage(com.google.bigtable.v2.RowFilter.parser(), extensionRegistry);
    -                if (subBuilder != null) {
    -                  subBuilder.mergeFrom(predicateFilter_);
    -                  predicateFilter_ = subBuilder.buildPartial();
    -                }
    -
    -                break;
    -              }
    -            case 18:
    -              {
    -                com.google.bigtable.v2.RowFilter.Builder subBuilder = null;
    -                if (trueFilter_ != null) {
    -                  subBuilder = trueFilter_.toBuilder();
    -                }
    -                trueFilter_ =
    -                    input.readMessage(com.google.bigtable.v2.RowFilter.parser(), extensionRegistry);
    -                if (subBuilder != null) {
    -                  subBuilder.mergeFrom(trueFilter_);
    -                  trueFilter_ = subBuilder.buildPartial();
    -                }
    -
    -                break;
    -              }
    -            case 26:
    -              {
    -                com.google.bigtable.v2.RowFilter.Builder subBuilder = null;
    -                if (falseFilter_ != null) {
    -                  subBuilder = falseFilter_.toBuilder();
    -                }
    -                falseFilter_ =
    -                    input.readMessage(com.google.bigtable.v2.RowFilter.parser(), extensionRegistry);
    -                if (subBuilder != null) {
    -                  subBuilder.mergeFrom(falseFilter_);
    -                  falseFilter_ = subBuilder.buildPartial();
    -                }
    -
    -                break;
    -              }
    -            default:
    -              {
    -                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
    -                  done = true;
    -                }
    -                break;
    -              }
    -          }
    -        }
    -      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    -        throw e.setUnfinishedMessage(this);
    -      } catch (java.io.IOException e) {
    -        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    -      } finally {
    -        this.unknownFields = unknownFields.build();
    -        makeExtensionsImmutable();
    -      }
    -    }
    +    private Condition() {}
     
         public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           return com.google.bigtable.v2.DataProto
    @@ -3197,7 +2918,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         @java.lang.Override
    -    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
             internalGetFieldAccessorTable() {
           return com.google.bigtable.v2.DataProto
               .internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable
    @@ -3206,8 +2927,10 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
                   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_;
    +
         /**
          *
          *
    @@ -3222,8 +2945,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          */
         @java.lang.Override
         public boolean hasPredicateFilter() {
    -      return predicateFilter_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
    +
         /**
          *
          *
    @@ -3242,6 +2966,7 @@ public com.google.bigtable.v2.RowFilter getPredicateFilter() {
               ? com.google.bigtable.v2.RowFilter.getDefaultInstance()
               : predicateFilter_;
         }
    +
         /**
          *
          *
    @@ -3254,11 +2979,14 @@ public com.google.bigtable.v2.RowFilter getPredicateFilter() {
          */
         @java.lang.Override
         public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
    -      return getPredicateFilter();
    +      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_;
    +
         /**
          *
          *
    @@ -3273,8 +3001,9 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
          */
         @java.lang.Override
         public boolean hasTrueFilter() {
    -      return trueFilter_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
    +
         /**
          *
          *
    @@ -3293,6 +3022,7 @@ public com.google.bigtable.v2.RowFilter getTrueFilter() {
               ? com.google.bigtable.v2.RowFilter.getDefaultInstance()
               : trueFilter_;
         }
    +
         /**
          *
          *
    @@ -3305,11 +3035,14 @@ public com.google.bigtable.v2.RowFilter getTrueFilter() {
          */
         @java.lang.Override
         public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
    -      return getTrueFilter();
    +      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_;
    +
         /**
          *
          *
    @@ -3325,8 +3058,9 @@ public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
          */
         @java.lang.Override
         public boolean hasFalseFilter() {
    -      return falseFilter_ != null;
    +      return ((bitField0_ & 0x00000004) != 0);
         }
    +
         /**
          *
          *
    @@ -3346,6 +3080,7 @@ public com.google.bigtable.v2.RowFilter getFalseFilter() {
               ? com.google.bigtable.v2.RowFilter.getDefaultInstance()
               : falseFilter_;
         }
    +
         /**
          *
          *
    @@ -3359,7 +3094,9 @@ public com.google.bigtable.v2.RowFilter getFalseFilter() {
          */
         @java.lang.Override
         public com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder() {
    -      return getFalseFilter();
    +      return falseFilter_ == null
    +          ? com.google.bigtable.v2.RowFilter.getDefaultInstance()
    +          : falseFilter_;
         }
     
         private byte memoizedIsInitialized = -1;
    @@ -3376,16 +3113,16 @@ public final boolean isInitialized() {
     
         @java.lang.Override
         public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    -      if (predicateFilter_ != null) {
    +      if (((bitField0_ & 0x00000001) != 0)) {
             output.writeMessage(1, getPredicateFilter());
           }
    -      if (trueFilter_ != null) {
    +      if (((bitField0_ & 0x00000002) != 0)) {
             output.writeMessage(2, getTrueFilter());
           }
    -      if (falseFilter_ != null) {
    +      if (((bitField0_ & 0x00000004) != 0)) {
             output.writeMessage(3, getFalseFilter());
           }
    -      unknownFields.writeTo(output);
    +      getUnknownFields().writeTo(output);
         }
     
         @java.lang.Override
    @@ -3394,16 +3131,16 @@ public int getSerializedSize() {
           if (size != -1) return size;
     
           size = 0;
    -      if (predicateFilter_ != null) {
    +      if (((bitField0_ & 0x00000001) != 0)) {
             size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getPredicateFilter());
           }
    -      if (trueFilter_ != null) {
    +      if (((bitField0_ & 0x00000002) != 0)) {
             size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getTrueFilter());
           }
    -      if (falseFilter_ != null) {
    +      if (((bitField0_ & 0x00000004) != 0)) {
             size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getFalseFilter());
           }
    -      size += unknownFields.getSerializedSize();
    +      size += getUnknownFields().getSerializedSize();
           memoizedSize = size;
           return size;
         }
    @@ -3431,7 +3168,7 @@ public boolean equals(final java.lang.Object obj) {
           if (hasFalseFilter()) {
             if (!getFalseFilter().equals(other.getFalseFilter())) return false;
           }
    -      if (!unknownFields.equals(other.unknownFields)) return false;
    +      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
           return true;
         }
     
    @@ -3454,7 +3191,7 @@ public int hashCode() {
             hash = (37 * hash) + FALSE_FILTER_FIELD_NUMBER;
             hash = (53 * hash) + getFalseFilter().hashCode();
           }
    -      hash = (29 * hash) + unknownFields.hashCode();
    +      hash = (29 * hash) + getUnknownFields().hashCode();
           memoizedHashCode = hash;
           return hash;
         }
    @@ -3496,38 +3233,38 @@ public static com.google.bigtable.v2.RowFilter.Condition parseFrom(
     
         public static com.google.bigtable.v2.RowFilter.Condition parseFrom(java.io.InputStream input)
             throws java.io.IOException {
    -      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseWithIOException(
    +      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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseDelimitedWithIOException(
    +      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.GeneratedMessageV3.parseWithIOException(PARSER, input);
    +      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.GeneratedMessageV3.parseWithIOException(
    +      return com.google.protobuf.GeneratedMessage.parseWithIOException(
               PARSER, input, extensionRegistry);
         }
     
    @@ -3550,17 +3287,18 @@ public Builder toBuilder() {
         }
     
         @java.lang.Override
    -    protected Builder newBuilderForType(
    -        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +    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
    @@ -3569,8 +3307,7 @@ protected Builder newBuilderForType(
          *
          * Protobuf type {@code google.bigtable.v2.RowFilter.Condition}
          */
    -    public static final class Builder
    -        extends com.google.protobuf.GeneratedMessageV3.Builder
    +    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 {
    @@ -3580,7 +3317,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           }
     
           @java.lang.Override
    -      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
    +      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
               internalGetFieldAccessorTable() {
             return com.google.bigtable.v2.DataProto
                 .internal_static_google_bigtable_v2_RowFilter_Condition_fieldAccessorTable
    @@ -3594,34 +3331,36 @@ private Builder() {
             maybeForceBuilderInitialization();
           }
     
    -      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    +      private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
             super(parent);
             maybeForceBuilderInitialization();
           }
     
           private void maybeForceBuilderInitialization() {
    -        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
    +          internalGetPredicateFilterFieldBuilder();
    +          internalGetTrueFilterFieldBuilder();
    +          internalGetFalseFilterFieldBuilder();
    +        }
           }
     
           @java.lang.Override
           public Builder clear() {
             super.clear();
    -        if (predicateFilterBuilder_ == null) {
    -          predicateFilter_ = null;
    -        } else {
    -          predicateFilter_ = null;
    +        bitField0_ = 0;
    +        predicateFilter_ = null;
    +        if (predicateFilterBuilder_ != null) {
    +          predicateFilterBuilder_.dispose();
               predicateFilterBuilder_ = null;
             }
    -        if (trueFilterBuilder_ == null) {
    -          trueFilter_ = null;
    -        } else {
    -          trueFilter_ = null;
    +        trueFilter_ = null;
    +        if (trueFilterBuilder_ != null) {
    +          trueFilterBuilder_.dispose();
               trueFilterBuilder_ = null;
             }
    -        if (falseFilterBuilder_ == null) {
    -          falseFilter_ = null;
    -        } else {
    -          falseFilter_ = null;
    +        falseFilter_ = null;
    +        if (falseFilterBuilder_ != null) {
    +          falseFilterBuilder_.dispose();
               falseFilterBuilder_ = null;
             }
             return this;
    @@ -3635,74 +3374,48 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
     
           @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 (predicateFilterBuilder_ == null) {
    -          result.predicateFilter_ = predicateFilter_;
    -        } else {
    -          result.predicateFilter_ = predicateFilterBuilder_.build();
    -        }
    -        if (trueFilterBuilder_ == null) {
    -          result.trueFilter_ = trueFilter_;
    -        } else {
    -          result.trueFilter_ = trueFilterBuilder_.build();
    -        }
    -        if (falseFilterBuilder_ == null) {
    -          result.falseFilter_ = falseFilter_;
    -        } else {
    -          result.falseFilter_ = falseFilterBuilder_.build();
    -        }
    -        onBuilt();
    -        return result;
    -      }
    -
    -      @java.lang.Override
    -      public Builder clone() {
    -        return super.clone();
    -      }
    -
    -      @java.lang.Override
    -      public Builder setField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -        return super.setField(field, value);
    -      }
    -
    -      @java.lang.Override
    -      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
    -        return super.clearField(field);
    +        return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance();
           }
     
           @java.lang.Override
    -      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
    -        return super.clearOneof(oneof);
    +      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 Builder setRepeatedField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field,
    -          int index,
    -          java.lang.Object value) {
    -        return super.setRepeatedField(field, index, value);
    +      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;
           }
     
    -      @java.lang.Override
    -      public Builder addRepeatedField(
    -          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
    -        return super.addRepeatedField(field, value);
    +      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
    @@ -3726,7 +3439,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Condition other) {
             if (other.hasFalseFilter()) {
               mergeFalseFilter(other.getFalseFilter());
             }
    -        this.mergeUnknownFields(other.unknownFields);
    +        this.mergeUnknownFields(other.getUnknownFields());
             onChanged();
             return this;
           }
    @@ -3741,26 +3454,64 @@ public Builder mergeFrom(
               com.google.protobuf.CodedInputStream input,
               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
               throws java.io.IOException {
    -        com.google.bigtable.v2.RowFilter.Condition parsedMessage = null;
    +        if (extensionRegistry == null) {
    +          throw new java.lang.NullPointerException();
    +        }
             try {
    -          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
    +          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) {
    -          parsedMessage = (com.google.bigtable.v2.RowFilter.Condition) e.getUnfinishedMessage();
               throw e.unwrapIOException();
             } finally {
    -          if (parsedMessage != null) {
    -            mergeFrom(parsedMessage);
    -          }
    -        }
    +          onChanged();
    +        } // finally
             return this;
           }
     
    +      private int bitField0_;
    +
           private com.google.bigtable.v2.RowFilter predicateFilter_;
    -      private com.google.protobuf.SingleFieldBuilderV3<
    +      private com.google.protobuf.SingleFieldBuilder<
                   com.google.bigtable.v2.RowFilter,
                   com.google.bigtable.v2.RowFilter.Builder,
                   com.google.bigtable.v2.RowFilterOrBuilder>
               predicateFilterBuilder_;
    +
           /**
            *
            *
    @@ -3774,8 +3525,9 @@ public Builder mergeFrom(
            * @return Whether the predicateFilter field is set.
            */
           public boolean hasPredicateFilter() {
    -        return predicateFilterBuilder_ != null || predicateFilter_ != null;
    +        return ((bitField0_ & 0x00000001) != 0);
           }
    +
           /**
            *
            *
    @@ -3797,6 +3549,7 @@ public com.google.bigtable.v2.RowFilter getPredicateFilter() {
               return predicateFilterBuilder_.getMessage();
             }
           }
    +
           /**
            *
            *
    @@ -3813,13 +3566,14 @@ public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter value) {
                 throw new NullPointerException();
               }
               predicateFilter_ = value;
    -          onChanged();
             } else {
               predicateFilterBuilder_.setMessage(value);
             }
    -
    +        bitField0_ |= 0x00000001;
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -3833,13 +3587,14 @@ public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter value) {
           public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) {
             if (predicateFilterBuilder_ == null) {
               predicateFilter_ = builderForValue.build();
    -          onChanged();
             } else {
               predicateFilterBuilder_.setMessage(builderForValue.build());
             }
    -
    +        bitField0_ |= 0x00000001;
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -3852,21 +3607,23 @@ public Builder setPredicateFilter(com.google.bigtable.v2.RowFilter.Builder build
            */
           public Builder mergePredicateFilter(com.google.bigtable.v2.RowFilter value) {
             if (predicateFilterBuilder_ == null) {
    -          if (predicateFilter_ != null) {
    -            predicateFilter_ =
    -                com.google.bigtable.v2.RowFilter.newBuilder(predicateFilter_)
    -                    .mergeFrom(value)
    -                    .buildPartial();
    +          if (((bitField0_ & 0x00000001) != 0)
    +              && predicateFilter_ != null
    +              && predicateFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) {
    +            getPredicateFilterBuilder().mergeFrom(value);
               } else {
                 predicateFilter_ = value;
               }
    -          onChanged();
             } else {
               predicateFilterBuilder_.mergeFrom(value);
             }
    -
    +        if (predicateFilter_ != null) {
    +          bitField0_ |= 0x00000001;
    +          onChanged();
    +        }
             return this;
           }
    +
           /**
            *
            *
    @@ -3878,16 +3635,16 @@ public Builder mergePredicateFilter(com.google.bigtable.v2.RowFilter value) {
            * .google.bigtable.v2.RowFilter predicate_filter = 1;
            */
           public Builder clearPredicateFilter() {
    -        if (predicateFilterBuilder_ == null) {
    -          predicateFilter_ = null;
    -          onChanged();
    -        } else {
    -          predicateFilter_ = null;
    +        bitField0_ = (bitField0_ & ~0x00000001);
    +        predicateFilter_ = null;
    +        if (predicateFilterBuilder_ != null) {
    +          predicateFilterBuilder_.dispose();
               predicateFilterBuilder_ = null;
             }
    -
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -3899,10 +3656,11 @@ public Builder clearPredicateFilter() {
            * .google.bigtable.v2.RowFilter predicate_filter = 1;
            */
           public com.google.bigtable.v2.RowFilter.Builder getPredicateFilterBuilder() {
    -
    +        bitField0_ |= 0x00000001;
             onChanged();
    -        return getPredicateFilterFieldBuilder().getBuilder();
    +        return internalGetPredicateFilterFieldBuilder().getBuilder();
           }
    +
           /**
            *
            *
    @@ -3922,6 +3680,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
                   : predicateFilter_;
             }
           }
    +
           /**
            *
            *
    @@ -3932,14 +3691,14 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
            *
            * .google.bigtable.v2.RowFilter predicate_filter = 1;
            */
    -      private com.google.protobuf.SingleFieldBuilderV3<
    +      private com.google.protobuf.SingleFieldBuilder<
                   com.google.bigtable.v2.RowFilter,
                   com.google.bigtable.v2.RowFilter.Builder,
                   com.google.bigtable.v2.RowFilterOrBuilder>
    -          getPredicateFilterFieldBuilder() {
    +          internalGetPredicateFilterFieldBuilder() {
             if (predicateFilterBuilder_ == null) {
               predicateFilterBuilder_ =
    -              new com.google.protobuf.SingleFieldBuilderV3<
    +              new com.google.protobuf.SingleFieldBuilder<
                       com.google.bigtable.v2.RowFilter,
                       com.google.bigtable.v2.RowFilter.Builder,
                       com.google.bigtable.v2.RowFilterOrBuilder>(
    @@ -3950,11 +3709,12 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
           }
     
           private com.google.bigtable.v2.RowFilter trueFilter_;
    -      private com.google.protobuf.SingleFieldBuilderV3<
    +      private com.google.protobuf.SingleFieldBuilder<
                   com.google.bigtable.v2.RowFilter,
                   com.google.bigtable.v2.RowFilter.Builder,
                   com.google.bigtable.v2.RowFilterOrBuilder>
               trueFilterBuilder_;
    +
           /**
            *
            *
    @@ -3968,8 +3728,9 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
            * @return Whether the trueFilter field is set.
            */
           public boolean hasTrueFilter() {
    -        return trueFilterBuilder_ != null || trueFilter_ != null;
    +        return ((bitField0_ & 0x00000002) != 0);
           }
    +
           /**
            *
            *
    @@ -3991,6 +3752,7 @@ public com.google.bigtable.v2.RowFilter getTrueFilter() {
               return trueFilterBuilder_.getMessage();
             }
           }
    +
           /**
            *
            *
    @@ -4007,13 +3769,14 @@ public Builder setTrueFilter(com.google.bigtable.v2.RowFilter value) {
                 throw new NullPointerException();
               }
               trueFilter_ = value;
    -          onChanged();
             } else {
               trueFilterBuilder_.setMessage(value);
             }
    -
    +        bitField0_ |= 0x00000002;
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -4027,13 +3790,14 @@ public Builder setTrueFilter(com.google.bigtable.v2.RowFilter value) {
           public Builder setTrueFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) {
             if (trueFilterBuilder_ == null) {
               trueFilter_ = builderForValue.build();
    -          onChanged();
             } else {
               trueFilterBuilder_.setMessage(builderForValue.build());
             }
    -
    +        bitField0_ |= 0x00000002;
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -4046,21 +3810,23 @@ public Builder setTrueFilter(com.google.bigtable.v2.RowFilter.Builder builderFor
            */
           public Builder mergeTrueFilter(com.google.bigtable.v2.RowFilter value) {
             if (trueFilterBuilder_ == null) {
    -          if (trueFilter_ != null) {
    -            trueFilter_ =
    -                com.google.bigtable.v2.RowFilter.newBuilder(trueFilter_)
    -                    .mergeFrom(value)
    -                    .buildPartial();
    +          if (((bitField0_ & 0x00000002) != 0)
    +              && trueFilter_ != null
    +              && trueFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) {
    +            getTrueFilterBuilder().mergeFrom(value);
               } else {
                 trueFilter_ = value;
               }
    -          onChanged();
             } else {
               trueFilterBuilder_.mergeFrom(value);
             }
    -
    +        if (trueFilter_ != null) {
    +          bitField0_ |= 0x00000002;
    +          onChanged();
    +        }
             return this;
           }
    +
           /**
            *
            *
    @@ -4072,16 +3838,16 @@ public Builder mergeTrueFilter(com.google.bigtable.v2.RowFilter value) {
            * .google.bigtable.v2.RowFilter true_filter = 2;
            */
           public Builder clearTrueFilter() {
    -        if (trueFilterBuilder_ == null) {
    -          trueFilter_ = null;
    -          onChanged();
    -        } else {
    -          trueFilter_ = null;
    +        bitField0_ = (bitField0_ & ~0x00000002);
    +        trueFilter_ = null;
    +        if (trueFilterBuilder_ != null) {
    +          trueFilterBuilder_.dispose();
               trueFilterBuilder_ = null;
             }
    -
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -4093,10 +3859,11 @@ public Builder clearTrueFilter() {
            * .google.bigtable.v2.RowFilter true_filter = 2;
            */
           public com.google.bigtable.v2.RowFilter.Builder getTrueFilterBuilder() {
    -
    +        bitField0_ |= 0x00000002;
             onChanged();
    -        return getTrueFilterFieldBuilder().getBuilder();
    +        return internalGetTrueFilterFieldBuilder().getBuilder();
           }
    +
           /**
            *
            *
    @@ -4116,6 +3883,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
                   : trueFilter_;
             }
           }
    +
           /**
            *
            *
    @@ -4126,14 +3894,14 @@ public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
            *
            * .google.bigtable.v2.RowFilter true_filter = 2;
            */
    -      private com.google.protobuf.SingleFieldBuilderV3<
    +      private com.google.protobuf.SingleFieldBuilder<
                   com.google.bigtable.v2.RowFilter,
                   com.google.bigtable.v2.RowFilter.Builder,
                   com.google.bigtable.v2.RowFilterOrBuilder>
    -          getTrueFilterFieldBuilder() {
    +          internalGetTrueFilterFieldBuilder() {
             if (trueFilterBuilder_ == null) {
               trueFilterBuilder_ =
    -              new com.google.protobuf.SingleFieldBuilderV3<
    +              new com.google.protobuf.SingleFieldBuilder<
                       com.google.bigtable.v2.RowFilter,
                       com.google.bigtable.v2.RowFilter.Builder,
                       com.google.bigtable.v2.RowFilterOrBuilder>(
    @@ -4144,11 +3912,12 @@ public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
           }
     
           private com.google.bigtable.v2.RowFilter falseFilter_;
    -      private com.google.protobuf.SingleFieldBuilderV3<
    +      private com.google.protobuf.SingleFieldBuilder<
                   com.google.bigtable.v2.RowFilter,
                   com.google.bigtable.v2.RowFilter.Builder,
                   com.google.bigtable.v2.RowFilterOrBuilder>
               falseFilterBuilder_;
    +
           /**
            *
            *
    @@ -4163,8 +3932,9 @@ public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
            * @return Whether the falseFilter field is set.
            */
           public boolean hasFalseFilter() {
    -        return falseFilterBuilder_ != null || falseFilter_ != null;
    +        return ((bitField0_ & 0x00000004) != 0);
           }
    +
           /**
            *
            *
    @@ -4187,6 +3957,7 @@ public com.google.bigtable.v2.RowFilter getFalseFilter() {
               return falseFilterBuilder_.getMessage();
             }
           }
    +
           /**
            *
            *
    @@ -4204,13 +3975,14 @@ public Builder setFalseFilter(com.google.bigtable.v2.RowFilter value) {
                 throw new NullPointerException();
               }
               falseFilter_ = value;
    -          onChanged();
             } else {
               falseFilterBuilder_.setMessage(value);
             }
    -
    +        bitField0_ |= 0x00000004;
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -4225,13 +3997,14 @@ public Builder setFalseFilter(com.google.bigtable.v2.RowFilter value) {
           public Builder setFalseFilter(com.google.bigtable.v2.RowFilter.Builder builderForValue) {
             if (falseFilterBuilder_ == null) {
               falseFilter_ = builderForValue.build();
    -          onChanged();
             } else {
               falseFilterBuilder_.setMessage(builderForValue.build());
             }
    -
    +        bitField0_ |= 0x00000004;
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -4245,21 +4018,23 @@ public Builder setFalseFilter(com.google.bigtable.v2.RowFilter.Builder builderFo
            */
           public Builder mergeFalseFilter(com.google.bigtable.v2.RowFilter value) {
             if (falseFilterBuilder_ == null) {
    -          if (falseFilter_ != null) {
    -            falseFilter_ =
    -                com.google.bigtable.v2.RowFilter.newBuilder(falseFilter_)
    -                    .mergeFrom(value)
    -                    .buildPartial();
    +          if (((bitField0_ & 0x00000004) != 0)
    +              && falseFilter_ != null
    +              && falseFilter_ != com.google.bigtable.v2.RowFilter.getDefaultInstance()) {
    +            getFalseFilterBuilder().mergeFrom(value);
               } else {
                 falseFilter_ = value;
               }
    -          onChanged();
             } else {
               falseFilterBuilder_.mergeFrom(value);
             }
    -
    +        if (falseFilter_ != null) {
    +          bitField0_ |= 0x00000004;
    +          onChanged();
    +        }
             return this;
           }
    +
           /**
            *
            *
    @@ -4272,16 +4047,16 @@ public Builder mergeFalseFilter(com.google.bigtable.v2.RowFilter value) {
            * .google.bigtable.v2.RowFilter false_filter = 3;
            */
           public Builder clearFalseFilter() {
    -        if (falseFilterBuilder_ == null) {
    -          falseFilter_ = null;
    -          onChanged();
    -        } else {
    -          falseFilter_ = null;
    +        bitField0_ = (bitField0_ & ~0x00000004);
    +        falseFilter_ = null;
    +        if (falseFilterBuilder_ != null) {
    +          falseFilterBuilder_.dispose();
               falseFilterBuilder_ = null;
             }
    -
    +        onChanged();
             return this;
           }
    +
           /**
            *
            *
    @@ -4294,10 +4069,11 @@ public Builder clearFalseFilter() {
            * .google.bigtable.v2.RowFilter false_filter = 3;
            */
           public com.google.bigtable.v2.RowFilter.Builder getFalseFilterBuilder() {
    -
    +        bitField0_ |= 0x00000004;
             onChanged();
    -        return getFalseFilterFieldBuilder().getBuilder();
    +        return internalGetFalseFilterFieldBuilder().getBuilder();
           }
    +
           /**
            *
            *
    @@ -4318,6 +4094,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder() {
                   : falseFilter_;
             }
           }
    +
           /**
            *
            *
    @@ -4329,14 +4106,14 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder() {
            *
            * .google.bigtable.v2.RowFilter false_filter = 3;
            */
    -      private com.google.protobuf.SingleFieldBuilderV3<
    +      private com.google.protobuf.SingleFieldBuilder<
                   com.google.bigtable.v2.RowFilter,
                   com.google.bigtable.v2.RowFilter.Builder,
                   com.google.bigtable.v2.RowFilterOrBuilder>
    -          getFalseFilterFieldBuilder() {
    +          internalGetFalseFilterFieldBuilder() {
             if (falseFilterBuilder_ == null) {
               falseFilterBuilder_ =
    -              new com.google.protobuf.SingleFieldBuilderV3<
    +              new com.google.protobuf.SingleFieldBuilder<
                       com.google.bigtable.v2.RowFilter,
                       com.google.bigtable.v2.RowFilter.Builder,
                       com.google.bigtable.v2.RowFilterOrBuilder>(
    @@ -4346,18 +4123,6 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFalseFilterOrBuilder() {
             return falseFilterBuilder_;
           }
     
    -      @java.lang.Override
    -      public final Builder setUnknownFields(
    -          final com.google.protobuf.UnknownFieldSet unknownFields) {
    -        return super.setUnknownFields(unknownFields);
    -      }
    -
    -      @java.lang.Override
    -      public final Builder mergeUnknownFields(
    -          final com.google.protobuf.UnknownFieldSet unknownFields) {
    -        return super.mergeUnknownFields(unknownFields);
    -      }
    -
           // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter.Condition)
         }
     
    @@ -4379,7 +4144,19 @@ public Condition parsePartialFrom(
                   com.google.protobuf.CodedInputStream input,
                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                   throws com.google.protobuf.InvalidProtocolBufferException {
    -            return new Condition(input, extensionRegistry);
    +            Builder builder = newBuilder();
    +            try {
    +              builder.mergeFrom(input, extensionRegistry);
    +            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    +              throw e.setUnfinishedMessage(builder.buildPartial());
    +            } catch (com.google.protobuf.UninitializedMessageException e) {
    +              throw e.asInvalidProtocolBufferException()
    +                  .setUnfinishedMessage(builder.buildPartial());
    +            } catch (java.io.IOException e) {
    +              throw new com.google.protobuf.InvalidProtocolBufferException(e)
    +                  .setUnfinishedMessage(builder.buildPartial());
    +            }
    +            return builder.buildPartial();
               }
             };
     
    @@ -4399,6 +4176,8 @@ public com.google.bigtable.v2.RowFilter.Condition getDefaultInstanceForType() {
       }
     
       private int filterCase_ = 0;
    +
    +  @SuppressWarnings("serial")
       private java.lang.Object filter_;
     
       public enum FilterCase
    @@ -4430,6 +4209,7 @@ public enum FilterCase
         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.
    @@ -4497,6 +4277,7 @@ public FilterCase getFilterCase() {
       }
     
       public static final int CHAIN_FIELD_NUMBER = 1;
    +
       /**
        *
        *
    @@ -4513,6 +4294,7 @@ public FilterCase getFilterCase() {
       public boolean hasChain() {
         return filterCase_ == 1;
       }
    +
       /**
        *
        *
    @@ -4532,6 +4314,7 @@ public com.google.bigtable.v2.RowFilter.Chain getChain() {
         }
         return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance();
       }
    +
       /**
        *
        *
    @@ -4551,6 +4334,7 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() {
       }
     
       public static final int INTERLEAVE_FIELD_NUMBER = 2;
    +
       /**
        *
        *
    @@ -4567,6 +4351,7 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() {
       public boolean hasInterleave() {
         return filterCase_ == 2;
       }
    +
       /**
        *
        *
    @@ -4586,6 +4371,7 @@ public com.google.bigtable.v2.RowFilter.Interleave getInterleave() {
         }
         return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance();
       }
    +
       /**
        *
        *
    @@ -4605,6 +4391,7 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild
       }
     
       public static final int CONDITION_FIELD_NUMBER = 3;
    +
       /**
        *
        *
    @@ -4621,6 +4408,7 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild
       public boolean hasCondition() {
         return filterCase_ == 3;
       }
    +
       /**
        *
        *
    @@ -4640,6 +4428,7 @@ public com.google.bigtable.v2.RowFilter.Condition getCondition() {
         }
         return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance();
       }
    +
       /**
        *
        *
    @@ -4659,6 +4448,7 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder
       }
     
       public static final int SINK_FIELD_NUMBER = 16;
    +
       /**
        *
        *
    @@ -4667,54 +4457,59 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder
        * 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
    +   *
    +   * 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].
        * 
    @@ -4727,6 +4522,7 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder public boolean hasSink() { return filterCase_ == 16; } + /** * * @@ -4735,54 +4531,59 @@ public boolean hasSink() { * 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 + * + * 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]. *
    @@ -4800,6 +4601,7 @@ public boolean getSink() { } public static final int PASS_ALL_FILTER_FIELD_NUMBER = 17; + /** * * @@ -4816,6 +4618,7 @@ public boolean getSink() { public boolean hasPassAllFilter() { return filterCase_ == 17; } + /** * * @@ -4837,6 +4640,7 @@ public boolean getPassAllFilter() { } public static final int BLOCK_ALL_FILTER_FIELD_NUMBER = 18; + /** * * @@ -4853,6 +4657,7 @@ public boolean getPassAllFilter() { public boolean hasBlockAllFilter() { return filterCase_ == 18; } + /** * * @@ -4874,6 +4679,7 @@ public boolean getBlockAllFilter() { } public static final int ROW_KEY_REGEX_FILTER_FIELD_NUMBER = 4; + /** * * @@ -4895,6 +4701,7 @@ public boolean getBlockAllFilter() { public boolean hasRowKeyRegexFilter() { return filterCase_ == 4; } + /** * * @@ -4921,6 +4728,7 @@ public com.google.protobuf.ByteString getRowKeyRegexFilter() { } public static final int ROW_SAMPLE_FILTER_FIELD_NUMBER = 14; + /** * * @@ -4937,6 +4745,7 @@ public com.google.protobuf.ByteString getRowKeyRegexFilter() { public boolean hasRowSampleFilter() { return filterCase_ == 14; } + /** * * @@ -4958,6 +4767,7 @@ public double getRowSampleFilter() { } public static final int FAMILY_NAME_REGEX_FILTER_FIELD_NUMBER = 5; + /** * * @@ -4977,6 +4787,7 @@ public double getRowSampleFilter() { public boolean hasFamilyNameRegexFilter() { return filterCase_ == 5; } + /** * * @@ -5009,6 +4820,7 @@ public java.lang.String getFamilyNameRegexFilter() { return s; } } + /** * * @@ -5043,6 +4855,7 @@ public com.google.protobuf.ByteString getFamilyNameRegexFilterBytes() { } public static final int COLUMN_QUALIFIER_REGEX_FILTER_FIELD_NUMBER = 6; + /** * * @@ -5063,6 +4876,7 @@ public com.google.protobuf.ByteString getFamilyNameRegexFilterBytes() { public boolean hasColumnQualifierRegexFilter() { return filterCase_ == 6; } + /** * * @@ -5088,6 +4902,7 @@ public com.google.protobuf.ByteString getColumnQualifierRegexFilter() { } public static final int COLUMN_RANGE_FILTER_FIELD_NUMBER = 7; + /** * * @@ -5103,6 +4918,7 @@ public com.google.protobuf.ByteString getColumnQualifierRegexFilter() { public boolean hasColumnRangeFilter() { return filterCase_ == 7; } + /** * * @@ -5121,6 +4937,7 @@ public com.google.bigtable.v2.ColumnRange getColumnRangeFilter() { } return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); } + /** * * @@ -5139,6 +4956,7 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder } public static final int TIMESTAMP_RANGE_FILTER_FIELD_NUMBER = 8; + /** * * @@ -5154,6 +4972,7 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder public boolean hasTimestampRangeFilter() { return filterCase_ == 8; } + /** * * @@ -5172,6 +4991,7 @@ public com.google.bigtable.v2.TimestampRange getTimestampRangeFilter() { } return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); } + /** * * @@ -5190,6 +5010,7 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB } public static final int VALUE_REGEX_FILTER_FIELD_NUMBER = 9; + /** * * @@ -5209,6 +5030,7 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB public boolean hasValueRegexFilter() { return filterCase_ == 9; } + /** * * @@ -5233,6 +5055,7 @@ public com.google.protobuf.ByteString getValueRegexFilter() { } public static final int VALUE_RANGE_FILTER_FIELD_NUMBER = 15; + /** * * @@ -5248,6 +5071,7 @@ public com.google.protobuf.ByteString getValueRegexFilter() { public boolean hasValueRangeFilter() { return filterCase_ == 15; } + /** * * @@ -5266,6 +5090,7 @@ public com.google.bigtable.v2.ValueRange getValueRangeFilter() { } return com.google.bigtable.v2.ValueRange.getDefaultInstance(); } + /** * * @@ -5284,6 +5109,7 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() } public static final int CELLS_PER_ROW_OFFSET_FILTER_FIELD_NUMBER = 10; + /** * * @@ -5301,6 +5127,7 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() public boolean hasCellsPerRowOffsetFilter() { return filterCase_ == 10; } + /** * * @@ -5323,6 +5150,7 @@ public int getCellsPerRowOffsetFilter() { } public static final int CELLS_PER_ROW_LIMIT_FILTER_FIELD_NUMBER = 11; + /** * * @@ -5340,6 +5168,7 @@ public int getCellsPerRowOffsetFilter() { public boolean hasCellsPerRowLimitFilter() { return filterCase_ == 11; } + /** * * @@ -5362,6 +5191,7 @@ public int getCellsPerRowLimitFilter() { } public static final int CELLS_PER_COLUMN_LIMIT_FILTER_FIELD_NUMBER = 12; + /** * * @@ -5382,6 +5212,7 @@ public int getCellsPerRowLimitFilter() { public boolean hasCellsPerColumnLimitFilter() { return filterCase_ == 12; } + /** * * @@ -5407,6 +5238,7 @@ public int getCellsPerColumnLimitFilter() { } public static final int STRIP_VALUE_TRANSFORMER_FIELD_NUMBER = 13; + /** * * @@ -5422,6 +5254,7 @@ public int getCellsPerColumnLimitFilter() { public boolean hasStripValueTransformer() { return filterCase_ == 13; } + /** * * @@ -5442,6 +5275,7 @@ public boolean getStripValueTransformer() { } public static final int APPLY_LABEL_TRANSFORMER_FIELD_NUMBER = 19; + /** * * @@ -5449,8 +5283,10 @@ public 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 @@ -5466,6 +5302,7 @@ public boolean getStripValueTransformer() { public boolean hasApplyLabelTransformer() { return filterCase_ == 19; } + /** * * @@ -5473,8 +5310,10 @@ public 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 @@ -5503,6 +5342,7 @@ public java.lang.String getApplyLabelTransformer() { return s; } } + /** * * @@ -5510,8 +5350,10 @@ public 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 @@ -5568,7 +5410,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeBytes(4, (com.google.protobuf.ByteString) filter_); } if (filterCase_ == 5) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + com.google.protobuf.GeneratedMessage.writeString(output, 5, filter_); } if (filterCase_ == 6) { output.writeBytes(6, (com.google.protobuf.ByteString) filter_); @@ -5610,9 +5452,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeBool(18, (boolean) ((java.lang.Boolean) filter_)); } if (filterCase_ == 19) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 19, filter_); + com.google.protobuf.GeneratedMessage.writeString(output, 19, filter_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -5642,7 +5484,7 @@ public int getSerializedSize() { 4, (com.google.protobuf.ByteString) filter_); } if (filterCase_ == 5) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, filter_); } if (filterCase_ == 6) { size += @@ -5710,9 +5552,9 @@ public int getSerializedSize() { 18, (boolean) ((java.lang.Boolean) filter_)); } if (filterCase_ == 19) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, filter_); + size += com.google.protobuf.GeneratedMessage.computeStringSize(19, filter_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -5791,7 +5633,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -5885,7 +5727,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -5926,38 +5768,38 @@ public static com.google.bigtable.v2.RowFilter parseFrom( public static com.google.bigtable.v2.RowFilter parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -5980,10 +5822,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -5995,9 +5838,11 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * 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 @@ -6007,20 +5852,23 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * `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 4096 bytes, and RowFilters may not be nested within each other + * exceed 20480 bytes, and RowFilters may not be nested within each other * (in Chains or Interleaves) to a depth of more than 20. * * * Protobuf type {@code google.bigtable.v2.RowFilter} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -6030,7 +5878,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable @@ -6040,167 +5888,95 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.RowFilter.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } - @java.lang.Override - public Builder clear() { - super.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 (filterCase_ == 1) { - if (chainBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = chainBuilder_.build(); - } - } - if (filterCase_ == 2) { - if (interleaveBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = interleaveBuilder_.build(); - } - } - if (filterCase_ == 3) { - if (conditionBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = conditionBuilder_.build(); - } - } - if (filterCase_ == 16) { - result.filter_ = filter_; - } - if (filterCase_ == 17) { - result.filter_ = filter_; - } - if (filterCase_ == 18) { - result.filter_ = filter_; - } - if (filterCase_ == 4) { - result.filter_ = filter_; - } - if (filterCase_ == 14) { - result.filter_ = filter_; - } - if (filterCase_ == 5) { - result.filter_ = filter_; - } - if (filterCase_ == 6) { - result.filter_ = filter_; - } - if (filterCase_ == 7) { - if (columnRangeFilterBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = columnRangeFilterBuilder_.build(); - } - } - if (filterCase_ == 8) { - if (timestampRangeFilterBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = timestampRangeFilterBuilder_.build(); - } - } - if (filterCase_ == 9) { - result.filter_ = filter_; - } - if (filterCase_ == 15) { - if (valueRangeFilterBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = valueRangeFilterBuilder_.build(); - } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (chainBuilder_ != null) { + chainBuilder_.clear(); } - if (filterCase_ == 10) { - result.filter_ = filter_; + if (interleaveBuilder_ != null) { + interleaveBuilder_.clear(); } - if (filterCase_ == 11) { - result.filter_ = filter_; + if (conditionBuilder_ != null) { + conditionBuilder_.clear(); } - if (filterCase_ == 12) { - result.filter_ = filter_; + if (columnRangeFilterBuilder_ != null) { + columnRangeFilterBuilder_.clear(); } - if (filterCase_ == 13) { - result.filter_ = filter_; + if (timestampRangeFilterBuilder_ != null) { + timestampRangeFilterBuilder_.clear(); } - if (filterCase_ == 19) { - result.filter_ = filter_; + if (valueRangeFilterBuilder_ != null) { + valueRangeFilterBuilder_.clear(); } - result.filterCase_ = filterCase_; - onBuilt(); - return result; + filterCase_ = 0; + filter_ = null; + return this; } @java.lang.Override - public Builder clone() { - return super.clone(); + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_RowFilter_descriptor; } @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + public com.google.bigtable.v2.RowFilter getDefaultInstanceForType() { + return com.google.bigtable.v2.RowFilter.getDefaultInstance(); } @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + 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 Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + 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; } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + private void buildPartial0(com.google.bigtable.v2.RowFilter result) { + int from_bitField0_ = bitField0_; } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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(); + } } @java.lang.Override @@ -6320,7 +6096,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -6335,17 +6111,152 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.RowFilter parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.bigtable.v2.RowFilter) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -6363,11 +6274,14 @@ public Builder clearFilter() { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -6384,6 +6298,7 @@ public Builder clearFilter() { public boolean hasChain() { return filterCase_ == 1; } + /** * * @@ -6410,6 +6325,7 @@ public com.google.bigtable.v2.RowFilter.Chain getChain() { return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); } } + /** * * @@ -6433,6 +6349,7 @@ public Builder setChain(com.google.bigtable.v2.RowFilter.Chain value) { filterCase_ = 1; return this; } + /** * * @@ -6453,6 +6370,7 @@ public Builder setChain(com.google.bigtable.v2.RowFilter.Chain.Builder builderFo filterCase_ = 1; return this; } + /** * * @@ -6479,12 +6397,14 @@ public Builder mergeChain(com.google.bigtable.v2.RowFilter.Chain value) { } else { if (filterCase_ == 1) { chainBuilder_.mergeFrom(value); + } else { + chainBuilder_.setMessage(value); } - chainBuilder_.setMessage(value); } filterCase_ = 1; return this; } + /** * * @@ -6511,6 +6431,7 @@ public Builder clearChain() { } return this; } + /** * * @@ -6522,8 +6443,9 @@ public Builder clearChain() { * .google.bigtable.v2.RowFilter.Chain chain = 1; */ public com.google.bigtable.v2.RowFilter.Chain.Builder getChainBuilder() { - return getChainFieldBuilder().getBuilder(); + return internalGetChainFieldBuilder().getBuilder(); } + /** * * @@ -6545,6 +6467,7 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { return com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); } } + /** * * @@ -6555,17 +6478,17 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { * * .google.bigtable.v2.RowFilter.Chain chain = 1; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter.Chain, com.google.bigtable.v2.RowFilter.Chain.Builder, com.google.bigtable.v2.RowFilter.ChainOrBuilder> - getChainFieldBuilder() { + internalGetChainFieldBuilder() { if (chainBuilder_ == null) { if (!(filterCase_ == 1)) { filter_ = com.google.bigtable.v2.RowFilter.Chain.getDefaultInstance(); } chainBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter.Chain, com.google.bigtable.v2.RowFilter.Chain.Builder, com.google.bigtable.v2.RowFilter.ChainOrBuilder>( @@ -6576,15 +6499,15 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { } filterCase_ = 1; onChanged(); - ; return chainBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -6601,6 +6524,7 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { public boolean hasInterleave() { return filterCase_ == 2; } + /** * * @@ -6627,6 +6551,7 @@ public com.google.bigtable.v2.RowFilter.Interleave getInterleave() { return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); } } + /** * * @@ -6650,6 +6575,7 @@ public Builder setInterleave(com.google.bigtable.v2.RowFilter.Interleave value) filterCase_ = 2; return this; } + /** * * @@ -6671,6 +6597,7 @@ public Builder setInterleave( filterCase_ = 2; return this; } + /** * * @@ -6697,12 +6624,14 @@ public Builder mergeInterleave(com.google.bigtable.v2.RowFilter.Interleave value } else { if (filterCase_ == 2) { interleaveBuilder_.mergeFrom(value); + } else { + interleaveBuilder_.setMessage(value); } - interleaveBuilder_.setMessage(value); } filterCase_ = 2; return this; } + /** * * @@ -6729,6 +6658,7 @@ public Builder clearInterleave() { } return this; } + /** * * @@ -6740,8 +6670,9 @@ public Builder clearInterleave() { * .google.bigtable.v2.RowFilter.Interleave interleave = 2; */ public com.google.bigtable.v2.RowFilter.Interleave.Builder getInterleaveBuilder() { - return getInterleaveFieldBuilder().getBuilder(); + return internalGetInterleaveFieldBuilder().getBuilder(); } + /** * * @@ -6763,6 +6694,7 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild return com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); } } + /** * * @@ -6773,17 +6705,17 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild * * .google.bigtable.v2.RowFilter.Interleave interleave = 2; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter.Interleave, com.google.bigtable.v2.RowFilter.Interleave.Builder, com.google.bigtable.v2.RowFilter.InterleaveOrBuilder> - getInterleaveFieldBuilder() { + internalGetInterleaveFieldBuilder() { if (interleaveBuilder_ == null) { if (!(filterCase_ == 2)) { filter_ = com.google.bigtable.v2.RowFilter.Interleave.getDefaultInstance(); } interleaveBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter.Interleave, com.google.bigtable.v2.RowFilter.Interleave.Builder, com.google.bigtable.v2.RowFilter.InterleaveOrBuilder>( @@ -6794,15 +6726,15 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild } filterCase_ = 2; onChanged(); - ; return interleaveBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + 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_; + /** * * @@ -6819,6 +6751,7 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild public boolean hasCondition() { return filterCase_ == 3; } + /** * * @@ -6845,6 +6778,7 @@ public com.google.bigtable.v2.RowFilter.Condition getCondition() { return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); } } + /** * * @@ -6868,6 +6802,7 @@ public Builder setCondition(com.google.bigtable.v2.RowFilter.Condition value) { filterCase_ = 3; return this; } + /** * * @@ -6889,6 +6824,7 @@ public Builder setCondition( filterCase_ = 3; return this; } + /** * * @@ -6915,12 +6851,14 @@ public Builder mergeCondition(com.google.bigtable.v2.RowFilter.Condition value) } else { if (filterCase_ == 3) { conditionBuilder_.mergeFrom(value); + } else { + conditionBuilder_.setMessage(value); } - conditionBuilder_.setMessage(value); } filterCase_ = 3; return this; } + /** * * @@ -6947,6 +6885,7 @@ public Builder clearCondition() { } return this; } + /** * * @@ -6958,8 +6897,9 @@ public Builder clearCondition() { * .google.bigtable.v2.RowFilter.Condition condition = 3; */ public com.google.bigtable.v2.RowFilter.Condition.Builder getConditionBuilder() { - return getConditionFieldBuilder().getBuilder(); + return internalGetConditionFieldBuilder().getBuilder(); } + /** * * @@ -6981,6 +6921,7 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder return com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); } } + /** * * @@ -6991,17 +6932,17 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder * * .google.bigtable.v2.RowFilter.Condition condition = 3; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter.Condition, com.google.bigtable.v2.RowFilter.Condition.Builder, com.google.bigtable.v2.RowFilter.ConditionOrBuilder> - getConditionFieldBuilder() { + internalGetConditionFieldBuilder() { if (conditionBuilder_ == null) { if (!(filterCase_ == 3)) { filter_ = com.google.bigtable.v2.RowFilter.Condition.getDefaultInstance(); } conditionBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.RowFilter.Condition, com.google.bigtable.v2.RowFilter.Condition.Builder, com.google.bigtable.v2.RowFilter.ConditionOrBuilder>( @@ -7012,7 +6953,6 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder } filterCase_ = 3; onChanged(); - ; return conditionBuilder_; } @@ -7024,54 +6964,59 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder * 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 + * + * 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]. * @@ -7083,6 +7028,7 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder public boolean hasSink() { return filterCase_ == 16; } + /** * * @@ -7091,54 +7037,59 @@ public boolean hasSink() { * 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 + * + * 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]. * @@ -7153,6 +7104,7 @@ public boolean getSink() { } return false; } + /** * * @@ -7161,54 +7113,59 @@ public boolean getSink() { * 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 + * + * 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]. * @@ -7219,11 +7176,13 @@ public boolean getSink() { * @return This builder for chaining. */ public Builder setSink(boolean value) { + filterCase_ = 16; filter_ = value; onChanged(); return this; } + /** * * @@ -7232,54 +7191,59 @@ public Builder setSink(boolean value) { * 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 + * + * 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]. * @@ -7312,6 +7276,7 @@ public Builder clearSink() { public boolean hasPassAllFilter() { return filterCase_ == 17; } + /** * * @@ -7330,6 +7295,7 @@ public boolean getPassAllFilter() { } return false; } + /** * * @@ -7344,11 +7310,13 @@ public boolean getPassAllFilter() { * @return This builder for chaining. */ public Builder setPassAllFilter(boolean value) { + filterCase_ = 17; filter_ = value; onChanged(); return this; } + /** * * @@ -7385,6 +7353,7 @@ public Builder clearPassAllFilter() { public boolean hasBlockAllFilter() { return filterCase_ == 18; } + /** * * @@ -7403,6 +7372,7 @@ public boolean getBlockAllFilter() { } return false; } + /** * * @@ -7417,11 +7387,13 @@ public boolean getBlockAllFilter() { * @return This builder for chaining. */ public Builder setBlockAllFilter(boolean value) { + filterCase_ = 18; filter_ = value; onChanged(); return this; } + /** * * @@ -7463,6 +7435,7 @@ public Builder clearBlockAllFilter() { public boolean hasRowKeyRegexFilter() { return filterCase_ == 4; } + /** * * @@ -7486,6 +7459,7 @@ public com.google.protobuf.ByteString getRowKeyRegexFilter() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -7513,6 +7487,7 @@ public Builder setRowKeyRegexFilter(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -7554,6 +7529,7 @@ public Builder clearRowKeyRegexFilter() { public boolean hasRowSampleFilter() { return filterCase_ == 14; } + /** * * @@ -7572,6 +7548,7 @@ public double getRowSampleFilter() { } return 0D; } + /** * * @@ -7586,11 +7563,13 @@ public double getRowSampleFilter() { * @return This builder for chaining. */ public Builder setRowSampleFilter(double value) { + filterCase_ = 14; filter_ = value; onChanged(); return this; } + /** * * @@ -7632,6 +7611,7 @@ public Builder clearRowSampleFilter() { public boolean hasFamilyNameRegexFilter() { return filterCase_ == 5; } + /** * * @@ -7665,6 +7645,7 @@ public java.lang.String getFamilyNameRegexFilter() { return (java.lang.String) ref; } } + /** * * @@ -7698,6 +7679,7 @@ public com.google.protobuf.ByteString getFamilyNameRegexFilterBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -7724,6 +7706,7 @@ public Builder setFamilyNameRegexFilter(java.lang.String value) { onChanged(); return this; } + /** * * @@ -7748,6 +7731,7 @@ public Builder clearFamilyNameRegexFilter() { } return this; } + /** * * @@ -7795,6 +7779,7 @@ public Builder setFamilyNameRegexFilterBytes(com.google.protobuf.ByteString valu public boolean hasColumnQualifierRegexFilter() { return filterCase_ == 6; } + /** * * @@ -7817,6 +7802,7 @@ public com.google.protobuf.ByteString getColumnQualifierRegexFilter() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -7843,6 +7829,7 @@ public Builder setColumnQualifierRegexFilter(com.google.protobuf.ByteString valu onChanged(); return this; } + /** * * @@ -7868,11 +7855,12 @@ public Builder clearColumnQualifierRegexFilter() { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.ColumnRange, com.google.bigtable.v2.ColumnRange.Builder, com.google.bigtable.v2.ColumnRangeOrBuilder> columnRangeFilterBuilder_; + /** * * @@ -7888,6 +7876,7 @@ public Builder clearColumnQualifierRegexFilter() { public boolean hasColumnRangeFilter() { return filterCase_ == 7; } + /** * * @@ -7913,6 +7902,7 @@ public com.google.bigtable.v2.ColumnRange getColumnRangeFilter() { return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); } } + /** * * @@ -7935,6 +7925,7 @@ public Builder setColumnRangeFilter(com.google.bigtable.v2.ColumnRange value) { filterCase_ = 7; return this; } + /** * * @@ -7955,6 +7946,7 @@ public Builder setColumnRangeFilter( filterCase_ = 7; return this; } + /** * * @@ -7980,12 +7972,14 @@ public Builder mergeColumnRangeFilter(com.google.bigtable.v2.ColumnRange value) } else { if (filterCase_ == 7) { columnRangeFilterBuilder_.mergeFrom(value); + } else { + columnRangeFilterBuilder_.setMessage(value); } - columnRangeFilterBuilder_.setMessage(value); } filterCase_ = 7; return this; } + /** * * @@ -8011,6 +8005,7 @@ public Builder clearColumnRangeFilter() { } return this; } + /** * * @@ -8021,8 +8016,9 @@ public Builder clearColumnRangeFilter() { * .google.bigtable.v2.ColumnRange column_range_filter = 7; */ public com.google.bigtable.v2.ColumnRange.Builder getColumnRangeFilterBuilder() { - return getColumnRangeFilterFieldBuilder().getBuilder(); + return internalGetColumnRangeFilterFieldBuilder().getBuilder(); } + /** * * @@ -8043,6 +8039,7 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder return com.google.bigtable.v2.ColumnRange.getDefaultInstance(); } } + /** * * @@ -8052,17 +8049,17 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder * * .google.bigtable.v2.ColumnRange column_range_filter = 7; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.ColumnRange, com.google.bigtable.v2.ColumnRange.Builder, com.google.bigtable.v2.ColumnRangeOrBuilder> - getColumnRangeFilterFieldBuilder() { + internalGetColumnRangeFilterFieldBuilder() { if (columnRangeFilterBuilder_ == null) { if (!(filterCase_ == 7)) { filter_ = com.google.bigtable.v2.ColumnRange.getDefaultInstance(); } columnRangeFilterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.ColumnRange, com.google.bigtable.v2.ColumnRange.Builder, com.google.bigtable.v2.ColumnRangeOrBuilder>( @@ -8071,15 +8068,15 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder } filterCase_ = 7; onChanged(); - ; return columnRangeFilterBuilder_; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.TimestampRange, com.google.bigtable.v2.TimestampRange.Builder, com.google.bigtable.v2.TimestampRangeOrBuilder> timestampRangeFilterBuilder_; + /** * * @@ -8095,6 +8092,7 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder public boolean hasTimestampRangeFilter() { return filterCase_ == 8; } + /** * * @@ -8120,6 +8118,7 @@ public com.google.bigtable.v2.TimestampRange getTimestampRangeFilter() { return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); } } + /** * * @@ -8142,6 +8141,7 @@ public Builder setTimestampRangeFilter(com.google.bigtable.v2.TimestampRange val filterCase_ = 8; return this; } + /** * * @@ -8162,6 +8162,7 @@ public Builder setTimestampRangeFilter( filterCase_ = 8; return this; } + /** * * @@ -8187,12 +8188,14 @@ public Builder mergeTimestampRangeFilter(com.google.bigtable.v2.TimestampRange v } else { if (filterCase_ == 8) { timestampRangeFilterBuilder_.mergeFrom(value); + } else { + timestampRangeFilterBuilder_.setMessage(value); } - timestampRangeFilterBuilder_.setMessage(value); } filterCase_ = 8; return this; } + /** * * @@ -8218,6 +8221,7 @@ public Builder clearTimestampRangeFilter() { } return this; } + /** * * @@ -8228,8 +8232,9 @@ public Builder clearTimestampRangeFilter() { * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; */ public com.google.bigtable.v2.TimestampRange.Builder getTimestampRangeFilterBuilder() { - return getTimestampRangeFilterFieldBuilder().getBuilder(); + return internalGetTimestampRangeFilterFieldBuilder().getBuilder(); } + /** * * @@ -8250,6 +8255,7 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB return com.google.bigtable.v2.TimestampRange.getDefaultInstance(); } } + /** * * @@ -8259,17 +8265,17 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB * * .google.bigtable.v2.TimestampRange timestamp_range_filter = 8; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.TimestampRange, com.google.bigtable.v2.TimestampRange.Builder, com.google.bigtable.v2.TimestampRangeOrBuilder> - getTimestampRangeFilterFieldBuilder() { + internalGetTimestampRangeFilterFieldBuilder() { if (timestampRangeFilterBuilder_ == null) { if (!(filterCase_ == 8)) { filter_ = com.google.bigtable.v2.TimestampRange.getDefaultInstance(); } timestampRangeFilterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.TimestampRange, com.google.bigtable.v2.TimestampRange.Builder, com.google.bigtable.v2.TimestampRangeOrBuilder>( @@ -8278,7 +8284,6 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB } filterCase_ = 8; onChanged(); - ; return timestampRangeFilterBuilder_; } @@ -8300,6 +8305,7 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB public boolean hasValueRegexFilter() { return filterCase_ == 9; } + /** * * @@ -8321,6 +8327,7 @@ public com.google.protobuf.ByteString getValueRegexFilter() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -8346,6 +8353,7 @@ public Builder setValueRegexFilter(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -8370,11 +8378,12 @@ public Builder clearValueRegexFilter() { return this; } - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.ValueRange, com.google.bigtable.v2.ValueRange.Builder, com.google.bigtable.v2.ValueRangeOrBuilder> valueRangeFilterBuilder_; + /** * * @@ -8390,6 +8399,7 @@ public Builder clearValueRegexFilter() { public boolean hasValueRangeFilter() { return filterCase_ == 15; } + /** * * @@ -8415,6 +8425,7 @@ public com.google.bigtable.v2.ValueRange getValueRangeFilter() { return com.google.bigtable.v2.ValueRange.getDefaultInstance(); } } + /** * * @@ -8437,6 +8448,7 @@ public Builder setValueRangeFilter(com.google.bigtable.v2.ValueRange value) { filterCase_ = 15; return this; } + /** * * @@ -8456,6 +8468,7 @@ public Builder setValueRangeFilter(com.google.bigtable.v2.ValueRange.Builder bui filterCase_ = 15; return this; } + /** * * @@ -8481,12 +8494,14 @@ public Builder mergeValueRangeFilter(com.google.bigtable.v2.ValueRange value) { } else { if (filterCase_ == 15) { valueRangeFilterBuilder_.mergeFrom(value); + } else { + valueRangeFilterBuilder_.setMessage(value); } - valueRangeFilterBuilder_.setMessage(value); } filterCase_ = 15; return this; } + /** * * @@ -8512,6 +8527,7 @@ public Builder clearValueRangeFilter() { } return this; } + /** * * @@ -8522,8 +8538,9 @@ public Builder clearValueRangeFilter() { * .google.bigtable.v2.ValueRange value_range_filter = 15; */ public com.google.bigtable.v2.ValueRange.Builder getValueRangeFilterBuilder() { - return getValueRangeFilterFieldBuilder().getBuilder(); + return internalGetValueRangeFilterFieldBuilder().getBuilder(); } + /** * * @@ -8544,6 +8561,7 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() return com.google.bigtable.v2.ValueRange.getDefaultInstance(); } } + /** * * @@ -8553,17 +8571,17 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() * * .google.bigtable.v2.ValueRange value_range_filter = 15; */ - private com.google.protobuf.SingleFieldBuilderV3< + private com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.ValueRange, com.google.bigtable.v2.ValueRange.Builder, com.google.bigtable.v2.ValueRangeOrBuilder> - getValueRangeFilterFieldBuilder() { + internalGetValueRangeFilterFieldBuilder() { if (valueRangeFilterBuilder_ == null) { if (!(filterCase_ == 15)) { filter_ = com.google.bigtable.v2.ValueRange.getDefaultInstance(); } valueRangeFilterBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< + new com.google.protobuf.SingleFieldBuilder< com.google.bigtable.v2.ValueRange, com.google.bigtable.v2.ValueRange.Builder, com.google.bigtable.v2.ValueRangeOrBuilder>( @@ -8572,7 +8590,6 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() } filterCase_ = 15; onChanged(); - ; return valueRangeFilterBuilder_; } @@ -8592,6 +8609,7 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() public boolean hasCellsPerRowOffsetFilter() { return filterCase_ == 10; } + /** * * @@ -8611,6 +8629,7 @@ public int getCellsPerRowOffsetFilter() { } return 0; } + /** * * @@ -8626,11 +8645,13 @@ public int getCellsPerRowOffsetFilter() { * @return This builder for chaining. */ public Builder setCellsPerRowOffsetFilter(int value) { + filterCase_ = 10; filter_ = value; onChanged(); return this; } + /** * * @@ -8669,6 +8690,7 @@ public Builder clearCellsPerRowOffsetFilter() { public boolean hasCellsPerRowLimitFilter() { return filterCase_ == 11; } + /** * * @@ -8688,6 +8710,7 @@ public int getCellsPerRowLimitFilter() { } return 0; } + /** * * @@ -8703,11 +8726,13 @@ public int getCellsPerRowLimitFilter() { * @return This builder for chaining. */ public Builder setCellsPerRowLimitFilter(int value) { + filterCase_ = 11; filter_ = value; onChanged(); return this; } + /** * * @@ -8749,6 +8774,7 @@ public Builder clearCellsPerRowLimitFilter() { public boolean hasCellsPerColumnLimitFilter() { return filterCase_ == 12; } + /** * * @@ -8771,6 +8797,7 @@ public int getCellsPerColumnLimitFilter() { } return 0; } + /** * * @@ -8789,11 +8816,13 @@ public int getCellsPerColumnLimitFilter() { * @return This builder for chaining. */ public Builder setCellsPerColumnLimitFilter(int value) { + filterCase_ = 12; filter_ = value; onChanged(); return this; } + /** * * @@ -8833,6 +8862,7 @@ public Builder clearCellsPerColumnLimitFilter() { public boolean hasStripValueTransformer() { return filterCase_ == 13; } + /** * * @@ -8850,6 +8880,7 @@ public boolean getStripValueTransformer() { } return false; } + /** * * @@ -8863,11 +8894,13 @@ public boolean getStripValueTransformer() { * @return This builder for chaining. */ public Builder setStripValueTransformer(boolean value) { + filterCase_ = 13; filter_ = value; onChanged(); return this; } + /** * * @@ -8895,8 +8928,10 @@ public Builder clearStripValueTransformer() { * 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 @@ -8913,6 +8948,7 @@ public Builder clearStripValueTransformer() { public boolean hasApplyLabelTransformer() { return filterCase_ == 19; } + /** * * @@ -8920,8 +8956,10 @@ public 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 @@ -8951,6 +8989,7 @@ public java.lang.String getApplyLabelTransformer() { return (java.lang.String) ref; } } + /** * * @@ -8958,8 +8997,10 @@ public 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 @@ -8989,6 +9030,7 @@ public com.google.protobuf.ByteString getApplyLabelTransformerBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -8996,8 +9038,10 @@ public com.google.protobuf.ByteString getApplyLabelTransformerBytes() { * 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 @@ -9020,6 +9064,7 @@ public Builder setApplyLabelTransformer(java.lang.String value) { onChanged(); return this; } + /** * * @@ -9027,8 +9072,10 @@ public Builder setApplyLabelTransformer(java.lang.String value) { * 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 @@ -9049,6 +9096,7 @@ public Builder clearApplyLabelTransformer() { } return this; } + /** * * @@ -9056,8 +9104,10 @@ public Builder clearApplyLabelTransformer() { * 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 @@ -9082,17 +9132,6 @@ public Builder setApplyLabelTransformerBytes(com.google.protobuf.ByteString valu return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowFilter) } @@ -9114,7 +9153,18 @@ public RowFilter parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RowFilter(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java index 2f3f4f8402..d2627aa77c 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowFilterOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -36,6 +39,7 @@ public interface RowFilterOrBuilder * @return Whether the chain field is set. */ boolean hasChain(); + /** * * @@ -49,6 +53,7 @@ public interface RowFilterOrBuilder * @return The chain. */ com.google.bigtable.v2.RowFilter.Chain getChain(); + /** * * @@ -74,6 +79,7 @@ public interface RowFilterOrBuilder * @return Whether the interleave field is set. */ boolean hasInterleave(); + /** * * @@ -87,6 +93,7 @@ public interface RowFilterOrBuilder * @return The interleave. */ com.google.bigtable.v2.RowFilter.Interleave getInterleave(); + /** * * @@ -112,6 +119,7 @@ public interface RowFilterOrBuilder * @return Whether the condition field is set. */ boolean hasCondition(); + /** * * @@ -125,6 +133,7 @@ public interface RowFilterOrBuilder * @return The condition. */ com.google.bigtable.v2.RowFilter.Condition getCondition(); + /** * * @@ -145,54 +154,59 @@ public interface RowFilterOrBuilder * 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 + * + * 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]. * @@ -202,6 +216,7 @@ public interface RowFilterOrBuilder * @return Whether the sink field is set. */ boolean hasSink(); + /** * * @@ -210,54 +225,59 @@ public interface RowFilterOrBuilder * 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 + * + * 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]. * @@ -281,6 +301,7 @@ public interface RowFilterOrBuilder * @return Whether the passAllFilter field is set. */ boolean hasPassAllFilter(); + /** * * @@ -308,6 +329,7 @@ public interface RowFilterOrBuilder * @return Whether the blockAllFilter field is set. */ boolean hasBlockAllFilter(); + /** * * @@ -340,6 +362,7 @@ public interface RowFilterOrBuilder * @return Whether the rowKeyRegexFilter field is set. */ boolean hasRowKeyRegexFilter(); + /** * * @@ -372,6 +395,7 @@ public interface RowFilterOrBuilder * @return Whether the rowSampleFilter field is set. */ boolean hasRowSampleFilter(); + /** * * @@ -403,6 +427,7 @@ public interface RowFilterOrBuilder * @return Whether the familyNameRegexFilter field is set. */ boolean hasFamilyNameRegexFilter(); + /** * * @@ -420,6 +445,7 @@ public interface RowFilterOrBuilder * @return The familyNameRegexFilter. */ java.lang.String getFamilyNameRegexFilter(); + /** * * @@ -455,6 +481,7 @@ public interface RowFilterOrBuilder * @return Whether the columnQualifierRegexFilter field is set. */ boolean hasColumnQualifierRegexFilter(); + /** * * @@ -485,6 +512,7 @@ public interface RowFilterOrBuilder * @return Whether the columnRangeFilter field is set. */ boolean hasColumnRangeFilter(); + /** * * @@ -497,6 +525,7 @@ public interface RowFilterOrBuilder * @return The columnRangeFilter. */ com.google.bigtable.v2.ColumnRange getColumnRangeFilter(); + /** * * @@ -520,6 +549,7 @@ public interface RowFilterOrBuilder * @return Whether the timestampRangeFilter field is set. */ boolean hasTimestampRangeFilter(); + /** * * @@ -532,6 +562,7 @@ public interface RowFilterOrBuilder * @return The timestampRangeFilter. */ com.google.bigtable.v2.TimestampRange getTimestampRangeFilter(); + /** * * @@ -559,6 +590,7 @@ public interface RowFilterOrBuilder * @return Whether the valueRegexFilter field is set. */ boolean hasValueRegexFilter(); + /** * * @@ -588,6 +620,7 @@ public interface RowFilterOrBuilder * @return Whether the valueRangeFilter field is set. */ boolean hasValueRangeFilter(); + /** * * @@ -600,6 +633,7 @@ public interface RowFilterOrBuilder * @return The valueRangeFilter. */ com.google.bigtable.v2.ValueRange getValueRangeFilter(); + /** * * @@ -625,6 +659,7 @@ public interface RowFilterOrBuilder * @return Whether the cellsPerRowOffsetFilter field is set. */ boolean hasCellsPerRowOffsetFilter(); + /** * * @@ -654,6 +689,7 @@ public interface RowFilterOrBuilder * @return Whether the cellsPerRowLimitFilter field is set. */ boolean hasCellsPerRowLimitFilter(); + /** * * @@ -686,6 +722,7 @@ public interface RowFilterOrBuilder * @return Whether the cellsPerColumnLimitFilter field is set. */ boolean hasCellsPerColumnLimitFilter(); + /** * * @@ -716,6 +753,7 @@ public interface RowFilterOrBuilder * @return Whether the stripValueTransformer field is set. */ boolean hasStripValueTransformer(); + /** * * @@ -736,8 +774,10 @@ public interface RowFilterOrBuilder * 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 @@ -751,6 +791,7 @@ public interface RowFilterOrBuilder * @return Whether the applyLabelTransformer field is set. */ boolean hasApplyLabelTransformer(); + /** * * @@ -758,8 +799,10 @@ public interface RowFilterOrBuilder * 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 @@ -773,6 +816,7 @@ public interface RowFilterOrBuilder * @return The applyLabelTransformer. */ java.lang.String getApplyLabelTransformer(); + /** * * @@ -780,8 +824,10 @@ public interface RowFilterOrBuilder * 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 @@ -796,5 +842,5 @@ public interface RowFilterOrBuilder */ com.google.protobuf.ByteString getApplyLabelTransformerBytes(); - public com.google.bigtable.v2.RowFilter.FilterCase getFilterCase(); + com.google.bigtable.v2.RowFilter.FilterCase getFilterCase(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java index c1943694c3..413af8ee29 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -49,6 +52,7 @@ public interface RowOrBuilder * repeated .google.bigtable.v2.Family families = 2; */ java.util.List getFamiliesList(); + /** * * @@ -60,6 +64,7 @@ public interface RowOrBuilder * repeated .google.bigtable.v2.Family families = 2; */ com.google.bigtable.v2.Family getFamilies(int index); + /** * * @@ -71,6 +76,7 @@ public interface RowOrBuilder * repeated .google.bigtable.v2.Family families = 2; */ int getFamiliesCount(); + /** * * @@ -82,6 +88,7 @@ public interface RowOrBuilder * repeated .google.bigtable.v2.Family families = 2; */ java.util.List getFamiliesOrBuilderList(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java index 8e79c867b9..67e25ef04a 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,96 +29,36 @@ * * Protobuf type {@code google.bigtable.v2.RowRange} */ -public final class RowRange extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use RowRange.newBuilder() to construct. - private RowRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RowRange() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RowRange(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "RowRange"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use RowRange.newBuilder() to construct. + private RowRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private RowRange( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - startKeyCase_ = 1; - startKey_ = input.readBytes(); - break; - } - case 18: - { - startKeyCase_ = 2; - startKey_ = input.readBytes(); - break; - } - case 26: - { - endKeyCase_ = 3; - endKey_ = input.readBytes(); - break; - } - case 34: - { - endKeyCase_ = 4; - endKey_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowRange_fieldAccessorTable @@ -125,6 +67,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int startKeyCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object startKey_; public enum StartKeyCase @@ -139,6 +83,7 @@ public enum StartKeyCase 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. @@ -172,6 +117,8 @@ public StartKeyCase getStartKeyCase() { } private int endKeyCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object endKey_; public enum EndKeyCase @@ -186,6 +133,7 @@ public enum EndKeyCase 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. @@ -219,6 +167,7 @@ public EndKeyCase getEndKeyCase() { } public static final int START_KEY_CLOSED_FIELD_NUMBER = 1; + /** * * @@ -234,6 +183,7 @@ public EndKeyCase getEndKeyCase() { public boolean hasStartKeyClosed() { return startKeyCase_ == 1; } + /** * * @@ -254,6 +204,7 @@ public com.google.protobuf.ByteString getStartKeyClosed() { } public static final int START_KEY_OPEN_FIELD_NUMBER = 2; + /** * * @@ -269,6 +220,7 @@ public com.google.protobuf.ByteString getStartKeyClosed() { public boolean hasStartKeyOpen() { return startKeyCase_ == 2; } + /** * * @@ -289,6 +241,7 @@ public com.google.protobuf.ByteString getStartKeyOpen() { } public static final int END_KEY_OPEN_FIELD_NUMBER = 3; + /** * * @@ -304,6 +257,7 @@ public com.google.protobuf.ByteString getStartKeyOpen() { public boolean hasEndKeyOpen() { return endKeyCase_ == 3; } + /** * * @@ -324,6 +278,7 @@ public com.google.protobuf.ByteString getEndKeyOpen() { } public static final int END_KEY_CLOSED_FIELD_NUMBER = 4; + /** * * @@ -339,6 +294,7 @@ public com.google.protobuf.ByteString getEndKeyOpen() { public boolean hasEndKeyClosed() { return endKeyCase_ == 4; } + /** * * @@ -384,7 +340,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (endKeyCase_ == 4) { output.writeBytes(4, (com.google.protobuf.ByteString) endKey_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -413,7 +369,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBytesSize( 4, (com.google.protobuf.ByteString) endKey_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -450,7 +406,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -485,7 +441,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -526,38 +482,38 @@ public static com.google.bigtable.v2.RowRange parseFrom( public static com.google.bigtable.v2.RowRange parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -580,10 +536,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -593,7 +550,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.RowRange} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -603,7 +560,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowRange_fieldAccessorTable @@ -612,22 +569,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.RowRange.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; startKeyCase_ = 0; startKey_ = null; endKeyCase_ = 0; @@ -658,55 +609,23 @@ public com.google.bigtable.v2.RowRange build() { @java.lang.Override public com.google.bigtable.v2.RowRange buildPartial() { com.google.bigtable.v2.RowRange result = new com.google.bigtable.v2.RowRange(this); - if (startKeyCase_ == 1) { - result.startKey_ = startKey_; - } - if (startKeyCase_ == 2) { - result.startKey_ = startKey_; - } - if (endKeyCase_ == 3) { - result.endKey_ = endKey_; + if (bitField0_ != 0) { + buildPartial0(result); } - if (endKeyCase_ == 4) { - result.endKey_ = endKey_; - } - result.startKeyCase_ = startKeyCase_; - result.endKeyCase_ = endKeyCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + private void buildPartial0(com.google.bigtable.v2.RowRange result) { + int from_bitField0_ = bitField0_; } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -753,7 +672,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowRange other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -768,17 +687,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.RowRange parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.RowRange) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -810,6 +767,8 @@ public Builder clearEndKey() { return this; } + private int bitField0_; + /** * * @@ -824,6 +783,7 @@ public Builder clearEndKey() { public boolean hasStartKeyClosed() { return startKeyCase_ == 1; } + /** * * @@ -841,6 +801,7 @@ public com.google.protobuf.ByteString getStartKeyClosed() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -862,6 +823,7 @@ public Builder setStartKeyClosed(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -896,6 +858,7 @@ public Builder clearStartKeyClosed() { public boolean hasStartKeyOpen() { return startKeyCase_ == 2; } + /** * * @@ -913,6 +876,7 @@ public com.google.protobuf.ByteString getStartKeyOpen() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -934,6 +898,7 @@ public Builder setStartKeyOpen(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -968,6 +933,7 @@ public Builder clearStartKeyOpen() { public boolean hasEndKeyOpen() { return endKeyCase_ == 3; } + /** * * @@ -985,6 +951,7 @@ public com.google.protobuf.ByteString getEndKeyOpen() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1006,6 +973,7 @@ public Builder setEndKeyOpen(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1040,6 +1008,7 @@ public Builder clearEndKeyOpen() { public boolean hasEndKeyClosed() { return endKeyCase_ == 4; } + /** * * @@ -1057,6 +1026,7 @@ public com.google.protobuf.ByteString getEndKeyClosed() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1078,6 +1048,7 @@ public Builder setEndKeyClosed(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1098,17 +1069,6 @@ public Builder clearEndKeyClosed() { return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowRange) } @@ -1130,7 +1090,18 @@ public RowRange parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RowRange(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java index 9f5960e966..369f1b31cc 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowRangeOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface RowRangeOrBuilder * @return Whether the startKeyClosed field is set. */ boolean hasStartKeyClosed(); + /** * * @@ -60,6 +64,7 @@ public interface RowRangeOrBuilder * @return Whether the startKeyOpen field is set. */ boolean hasStartKeyOpen(); + /** * * @@ -85,6 +90,7 @@ public interface RowRangeOrBuilder * @return Whether the endKeyOpen field is set. */ boolean hasEndKeyOpen(); + /** * * @@ -110,6 +116,7 @@ public interface RowRangeOrBuilder * @return Whether the endKeyClosed field is set. */ boolean hasEndKeyClosed(); + /** * * @@ -123,7 +130,7 @@ public interface RowRangeOrBuilder */ com.google.protobuf.ByteString getEndKeyClosed(); - public com.google.bigtable.v2.RowRange.StartKeyCase getStartKeyCase(); + com.google.bigtable.v2.RowRange.StartKeyCase getStartKeyCase(); - public com.google.bigtable.v2.RowRange.EndKeyCase getEndKeyCase(); + com.google.bigtable.v2.RowRange.EndKeyCase getEndKeyCase(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java index ac77312d10..1a42c658cf 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,101 +29,39 @@ * * Protobuf type {@code google.bigtable.v2.RowSet} */ -public final class RowSet extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private RowSet(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private RowSet() { - rowKeys_ = java.util.Collections.emptyList(); + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); rowRanges_ = java.util.Collections.emptyList(); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new RowSet(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private RowSet( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - rowKeys_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - rowKeys_.add(input.readBytes()); - break; - } - case 18: - { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - rowRanges_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - rowRanges_.add( - input.readMessage(com.google.bigtable.v2.RowRange.parser(), extensionRegistry)); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - rowKeys_ = java.util.Collections.unmodifiableList(rowKeys_); // C - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - rowRanges_ = java.util.Collections.unmodifiableList(rowRanges_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - 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.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowSet_fieldAccessorTable @@ -130,7 +70,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int ROW_KEYS_FIELD_NUMBER = 1; - private java.util.List rowKeys_; + + @SuppressWarnings("serial") + private com.google.protobuf.Internal.ProtobufList rowKeys_ = + emptyList(com.google.protobuf.ByteString.class); + /** * * @@ -146,6 +90,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public java.util.List getRowKeysList() { return rowKeys_; } + /** * * @@ -160,6 +105,7 @@ public java.util.List getRowKeysList() { public int getRowKeysCount() { return rowKeys_.size(); } + /** * * @@ -177,7 +123,10 @@ public com.google.protobuf.ByteString getRowKeys(int index) { } public static final int ROW_RANGES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List rowRanges_; + /** * * @@ -191,6 +140,7 @@ public com.google.protobuf.ByteString getRowKeys(int index) { public java.util.List getRowRangesList() { return rowRanges_; } + /** * * @@ -205,6 +155,7 @@ public java.util.List getRowRangesList() { getRowRangesOrBuilderList() { return rowRanges_; } + /** * * @@ -218,6 +169,7 @@ public java.util.List getRowRangesList() { public int getRowRangesCount() { return rowRanges_.size(); } + /** * * @@ -231,6 +183,7 @@ public int getRowRangesCount() { public com.google.bigtable.v2.RowRange getRowRanges(int index) { return rowRanges_.get(index); } + /** * * @@ -265,7 +218,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < rowRanges_.size(); i++) { output.writeMessage(2, rowRanges_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -285,7 +238,7 @@ public int getSerializedSize() { for (int i = 0; i < rowRanges_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, rowRanges_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -302,7 +255,7 @@ public boolean equals(final java.lang.Object obj) { if (!getRowKeysList().equals(other.getRowKeysList())) return false; if (!getRowRangesList().equals(other.getRowRangesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -321,7 +274,7 @@ public int hashCode() { hash = (37 * hash) + ROW_RANGES_FIELD_NUMBER; hash = (53 * hash) + getRowRangesList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -362,38 +315,38 @@ public static com.google.bigtable.v2.RowSet parseFrom( public static com.google.bigtable.v2.RowSet parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -416,10 +369,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -429,7 +383,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.RowSet} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -438,7 +392,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_RowSet_fieldAccessorTable @@ -447,32 +401,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.RowSet.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getRowRangesFieldBuilder(); - } } @java.lang.Override public Builder clear() { super.clear(); - rowKeys_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = 0; + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); if (rowRangesBuilder_ == null) { rowRanges_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); } else { + rowRanges_ = null; rowRangesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -498,12 +444,15 @@ public com.google.bigtable.v2.RowSet build() { @java.lang.Override public com.google.bigtable.v2.RowSet buildPartial() { com.google.bigtable.v2.RowSet result = new com.google.bigtable.v2.RowSet(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - rowKeys_ = java.util.Collections.unmodifiableList(rowKeys_); - bitField0_ = (bitField0_ & ~0x00000001); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); } - result.rowKeys_ = rowKeys_; + 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_); @@ -513,41 +462,14 @@ public com.google.bigtable.v2.RowSet buildPartial() { } else { result.rowRanges_ = rowRangesBuilder_.build(); } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -565,7 +487,8 @@ public Builder mergeFrom(com.google.bigtable.v2.RowSet other) { if (!other.rowKeys_.isEmpty()) { if (rowKeys_.isEmpty()) { rowKeys_ = other.rowKeys_; - bitField0_ = (bitField0_ & ~0x00000001); + rowKeys_.makeImmutable(); + bitField0_ |= 0x00000001; } else { ensureRowKeysIsMutable(); rowKeys_.addAll(other.rowKeys_); @@ -591,15 +514,15 @@ public Builder mergeFrom(com.google.bigtable.v2.RowSet other) { rowRanges_ = other.rowRanges_; bitField0_ = (bitField0_ & ~0x00000002); rowRangesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getRowRangesFieldBuilder() + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders + ? internalGetRowRangesFieldBuilder() : null; } else { rowRangesBuilder_.addAllMessages(other.rowRanges_); } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -614,31 +537,65 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.RowSet parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.RowSet) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } private int bitField0_; - private java.util.List rowKeys_ = - java.util.Collections.emptyList(); + private com.google.protobuf.Internal.ProtobufList rowKeys_ = + emptyList(com.google.protobuf.ByteString.class); private void ensureRowKeysIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - rowKeys_ = new java.util.ArrayList(rowKeys_); - bitField0_ |= 0x00000001; + if (!rowKeys_.isModifiable()) { + rowKeys_ = makeMutableCopy(rowKeys_); } + bitField0_ |= 0x00000001; } + /** * * @@ -651,10 +608,10 @@ private void ensureRowKeysIsMutable() { * @return A list containing the rowKeys. */ public java.util.List getRowKeysList() { - return ((bitField0_ & 0x00000001) != 0) - ? java.util.Collections.unmodifiableList(rowKeys_) - : rowKeys_; + rowKeys_.makeImmutable(); + return rowKeys_; } + /** * * @@ -669,6 +626,7 @@ public java.util.List getRowKeysList() { public int getRowKeysCount() { return rowKeys_.size(); } + /** * * @@ -684,6 +642,7 @@ public int getRowKeysCount() { public com.google.protobuf.ByteString getRowKeys(int index) { return rowKeys_.get(index); } + /** * * @@ -703,9 +662,11 @@ public Builder setRowKeys(int index, com.google.protobuf.ByteString value) { } ensureRowKeysIsMutable(); rowKeys_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -724,9 +685,11 @@ public Builder addRowKeys(com.google.protobuf.ByteString value) { } ensureRowKeysIsMutable(); rowKeys_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -743,9 +706,11 @@ public Builder addAllRowKeys( java.lang.Iterable values) { ensureRowKeysIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rowKeys_); + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -758,7 +723,7 @@ public Builder addAllRowKeys( * @return This builder for chaining. */ public Builder clearRowKeys() { - rowKeys_ = java.util.Collections.emptyList(); + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; @@ -774,7 +739,7 @@ private void ensureRowRangesIsMutable() { } } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowRange, com.google.bigtable.v2.RowRange.Builder, com.google.bigtable.v2.RowRangeOrBuilder> @@ -796,6 +761,7 @@ public java.util.List getRowRangesList() { return rowRangesBuilder_.getMessageList(); } } + /** * * @@ -812,6 +778,7 @@ public int getRowRangesCount() { return rowRangesBuilder_.getCount(); } } + /** * * @@ -828,6 +795,7 @@ public com.google.bigtable.v2.RowRange getRowRanges(int index) { return rowRangesBuilder_.getMessage(index); } } + /** * * @@ -850,6 +818,7 @@ public Builder setRowRanges(int index, com.google.bigtable.v2.RowRange value) { } return this; } + /** * * @@ -870,6 +839,7 @@ public Builder setRowRanges( } return this; } + /** * * @@ -892,6 +862,7 @@ public Builder addRowRanges(com.google.bigtable.v2.RowRange value) { } return this; } + /** * * @@ -914,6 +885,7 @@ public Builder addRowRanges(int index, com.google.bigtable.v2.RowRange value) { } return this; } + /** * * @@ -933,6 +905,7 @@ public Builder addRowRanges(com.google.bigtable.v2.RowRange.Builder builderForVa } return this; } + /** * * @@ -953,6 +926,7 @@ public Builder addRowRanges( } return this; } + /** * * @@ -973,6 +947,7 @@ public Builder addAllRowRanges( } return this; } + /** * * @@ -992,6 +967,7 @@ public Builder clearRowRanges() { } return this; } + /** * * @@ -1011,6 +987,7 @@ public Builder removeRowRanges(int index) { } return this; } + /** * * @@ -1021,8 +998,9 @@ public Builder removeRowRanges(int index) { * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ public com.google.bigtable.v2.RowRange.Builder getRowRangesBuilder(int index) { - return getRowRangesFieldBuilder().getBuilder(index); + return internalGetRowRangesFieldBuilder().getBuilder(index); } + /** * * @@ -1039,6 +1017,7 @@ public com.google.bigtable.v2.RowRangeOrBuilder getRowRangesOrBuilder(int index) return rowRangesBuilder_.getMessageOrBuilder(index); } } + /** * * @@ -1056,6 +1035,7 @@ public com.google.bigtable.v2.RowRangeOrBuilder getRowRangesOrBuilder(int index) return java.util.Collections.unmodifiableList(rowRanges_); } } + /** * * @@ -1066,9 +1046,10 @@ public com.google.bigtable.v2.RowRangeOrBuilder getRowRangesOrBuilder(int index) * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ public com.google.bigtable.v2.RowRange.Builder addRowRangesBuilder() { - return getRowRangesFieldBuilder() + return internalGetRowRangesFieldBuilder() .addBuilder(com.google.bigtable.v2.RowRange.getDefaultInstance()); } + /** * * @@ -1079,9 +1060,10 @@ public com.google.bigtable.v2.RowRange.Builder addRowRangesBuilder() { * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ public com.google.bigtable.v2.RowRange.Builder addRowRangesBuilder(int index) { - return getRowRangesFieldBuilder() + return internalGetRowRangesFieldBuilder() .addBuilder(index, com.google.bigtable.v2.RowRange.getDefaultInstance()); } + /** * * @@ -1092,17 +1074,17 @@ public com.google.bigtable.v2.RowRange.Builder addRowRangesBuilder(int index) { * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ public java.util.List getRowRangesBuilderList() { - return getRowRangesFieldBuilder().getBuilderList(); + return internalGetRowRangesFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3< + private com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowRange, com.google.bigtable.v2.RowRange.Builder, com.google.bigtable.v2.RowRangeOrBuilder> - getRowRangesFieldBuilder() { + internalGetRowRangesFieldBuilder() { if (rowRangesBuilder_ == null) { rowRangesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< + new com.google.protobuf.RepeatedFieldBuilder< com.google.bigtable.v2.RowRange, com.google.bigtable.v2.RowRange.Builder, com.google.bigtable.v2.RowRangeOrBuilder>( @@ -1112,17 +1094,6 @@ public java.util.List getRowRangesBuild return rowRangesBuilder_; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.RowSet) } @@ -1144,7 +1115,18 @@ public RowSet parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new RowSet(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java index 31f8fb9677..dc88b941df 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RowSetOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface RowSetOrBuilder * @return A list containing the rowKeys. */ java.util.List getRowKeysList(); + /** * * @@ -47,6 +51,7 @@ public interface RowSetOrBuilder * @return The count of rowKeys. */ int getRowKeysCount(); + /** * * @@ -71,6 +76,7 @@ public interface RowSetOrBuilder * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ java.util.List getRowRangesList(); + /** * * @@ -81,6 +87,7 @@ public interface RowSetOrBuilder * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ com.google.bigtable.v2.RowRange getRowRanges(int index); + /** * * @@ -91,6 +98,7 @@ public interface RowSetOrBuilder * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ int getRowRangesCount(); + /** * * @@ -101,6 +109,7 @@ public interface RowSetOrBuilder * repeated .google.bigtable.v2.RowRange row_ranges = 2; */ java.util.List getRowRangesOrBuilderList(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java index b6d2ab9cb5..94757329ab 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,90 +29,42 @@ * * Protobuf type {@code google.bigtable.v2.SampleRowKeysRequest} */ -public final class SampleRowKeysRequest extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private SampleRowKeysRequest(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private SampleRowKeysRequest() { tableName_ = ""; + authorizedViewName_ = ""; + materializedViewName_ = ""; appProfileId_ = ""; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SampleRowKeysRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SampleRowKeysRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - - tableName_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - - appProfileId_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable @@ -120,18 +74,22 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int TABLE_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object tableName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableName_ = ""; + /** * * *
    -   * Required. The unique name of the table from which to sample row keys.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -148,17 +106,19 @@ public java.lang.String getTableName() { return s; } } + /** * * *
    -   * Required. The unique name of the table from which to sample row keys.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -176,8 +136,139 @@ public com.google.protobuf.ByteString getTableNameBytes() { } } + 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; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; + /** * * @@ -202,6 +293,7 @@ public java.lang.String getAppProfileId() { return s; } } + /** * * @@ -241,13 +333,19 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getTableNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + 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 (!getAppProfileIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, authorizedViewName_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 5, materializedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -256,13 +354,19 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getTableNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + 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 (!getAppProfileIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appProfileId_); + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(materializedViewName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(5, materializedViewName_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -279,8 +383,10 @@ public boolean equals(final java.lang.Object obj) { (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 (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -293,9 +399,13 @@ public int hashCode() { 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) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -337,38 +447,38 @@ public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom( public static com.google.bigtable.v2.SampleRowKeysRequest parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -391,10 +501,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -404,7 +515,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.SampleRowKeysRequest} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -414,7 +525,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_SampleRowKeysRequest_fieldAccessorTable @@ -424,26 +535,20 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.SampleRowKeysRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; tableName_ = ""; - + authorizedViewName_ = ""; + materializedViewName_ = ""; appProfileId_ = ""; - return this; } @@ -471,43 +576,27 @@ public com.google.bigtable.v2.SampleRowKeysRequest build() { public com.google.bigtable.v2.SampleRowKeysRequest buildPartial() { com.google.bigtable.v2.SampleRowKeysRequest result = new com.google.bigtable.v2.SampleRowKeysRequest(this); - result.tableName_ = tableName_; - result.appProfileId_ = appProfileId_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -524,13 +613,25 @@ 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.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -545,32 +646,74 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.SampleRowKeysRequest parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.SampleRowKeysRequest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object tableName_ = ""; + /** * * *
    -     * Required. The unique name of the table from which to sample row keys.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. @@ -586,17 +729,19 @@ public java.lang.String getTableName() { return (java.lang.String) ref; } } + /** * * *
    -     * Required. The unique name of the table from which to sample row keys.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The bytes for tableName. @@ -612,17 +757,19 @@ public com.google.protobuf.ByteString getTableNameBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * *
    -     * Required. The unique name of the table from which to sample row keys.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The tableName to set. @@ -632,43 +779,47 @@ 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 sample row keys.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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; } + /** * * *
    -     * Required. The unique name of the table from which to sample row keys.
    +     * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @param value The bytes for tableName to set. @@ -679,13 +830,291 @@ public Builder setTableNameBytes(com.google.protobuf.ByteString value) { 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_ = ""; + /** * * @@ -709,6 +1138,7 @@ public java.lang.String getAppProfileId() { return (java.lang.String) ref; } } + /** * * @@ -732,6 +1162,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { return (com.google.protobuf.ByteString) ref; } } + /** * * @@ -749,11 +1180,12 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } + /** * * @@ -767,11 +1199,12 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } + /** * * @@ -790,23 +1223,12 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SampleRowKeysRequest) } @@ -828,7 +1250,18 @@ public SampleRowKeysRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SampleRowKeysRequest(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java index 530f63e413..05555052a7 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysRequestOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -27,35 +30,112 @@ public interface SampleRowKeysRequestOrBuilder * * *
    -   * Required. The unique name of the table from which to sample row keys.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * string table_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } * * * @return The tableName. */ java.lang.String getTableName(); + /** * * *
    -   * Required. The unique name of the table from which to sample row keys.
    +   * 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) = REQUIRED, (.google.api.resource_reference) = { ... } + * 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(); + /** * * @@ -69,6 +149,7 @@ public interface SampleRowKeysRequestOrBuilder * @return The appProfileId. */ java.lang.String getAppProfileId(); + /** * * diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java index 22b36359d0..5b558958b5 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,13 +29,25 @@ * * Protobuf type {@code google.bigtable.v2.SampleRowKeysResponse} */ -public final class SampleRowKeysResponse extends com.google.protobuf.GeneratedMessageV3 +@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.GeneratedMessageV3.Builder builder) { + private SampleRowKeysResponse(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } @@ -41,71 +55,13 @@ private SampleRowKeysResponse() { rowKey_ = com.google.protobuf.ByteString.EMPTY; } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new SampleRowKeysResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private SampleRowKeysResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - rowKey_ = input.readBytes(); - break; - } - case 16: - { - offsetBytes_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable @@ -115,7 +71,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int ROW_KEY_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString rowKey_; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -139,7 +96,8 @@ public com.google.protobuf.ByteString getRowKey() { } public static final int OFFSET_BYTES_FIELD_NUMBER = 2; - private long offsetBytes_; + private long offsetBytes_ = 0L; + /** * * @@ -179,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (offsetBytes_ != 0L) { output.writeInt64(2, offsetBytes_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -194,7 +152,7 @@ public int getSerializedSize() { if (offsetBytes_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, offsetBytes_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +170,7 @@ public boolean equals(final java.lang.Object obj) { if (!getRowKey().equals(other.getRowKey())) return false; if (getOffsetBytes() != other.getOffsetBytes()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -227,7 +185,7 @@ public int hashCode() { hash = (53 * hash) + getRowKey().hashCode(); hash = (37 * hash) + OFFSET_BYTES_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffsetBytes()); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -269,38 +227,38 @@ public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom( public static com.google.bigtable.v2.SampleRowKeysResponse parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -323,10 +281,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -336,7 +295,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.SampleRowKeysResponse} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -346,7 +305,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_SampleRowKeysResponse_fieldAccessorTable @@ -356,26 +315,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.SampleRowKeysResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; rowKey_ = com.google.protobuf.ByteString.EMPTY; - offsetBytes_ = 0L; - return this; } @@ -403,43 +354,21 @@ public com.google.bigtable.v2.SampleRowKeysResponse build() { public com.google.bigtable.v2.SampleRowKeysResponse buildPartial() { com.google.bigtable.v2.SampleRowKeysResponse result = new com.google.bigtable.v2.SampleRowKeysResponse(this); - result.rowKey_ = rowKey_; - result.offsetBytes_ = offsetBytes_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -454,13 +383,13 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysResponse other) { if (other == com.google.bigtable.v2.SampleRowKeysResponse.getDefaultInstance()) return this; - if (other.getRowKey() != com.google.protobuf.ByteString.EMPTY) { + if (!other.getRowKey().isEmpty()) { setRowKey(other.getRowKey()); } if (other.getOffsetBytes() != 0L) { setOffsetBytes(other.getOffsetBytes()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -475,21 +404,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.SampleRowKeysResponse parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.SampleRowKeysResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.protobuf.ByteString rowKey_ = com.google.protobuf.ByteString.EMPTY; + /** * * @@ -511,6 +469,7 @@ public Builder mergeFrom( public com.google.protobuf.ByteString getRowKey() { return rowKey_; } + /** * * @@ -533,11 +492,12 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -556,13 +516,14 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * @return This builder for chaining. */ public Builder clearRowKey() { - + bitField0_ = (bitField0_ & ~0x00000001); rowKey_ = getDefaultInstance().getRowKey(); onChanged(); return this; } private long offsetBytes_; + /** * * @@ -581,6 +542,7 @@ public Builder clearRowKey() { public long getOffsetBytes() { return offsetBytes_; } + /** * * @@ -599,9 +561,11 @@ public long getOffsetBytes() { public Builder setOffsetBytes(long value) { offsetBytes_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -617,23 +581,12 @@ public Builder setOffsetBytes(long value) { * @return This builder for chaining. */ public Builder clearOffsetBytes() { - + bitField0_ = (bitField0_ & ~0x00000002); offsetBytes_ = 0L; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.SampleRowKeysResponse) } @@ -655,7 +608,18 @@ public SampleRowKeysResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new SampleRowKeysResponse(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java index a6dac71fbb..92a7ba2385 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/SampleRowKeysResponseOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationToken.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationToken.java new file mode 100644 index 0000000000..3d9abfac89 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokenOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokenOrBuilder.java new file mode 100644 index 0000000000..ef484a692e --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokens.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokens.java new file mode 100644 index 0000000000..f1c15adfe7 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokensOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokensOrBuilder.java new file mode 100644 index 0000000000..06af7a3e32 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartition.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartition.java new file mode 100644 index 0000000000..7422e1f6e0 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartitionOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartitionOrBuilder.java new file mode 100644 index 0000000000..9b63bfee1b --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java index fa94994e4f..b616cb8488 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TableName.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -154,7 +154,7 @@ public boolean equals(Object o) { if (o == this) { return true; } - if (o != null || getClass() == o.getClass()) { + if (o != null && getClass() == o.getClass()) { TableName that = ((TableName) o); return Objects.equals(this.project, that.project) && Objects.equals(this.instance, that.instance) @@ -211,9 +211,9 @@ public Builder setTable(String table) { } private Builder(TableName tableName) { - project = tableName.project; - instance = tableName.instance; - table = tableName.table; + this.project = tableName.project; + this.instance = tableName.instance; + this.table = tableName.table; } public TableName build() { diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java index 513e434bc4..126781fa71 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,75 +29,29 @@ * * Protobuf type {@code google.bigtable.v2.TimestampRange} */ -public final class TimestampRange extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use TimestampRange.newBuilder() to construct. - private TimestampRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private TimestampRange() {} - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new TimestampRange(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "TimestampRange"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use TimestampRange.newBuilder() to construct. + private TimestampRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private TimestampRange( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: - { - startTimestampMicros_ = input.readInt64(); - break; - } - case 16: - { - endTimestampMicros_ = input.readInt64(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private TimestampRange() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto @@ -103,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable @@ -113,7 +69,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int START_TIMESTAMP_MICROS_FIELD_NUMBER = 1; - private long startTimestampMicros_; + private long startTimestampMicros_ = 0L; + /** * * @@ -131,7 +88,8 @@ public long getStartTimestampMicros() { } public static final int END_TIMESTAMP_MICROS_FIELD_NUMBER = 2; - private long endTimestampMicros_; + private long endTimestampMicros_ = 0L; + /** * * @@ -168,7 +126,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (endTimestampMicros_ != 0L) { output.writeInt64(2, endTimestampMicros_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -183,7 +141,7 @@ public int getSerializedSize() { if (endTimestampMicros_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, endTimestampMicros_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -200,7 +158,7 @@ public boolean equals(final java.lang.Object obj) { if (getStartTimestampMicros() != other.getStartTimestampMicros()) return false; if (getEndTimestampMicros() != other.getEndTimestampMicros()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -215,7 +173,7 @@ public int hashCode() { 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) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -256,38 +214,38 @@ public static com.google.bigtable.v2.TimestampRange parseFrom( public static com.google.bigtable.v2.TimestampRange parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -310,10 +268,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -323,7 +282,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.TimestampRange} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -333,7 +292,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable @@ -343,26 +302,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.TimestampRange.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; startTimestampMicros_ = 0L; - endTimestampMicros_ = 0L; - return this; } @@ -390,43 +341,21 @@ public com.google.bigtable.v2.TimestampRange build() { public com.google.bigtable.v2.TimestampRange buildPartial() { com.google.bigtable.v2.TimestampRange result = new com.google.bigtable.v2.TimestampRange(this); - result.startTimestampMicros_ = startTimestampMicros_; - result.endTimestampMicros_ = endTimestampMicros_; + if (bitField0_ != 0) { + buildPartial0(result); + } onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -447,7 +376,7 @@ public Builder mergeFrom(com.google.bigtable.v2.TimestampRange other) { if (other.getEndTimestampMicros() != 0L) { setEndTimestampMicros(other.getEndTimestampMicros()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -462,21 +391,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.TimestampRange parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.TimestampRange) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private long startTimestampMicros_; + /** * * @@ -492,6 +450,7 @@ public Builder mergeFrom( public long getStartTimestampMicros() { return startTimestampMicros_; } + /** * * @@ -507,9 +466,11 @@ public long getStartTimestampMicros() { public Builder setStartTimestampMicros(long value) { startTimestampMicros_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } + /** * * @@ -522,13 +483,14 @@ public Builder setStartTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearStartTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000001); startTimestampMicros_ = 0L; onChanged(); return this; } private long endTimestampMicros_; + /** * * @@ -544,6 +506,7 @@ public Builder clearStartTimestampMicros() { public long getEndTimestampMicros() { return endTimestampMicros_; } + /** * * @@ -559,9 +522,11 @@ public long getEndTimestampMicros() { public Builder setEndTimestampMicros(long value) { endTimestampMicros_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + /** * * @@ -574,23 +539,12 @@ public Builder setEndTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearEndTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000002); endTimestampMicros_ = 0L; onChanged(); return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.TimestampRange) } @@ -612,7 +566,18 @@ public TimestampRange parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new TimestampRange(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java index a531978ae1..9cf7860643 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TimestampRangeOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Type.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Type.java new file mode 100644 index 0000000000..74f0dda1dc --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypeOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypeOrBuilder.java new file mode 100644 index 0000000000..9c8366ba78 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypesProto.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypesProto.java new file mode 100644 index 0000000000..abb352ec7a --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Value.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Value.java new file mode 100644 index 0000000000..060b7ea61e --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueOrBuilder.java new file mode 100644 index 0000000000..be294593e7 --- /dev/null +++ b/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/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java index 738708f614..ae3f11b4f9 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,9 @@ * 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; @@ -27,89 +29,29 @@ * * Protobuf type {@code google.bigtable.v2.ValueRange} */ -public final class ValueRange extends com.google.protobuf.GeneratedMessageV3 +@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; - // Use ValueRange.newBuilder() to construct. - private ValueRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ValueRange() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ValueRange(); + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "ValueRange"); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + // Use ValueRange.newBuilder() to construct. + private ValueRange(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); } - private ValueRange( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - startValueCase_ = 1; - startValue_ = input.readBytes(); - break; - } - case 18: - { - startValueCase_ = 2; - startValue_ = input.readBytes(); - break; - } - case 26: - { - endValueCase_ = 3; - endValue_ = input.readBytes(); - break; - } - case 34: - { - endValueCase_ = 4; - endValue_ = input.readBytes(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + private ValueRange() {} public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto @@ -117,7 +59,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable @@ -127,6 +69,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int startValueCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object startValue_; public enum StartValueCase @@ -141,6 +85,7 @@ public enum StartValueCase 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. @@ -174,6 +119,8 @@ public StartValueCase getStartValueCase() { } private int endValueCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object endValue_; public enum EndValueCase @@ -188,6 +135,7 @@ public enum EndValueCase 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. @@ -221,6 +169,7 @@ public EndValueCase getEndValueCase() { } public static final int START_VALUE_CLOSED_FIELD_NUMBER = 1; + /** * * @@ -236,6 +185,7 @@ public EndValueCase getEndValueCase() { public boolean hasStartValueClosed() { return startValueCase_ == 1; } + /** * * @@ -256,6 +206,7 @@ public com.google.protobuf.ByteString getStartValueClosed() { } public static final int START_VALUE_OPEN_FIELD_NUMBER = 2; + /** * * @@ -271,6 +222,7 @@ public com.google.protobuf.ByteString getStartValueClosed() { public boolean hasStartValueOpen() { return startValueCase_ == 2; } + /** * * @@ -291,6 +243,7 @@ public com.google.protobuf.ByteString getStartValueOpen() { } public static final int END_VALUE_CLOSED_FIELD_NUMBER = 3; + /** * * @@ -306,6 +259,7 @@ public com.google.protobuf.ByteString getStartValueOpen() { public boolean hasEndValueClosed() { return endValueCase_ == 3; } + /** * * @@ -326,6 +280,7 @@ public com.google.protobuf.ByteString getEndValueClosed() { } public static final int END_VALUE_OPEN_FIELD_NUMBER = 4; + /** * * @@ -341,6 +296,7 @@ public com.google.protobuf.ByteString getEndValueClosed() { public boolean hasEndValueOpen() { return endValueCase_ == 4; } + /** * * @@ -386,7 +342,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (endValueCase_ == 4) { output.writeBytes(4, (com.google.protobuf.ByteString) endValue_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -415,7 +371,7 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeBytesSize( 4, (com.google.protobuf.ByteString) endValue_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -452,7 +408,7 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -487,7 +443,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -528,38 +484,38 @@ public static com.google.bigtable.v2.ValueRange parseFrom( public static com.google.bigtable.v2.ValueRange parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + 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.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseDelimitedWithIOException( + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + 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.GeneratedMessageV3.parseWithIOException( + return com.google.protobuf.GeneratedMessage.parseWithIOException( PARSER, input, extensionRegistry); } @@ -582,10 +538,11 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** * * @@ -595,7 +552,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code google.bigtable.v2.ValueRange} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + 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 { @@ -605,7 +562,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable @@ -615,22 +572,16 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.ValueRange.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; startValueCase_ = 0; startValue_ = null; endValueCase_ = 0; @@ -661,55 +612,23 @@ public com.google.bigtable.v2.ValueRange build() { @java.lang.Override public com.google.bigtable.v2.ValueRange buildPartial() { com.google.bigtable.v2.ValueRange result = new com.google.bigtable.v2.ValueRange(this); - if (startValueCase_ == 1) { - result.startValue_ = startValue_; - } - if (startValueCase_ == 2) { - result.startValue_ = startValue_; - } - if (endValueCase_ == 3) { - result.endValue_ = endValue_; + if (bitField0_ != 0) { + buildPartial0(result); } - if (endValueCase_ == 4) { - result.endValue_ = endValue_; - } - result.startValueCase_ = startValueCase_; - result.endValueCase_ = endValueCase_; + buildPartialOneofs(result); onBuilt(); return result; } - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + private void buildPartial0(com.google.bigtable.v2.ValueRange result) { + int from_bitField0_ = bitField0_; } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 @@ -756,7 +675,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ValueRange other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -771,17 +690,55 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ValueRange parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + 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) { - parsedMessage = (com.google.bigtable.v2.ValueRange) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -813,6 +770,8 @@ public Builder clearEndValue() { return this; } + private int bitField0_; + /** * * @@ -827,6 +786,7 @@ public Builder clearEndValue() { public boolean hasStartValueClosed() { return startValueCase_ == 1; } + /** * * @@ -844,6 +804,7 @@ public com.google.protobuf.ByteString getStartValueClosed() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -865,6 +826,7 @@ public Builder setStartValueClosed(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -899,6 +861,7 @@ public Builder clearStartValueClosed() { public boolean hasStartValueOpen() { return startValueCase_ == 2; } + /** * * @@ -916,6 +879,7 @@ public com.google.protobuf.ByteString getStartValueOpen() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -937,6 +901,7 @@ public Builder setStartValueOpen(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -971,6 +936,7 @@ public Builder clearStartValueOpen() { public boolean hasEndValueClosed() { return endValueCase_ == 3; } + /** * * @@ -988,6 +954,7 @@ public com.google.protobuf.ByteString getEndValueClosed() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1009,6 +976,7 @@ public Builder setEndValueClosed(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1043,6 +1011,7 @@ public Builder clearEndValueClosed() { public boolean hasEndValueOpen() { return endValueCase_ == 4; } + /** * * @@ -1060,6 +1029,7 @@ public com.google.protobuf.ByteString getEndValueOpen() { } return com.google.protobuf.ByteString.EMPTY; } + /** * * @@ -1081,6 +1051,7 @@ public Builder setEndValueOpen(com.google.protobuf.ByteString value) { onChanged(); return this; } + /** * * @@ -1101,17 +1072,6 @@ public Builder clearEndValueOpen() { return this; } - @java.lang.Override - public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.ValueRange) } @@ -1133,7 +1093,18 @@ public ValueRange parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ValueRange(input, extensionRegistry); + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); } }; diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java index dbd31d63bd..3576fd1187 100644 --- a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueRangeOrBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,10 +14,13 @@ * 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) @@ -35,6 +38,7 @@ public interface ValueRangeOrBuilder * @return Whether the startValueClosed field is set. */ boolean hasStartValueClosed(); + /** * * @@ -60,6 +64,7 @@ public interface ValueRangeOrBuilder * @return Whether the startValueOpen field is set. */ boolean hasStartValueOpen(); + /** * * @@ -85,6 +90,7 @@ public interface ValueRangeOrBuilder * @return Whether the endValueClosed field is set. */ boolean hasEndValueClosed(); + /** * * @@ -110,6 +116,7 @@ public interface ValueRangeOrBuilder * @return Whether the endValueOpen field is set. */ boolean hasEndValueOpen(); + /** * * @@ -123,7 +130,7 @@ public interface ValueRangeOrBuilder */ com.google.protobuf.ByteString getEndValueOpen(); - public com.google.bigtable.v2.ValueRange.StartValueCase getStartValueCase(); + com.google.bigtable.v2.ValueRange.StartValueCase getStartValueCase(); - public com.google.bigtable.v2.ValueRange.EndValueCase getEndValueCase(); + com.google.bigtable.v2.ValueRange.EndValueCase getEndValueCase(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto index 32aaba21d0..66536293e3 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/bigtable.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 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. @@ -20,21 +20,38 @@ 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/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 = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; +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: "bigtable.googleapis.com/Table" + 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 { @@ -56,6 +73,29 @@ service Bigtable { 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"; @@ -65,9 +105,31 @@ service Bigtable { // 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) { + 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"; @@ -79,9 +141,25 @@ service Bigtable { 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"; + option (google.api.method_signature) = + "table_name,row_key,mutations,app_profile_id"; } // Mutates multiple rows in a batch. Each individual row is mutated @@ -91,19 +169,70 @@ service Bigtable { 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) { + 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.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"; + 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 @@ -111,25 +240,144 @@ service Bigtable { // 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) { + 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"; + 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"; } } // Request message for Bigtable.ReadRows. message ReadRowsRequest { - // Required. The unique name of the table from which to read. + // 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) = REQUIRED, + (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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/MaterializedView" } ]; @@ -137,16 +385,34 @@ message ReadRowsRequest { // "default" application profile will be used. string app_profile_id = 5; - // The row keys and/or ranges to read. If not specified, reads from all rows. + // The row keys and/or ranges to read sequentially. If not specified, reads + // from all rows. RowSet rows = 2; // The filter to apply to the contents of the specified row(s). If unset, // reads the entirety of each row. RowFilter filter = 3; - // The read will terminate after committing to N rows' worth of results. The + // The read will stop after committing to N rows' worth of results. The // default (zero) is to return all results. int64 rows_limit = 4; + + // 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. @@ -226,17 +492,48 @@ message ReadRowsResponse { // 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 { - // Required. The unique name of the table from which to sample row keys. + // 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) = REQUIRED, + (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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/MaterializedView" } ]; @@ -265,13 +562,27 @@ message SampleRowKeysResponse { // Request message for Bigtable.MutateRow. message MutateRowRequest { - // Required. The unique name of the table to which the mutation should be applied. + // 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) = REQUIRED, + (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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/AuthorizedView" } ]; @@ -282,16 +593,18 @@ message MutateRowRequest { // 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. + // 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 { - -} +message MutateRowResponse {} // Request message for BigtableService.MutateRows. message MutateRowsRequest { @@ -300,18 +613,37 @@ message MutateRowsRequest { // 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. + // 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; } - // Required. The unique name of the table to which the mutations should be applied. + // 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) = REQUIRED, + (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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/AuthorizedView" } ]; @@ -344,18 +676,58 @@ message MutateRowsResponse { // 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 { - // Required. The unique name of the table to which the conditional mutation should be - // applied. + // 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) = REQUIRED, + (google.api.field_behavior) = OPTIONAL, (google.api.resource_reference) = { - type: "bigtable.googleapis.com/Table" + 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" } ]; @@ -363,7 +735,8 @@ message CheckAndMutateRowRequest { // "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. + // 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 @@ -394,16 +767,49 @@ message CheckAndMutateRowResponse { bool predicate_matched = 1; } +// Request message for client connection keep-alive and warming. +message PingAndWarmRequest { + // Required. The unique name of the instance to check permissions for as well + // as respond. Values are of the form + // `projects//instances/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/Instance" + } + ]; + + // This value specifies routing for replication. If not specified, the + // "default" application profile will be used. + string app_profile_id = 2; +} + +// Response message for Bigtable.PingAndWarm connection keepalive and warming. +message PingAndWarmResponse {} + // Request message for Bigtable.ReadModifyWriteRow. message ReadModifyWriteRowRequest { - // Required. The unique name of the table to which the read/modify/write rules should be - // applied. + // 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) = REQUIRED, + (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: "bigtable.googleapis.com/Table" + type: "bigtableadmin.googleapis.com/AuthorizedView" } ]; @@ -411,13 +817,16 @@ message ReadModifyWriteRowRequest { // "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. + // 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. - repeated ReadModifyWriteRule rules = 3 [(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. @@ -425,3 +834,406 @@ 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/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto index 2cc916454b..8320a0c22f 100644 --- a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/data.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 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. @@ -11,14 +11,18 @@ // WITHOUT 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 = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; +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"; @@ -86,6 +90,78 @@ message Cell { 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. @@ -210,7 +286,7 @@ message ValueRange { // RowFilter.Chain and RowFilter.Interleave documentation. // // The total serialized size of a RowFilter message must not -// exceed 4096 bytes, and RowFilters may not be nested within each other +// exceed 20480 bytes, and RowFilters may not be nested within each other // (in Chains or Interleaves) to a depth of more than 20. message RowFilter { // A RowFilter which sends rows through several RowFilters in sequence. @@ -464,6 +540,48 @@ message Mutation { 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 { @@ -487,15 +605,19 @@ message Mutation { } // A Mutation which deletes all cells from the containing row. - message DeleteFromRow { - - } + 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; @@ -534,3 +656,201 @@ message ReadModifyWriteRule { 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/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto new file mode 100644 index 0000000000..9bf078e6e8 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto @@ -0,0 +1,73 @@ +// 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; + +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; +} diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto new file mode 100644 index 0000000000..357af8216b --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/peer_info.proto @@ -0,0 +1,77 @@ +// 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; + +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 zone of the application frontend that served this request. + string application_frontend_zone = 3; + + // The subzone of the application frontend that served this request, e.g. an + // identifier for where within the zone the application frontend is. + string application_frontend_subzone = 4; + + TransportType transport_type = 5; +} diff --git a/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto new file mode 100644 index 0000000000..0049f8f73e --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto @@ -0,0 +1,112 @@ +// 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/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/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto new file mode 100644 index 0000000000..6eedfdf735 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto @@ -0,0 +1,38 @@ +// 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; + +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/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/types.proto b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/types.proto new file mode 100644 index 0000000000..607cf2bea9 --- /dev/null +++ b/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/renovate.json b/renovate.json index 9022e7bfc4..837f09eaa2 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], + "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ @@ -50,7 +51,10 @@ "^junit:junit", "^com.google.truth:truth", "^org.mockito:mockito-core", - "^org.objenesis:objenesis" + "^org.objenesis:objenesis", + "^com.google.cloud:google-cloud-conformance-tests", + "^io.grpc:protoc-gen-grpc-java", + "^com.google.protobuf:protoc" ], "semanticCommitType": "test", "semanticCommitScope": "deps" @@ -66,8 +70,46 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" + }, + { + "packagePatterns": [ + "^com.google.cloud:sdk-platform-java-config", + "^com.google.cloud:gapic-libraries-bom" + ], + "groupName": "shared dependencies" + } + ], + "regexManagers": [ + { + "fileMatch": ["^.*\/pom\\.xml$"], + "matchStrings": ["\\(?.*?)\\<\\/test\\-protoc\\-grpc\\.version\\>"], + "depNameTemplate": "io.grpc:protoc-gen-grpc-java", + "datasourceTemplate": "maven" + }, + { + "fileMatch": ["^.*\/pom\\.xml$"], + "matchStrings": ["\\(?.*?)\\<\\/test\\-protoc\\.version\\>"], + "depNameTemplate": "com.google.protobuf:protoc", + "datasourceTemplate": "maven" + }, + { + "fileMatch": [ + "^.kokoro/presubmit/graalvm-native.*.cfg$" + ], + "matchStrings": ["value: \"gcr.io/cloud-devrel-public-resources/graalvm.*:(?.*?)\""], + "depNameTemplate": "com.google.cloud:sdk-platform-java-config", + "datasourceTemplate": "maven" + }, + { + "customType": "regex", + "fileMatch": [ + "^.github/workflows/unmanaged_dependency_check.yaml$" + ], + "matchStrings": ["uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n"], + "depNameTemplate": "com.google.cloud:sdk-platform-java-config", + "datasourceTemplate": "maven" } ], "semanticCommits": true, - "masterIssue": true + "dependencyDashboard": true } diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 761e9c2336..3abc0a6617 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.2.2 @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigtable - 1.20.1 + 2.67.0 @@ -42,18 +42,23 @@ com.google.truth truth - 1.1.2 + 1.4.4 test + + + ../snippets/src/main/resources + + org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.6.0 add-snippets-source diff --git a/samples/pom.xml b/samples/pom.xml index 1e76b96358..624ab90266 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -18,7 +18,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.2.2 @@ -38,7 +38,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.1.4 true @@ -46,7 +46,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.7.0 true diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9337da9253..e4364ac53c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.2.2 @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 1.20.2-SNAPSHOT + 2.76.0 @@ -41,18 +41,23 @@ com.google.truth truth - 1.1.2 + 1.4.4 test + + + ../snippets/src/main/resources + + org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.6.0 add-snippets-source diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index ce0acdd3bc..41b35ec41d 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 com.google.cloud google-cloud-bigtable-snippets @@ -14,7 +16,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.2.2 @@ -23,14 +25,13 @@ UTF-8 - com.google.cloud libraries-bom - 18.0.0 + 26.69.0 pom import @@ -53,8 +54,22 @@ com.google.truth truth - 1.1.2 + 1.4.4 test + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.3.1 + + + **/SingerProto.java + + + + diff --git a/samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java b/samples/snippets/src/main/java/com/example/bigtable/AuthorizedViewExample.java new file mode 100644 index 0000000000..8f3047442b --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java b/samples/snippets/src/main/java/com/example/bigtable/ConfigureConnectionPool.java new file mode 100644 index 0000000000..f0c49875c4 --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/Filters.java b/samples/snippets/src/main/java/com/example/bigtable/Filters.java index cb6e6175d8..c8387c17a0 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/Filters.java +++ b/samples/snippets/src/main/java/com/example/bigtable/Filters.java @@ -26,11 +26,11 @@ 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. @@ -49,6 +49,7 @@ public static void filterLimitRowSample(String projectId, String instanceId, Str Filter filter = FILTERS.key().sample(.75); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_row_sample] // [START bigtable_filters_limit_row_regex] @@ -65,6 +66,7 @@ public static void filterLimitRowRegex(String projectId, String instanceId, Stri Filter filter = FILTERS.key().regex(".*#20190501$"); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_row_regex] // [START bigtable_filters_limit_cells_per_col] @@ -81,6 +83,7 @@ public static void filterLimitCellsPerCol(String projectId, String instanceId, S 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] @@ -97,6 +100,7 @@ public static void filterLimitCellsPerRow(String projectId, String instanceId, S 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] @@ -114,6 +118,7 @@ public static void filterLimitCellsPerRowOffset( 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] @@ -131,6 +136,7 @@ public static void filterLimitColFamilyRegex( 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] @@ -148,6 +154,7 @@ public static void filterLimitColQualifierRegex( Filter filter = FILTERS.qualifier().regex("connected_.*$"); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_col_qualifier_regex] // [START bigtable_filters_limit_col_range] @@ -170,6 +177,7 @@ public static void filterLimitColRange(String projectId, String instanceId, Stri .endOpen("data_plan_10gb"); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_col_range] // [START bigtable_filters_limit_value_range] @@ -186,6 +194,7 @@ public static void filterLimitValueRange(String projectId, String instanceId, St 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] @@ -202,6 +211,7 @@ public static void filterLimitValueRegex(String projectId, String instanceId, St Filter filter = FILTERS.value().regex("PQ2A.*$"); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_value_regex] // [START bigtable_filters_limit_timestamp_range] @@ -222,6 +232,7 @@ public static void filterLimitTimestampRange( 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] @@ -238,6 +249,7 @@ public static void filterLimitBlockAll(String projectId, String instanceId, Stri Filter filter = FILTERS.block(); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_block_all] // [START bigtable_filters_limit_pass_all] @@ -254,6 +266,7 @@ public static void filterLimitPassAll(String projectId, String instanceId, Strin Filter filter = FILTERS.pass(); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_limit_pass_all] // [START bigtable_filters_modify_strip_value] @@ -270,6 +283,7 @@ public static void filterModifyStripValue(String projectId, String instanceId, S Filter filter = FILTERS.value().strip(); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_modify_strip_value] // [START bigtable_filters_modify_apply_label] @@ -286,6 +300,7 @@ public static void filterModifyApplyLabel(String projectId, String instanceId, S Filter filter = FILTERS.label("labelled"); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_modify_apply_label] // [START bigtable_filters_composing_chain] @@ -306,6 +321,7 @@ public static void filterComposingChain(String projectId, String instanceId, Str .filter(FILTERS.family().exactMatch("cell_plan")); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_composing_chain] // [START bigtable_filters_composing_interleave] @@ -327,6 +343,7 @@ public static void filterComposingInterleave( .filter(FILTERS.qualifier().exactMatch("os_build")); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_composing_interleave] // [START bigtable_filters_composing_condition] @@ -352,6 +369,7 @@ public static void filterComposingCondition(String projectId, String instanceId, .otherwise(FILTERS.label("filtered-out")); readFilter(projectId, instanceId, tableId, filter); } + // [END bigtable_filters_composing_condition] // [END_EXCLUDE] @@ -361,18 +379,22 @@ private static void readFilter( // 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).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."); } catch (IOException e) { System.out.println( - "Unable to initialize service client, as a network error occurred: \n" + e.toString()); + "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()) { diff --git a/samples/snippets/src/main/java/com/m/examples/bigtable/HelloWorld.java b/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java similarity index 63% rename from samples/snippets/src/main/java/com/m/examples/bigtable/HelloWorld.java rename to samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java index 9668cdd80d..02a568f615 100644 --- a/samples/snippets/src/main/java/com/m/examples/bigtable/HelloWorld.java +++ b/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java @@ -14,25 +14,31 @@ * limitations under the License. */ -package com.m.examples.bigtable; +package com.example.bigtable; + +// [START bigtable_hw_imports] + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; -// [START bigtable_hw_imports_veneer] 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.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.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_veneer] +// [END bigtable_hw_imports] /** * An example of using Google Cloud Bigtable. @@ -53,6 +59,8 @@ public class HelloWorld { 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; @@ -71,9 +79,11 @@ public static void main(String[] args) throws Exception { } public HelloWorld(String projectId, String instanceId, String tableId) throws IOException { + this.projectId = projectId; + this.instanceId = instanceId; this.tableId = tableId; - // [START bigtable_hw_connect_veneer] + // [START bigtable_hw_connect] // Creates the settings to configure a bigtable data client. BigtableDataSettings settings = BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); @@ -90,7 +100,7 @@ public HelloWorld(String projectId, String instanceId, String tableId) throws IO // Creates a bigtable table admin client. adminClient = BigtableTableAdminClient.create(adminSettings); - // [END bigtable_hw_connect_veneer] + // [END bigtable_hw_connect] } public void run() throws Exception { @@ -99,6 +109,7 @@ public void run() throws Exception { readSingleRow(); readSpecificCells(); readTable(); + filterLimitCellsPerCol(tableId); deleteTable(); close(); } @@ -110,28 +121,38 @@ public void close() { /** Demonstrates how to create a table. */ public void createTable() { - // [START bigtable_hw_create_table_veneer] + // [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); - CreateTableRequest createTableRequest = - CreateTableRequest.of(tableId).addFamily(COLUMN_FAMILY); - adminClient.createTable(createTableRequest); + 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_veneer] + // [END bigtable_hw_create_table] } /** Demonstrates how to write some rows to a table. */ public void writeToTable() { - // [START bigtable_hw_write_rows_veneer] + // [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, ROW_KEY_PREFIX + i) + 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); @@ -140,15 +161,15 @@ public void writeToTable() { } catch (NotFoundException e) { System.err.println("Failed to write to non-existent table: " + e.getMessage()); } - // [END bigtable_hw_write_rows_veneer] + // [END bigtable_hw_write_rows] } /** Demonstrates how to read a single row from a table. */ public Row readSingleRow() { - // [START bigtable_hw_get_by_key_veneer] + // [START bigtable_hw_get_by_key] try { System.out.println("\nReading a single row by row key"); - Row row = dataClient.readRow(tableId, ROW_KEY_PREFIX + 0); + 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( @@ -160,15 +181,15 @@ public Row readSingleRow() { System.err.println("Failed to read from a non-existent table: " + e.getMessage()); return null; } - // [END bigtable_hw_get_by_key_veneer] + // [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_veneer] + // [START bigtable_hw_get_by_key] try { System.out.println("\nReading specific cells by family and qualifier"); - Row row = dataClient.readRow(tableId, ROW_KEY_PREFIX + 0); + 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) { @@ -181,15 +202,15 @@ public List readSpecificCells() { System.err.println("Failed to read from a non-existent table: " + e.getMessage()); return null; } - // [END bigtable_hw_get_by_key_veneer] + // [END bigtable_hw_get_by_key] } /** Demonstrates how to read an entire table. */ public List readTable() { - // [START bigtable_hw_scan_all_veneer] + // [START bigtable_hw_scan_all] try { System.out.println("\nReading the entire table"); - Query query = Query.create(tableId); + Query query = Query.create(TableId.of(tableId)); ServerStream rowStream = dataClient.readRows(query); List tableRows = new ArrayList<>(); for (Row r : rowStream) { @@ -206,19 +227,79 @@ public List readTable() { System.err.println("Failed to read a non-existent table: " + e.getMessage()); return null; } - // [END bigtable_hw_scan_all_veneer] + // [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_veneer] + // [START bigtable_hw_delete_table] System.out.println("\nDeleting table: " + tableId); try { - adminClient.deleteTable(tableId); + 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_veneer] + // [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/samples/snippets/src/main/java/com/m/examples/bigtable/InstanceAdminExample.java b/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java similarity index 60% rename from samples/snippets/src/main/java/com/m/examples/bigtable/InstanceAdminExample.java rename to samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java index 3b317d594c..07ae1fe007 100644 --- a/samples/snippets/src/main/java/com/m/examples/bigtable/InstanceAdminExample.java +++ b/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java @@ -12,22 +12,26 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ -package com.m.examples.bigtable; +package com.example.bigtable; -import com.google.api.gax.rpc.AlreadyExistsException; 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 com.google.cloud.bigtable.admin.v2.models.Cluster; -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.PartialListInstancesException; -import com.google.cloud.bigtable.admin.v2.models.StorageType; import java.io.IOException; -import java.util.List; import java.util.Map; /** @@ -49,6 +53,7 @@ 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; @@ -68,6 +73,7 @@ public static void main(String[] args) throws IOException { public InstanceAdminExample(String projectId, String instanceId, String clusterId) throws IOException { + this.projectId = projectId; this.instanceId = instanceId; this.clusterId = clusterId; @@ -87,6 +93,11 @@ public void run() { addCluster(); deleteCluster(); deleteInstance(); + close(); + } + + // Close the client + void close() { adminClient.close(); } @@ -98,18 +109,33 @@ public void createProdInstance() { // [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". - CreateInstanceRequest createInstanceRequest = - CreateInstanceRequest.of(instanceId) - .addCluster(clusterId, "us-central1-f", 3, StorageType.SSD) + String parent = "projects/" + projectId; + Instance instanceObj = + Instance.newBuilder() + .setDisplayName(instanceId) .setType(Instance.Type.PRODUCTION) - .addLabel("department", "accounting"); + .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.createInstance(createInstanceRequest); - System.out.printf("PRODUCTION type instance %s created successfully%n", instance.getId()); + 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 e; + throw new RuntimeException(e); } // [END bigtable_create_prod_instance] } @@ -120,14 +146,14 @@ public void listInstances() { System.out.println("\nListing Instances"); // [START bigtable_list_instances] try { - List instances = adminClient.listInstances(); - for (Instance instance : instances) { - System.out.println(instance.getId()); + 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 (PartialListInstancesException e) { + } catch (Exception e) { System.err.println("Failed to list instances: " + e.getMessage()); - System.err.println("The following zones are unavailable: " + e.getUnavailableZones()); - System.err.println("But the following instances are reachable: " + e.getInstances()); } // [END bigtable_list_instances] } @@ -138,11 +164,13 @@ public Instance getInstance() { // [START bigtable_get_instance] Instance instance = null; try { - instance = adminClient.getInstance(instanceId); - System.out.println("Instance ID: " + instance.getId()); + 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.getLabels(); + Map labels = instance.getLabelsMap(); for (String key : labels.keySet()) { System.out.printf("%s - %s", key, labels.get(key)); } @@ -160,9 +188,11 @@ public void listClusters() { System.out.println("\nListing Clusters"); // [START bigtable_get_clusters] try { - List clusters = adminClient.listClusters(instanceId); - for (Cluster cluster : clusters) { - System.out.println(cluster.getId()); + 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()); @@ -175,7 +205,9 @@ public void deleteInstance() { System.out.println("\nDeleting Instance"); // [START bigtable_delete_instance] try { - adminClient.deleteInstance(instanceId); + 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()); @@ -188,14 +220,23 @@ public void addCluster() { System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId); // [START bigtable_create_cluster] try { - adminClient.createCluster( - CreateClusterRequest.of(instanceId, CLUSTER) - .setZone("us-central1-c") + String parent = "projects/" + projectId + "/instances/" + instanceId; + Cluster clusterObj = + Cluster.newBuilder() + .setLocation("projects/" + projectId + "/locations/us-central1-c") .setServeNodes(3) - .setStorageType(StorageType.SSD)); + .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 (AlreadyExistsException e) { - System.err.println("Failed to add cluster, already exists: " + e.getMessage()); + } catch (Exception e) { + System.err.println("Failed to add cluster: " + e.getMessage()); } // [END bigtable_create_cluster] } @@ -205,7 +246,9 @@ public void deleteCluster() { System.out.printf("%nDeleting cluster: %s from instance: %s%n", CLUSTER, instanceId); // [START bigtable_delete_cluster] try { - adminClient.deleteCluster(instanceId, CLUSTER); + 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()); diff --git a/samples/snippets/src/main/java/com/example/bigtable/KeySalting.java b/samples/snippets/src/main/java/com/example/bigtable/KeySalting.java new file mode 100644 index 0000000000..436ab139a4 --- /dev/null +++ b/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/samples/snippets/src/main/java/com/m/examples/bigtable/Quickstart.java b/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java similarity index 87% rename from samples/snippets/src/main/java/com/m/examples/bigtable/Quickstart.java rename to samples/snippets/src/main/java/com/example/bigtable/Quickstart.java index 6bdfa70135..4c0a415c6d 100644 --- a/samples/snippets/src/main/java/com/m/examples/bigtable/Quickstart.java +++ b/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java @@ -14,22 +14,23 @@ * limitations under the License. */ -package com.m.examples.bigtable; +package com.example.bigtable; -// [START bigtable_quickstart_veneer] +// [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 projectId = args[0]; // my-gcp-project-id String instanceId = args[1]; // my-bigtable-instance-id - String tableId = args[2]; // my-bigtable-table-id + String tableId = args[2]; // my-bigtable-table-id quickstart(projectId, instanceId, tableId); } @@ -43,7 +44,7 @@ public static void quickstart(String projectId, String instanceId, String tableI // 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, "r1"); + Row row = dataClient.readRow(TableId.of(tableId), "r1"); System.out.println("Row: " + row.getKey().toStringUtf8()); for (RowCell cell : row.getCells()) { System.out.printf( @@ -57,4 +58,4 @@ public static void quickstart(String projectId, String instanceId, String tableI } } } -// [END bigtable_quickstart_veneer] +// [END bigtable_quickstart] diff --git a/samples/snippets/src/main/java/com/example/bigtable/Reads.java b/samples/snippets/src/main/java/com/example/bigtable/Reads.java index 989da4f62f..d1cca037f0 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/Reads.java +++ b/samples/snippets/src/main/java/com/example/bigtable/Reads.java @@ -26,8 +26,7 @@ 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 com.google.cloud.bigtable.data.v2.models.TableId; import java.io.IOException; public class Reads { @@ -50,7 +49,7 @@ public static void readRow(String projectId, String instanceId, String tableId) try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { String rowkey = "phone#4c410523#20190501"; - Row row = dataClient.readRow(tableId, rowkey); + Row row = dataClient.readRow(TableId.of(tableId), rowkey); printRow(row); } catch (IOException e) { @@ -58,6 +57,7 @@ public static void readRow(String projectId, String instanceId, String tableId) "Unable to initialize service client, as a network error occurred: \n" + e.toString()); } } + // [END bigtable_reads_row] // [START bigtable_reads_row_partial] @@ -81,7 +81,7 @@ public static void readRowPartial(String projectId, String instanceId, String ta .filter(FILTERS.family().exactMatch("stats_summary")) .filter(FILTERS.qualifier().exactMatch("os_build")); - Row row = dataClient.readRow(tableId, rowkey, filter); + Row row = dataClient.readRow(TableId.of(tableId), rowkey, filter); printRow(row); } catch (IOException e) { @@ -89,6 +89,7 @@ public static void readRowPartial(String projectId, String instanceId, String ta "Unable to initialize service client, as a network error occurred: \n" + e.toString()); } } + // [END bigtable_reads_row_partial] // [START bigtable_reads_rows] @@ -106,7 +107,9 @@ public static void readRows(String projectId, String instanceId, String tableId) // 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).rowKey("phone#4c410523#20190501").rowKey("phone#4c410523#20190502"); + Query.create(TableId.of(tableId)) + .rowKey("phone#4c410523#20190501") + .rowKey("phone#4c410523#20190502"); ServerStream rows = dataClient.readRows(query); for (Row row : rows) { printRow(row); @@ -116,6 +119,7 @@ public static void readRows(String projectId, String instanceId, String tableId) "Unable to initialize service client, as a network error occurred: \n" + e.toString()); } } + // [END bigtable_reads_rows] // [START bigtable_reads_row_range] @@ -135,7 +139,7 @@ public static void readRowRange(String projectId, String instanceId, String tabl // 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).range(start, end); + Query query = Query.create(TableId.of(tableId)).range(start, end); ServerStream rows = dataClient.readRows(query); for (Row row : rows) { printRow(row); @@ -145,6 +149,7 @@ public static void readRowRange(String projectId, String instanceId, String tabl "Unable to initialize service client, as a network error occurred: \n" + e.toString()); } } + // [END bigtable_reads_row_range] // [START bigtable_reads_row_ranges] @@ -162,7 +167,7 @@ public static void readRowRanges(String projectId, String instanceId, String tab // 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) + Query.create(TableId.of(tableId)) .range("phone#4c410523#20190501", "phone#4c410523#20190601") .range("phone#5c10102#20190501", "phone#5c10102#20190601"); ServerStream rows = dataClient.readRows(query); @@ -174,6 +179,7 @@ public static void readRowRanges(String projectId, String instanceId, String tab "Unable to initialize service client, as a network error occurred: \n" + e.toString()); } } + // [END bigtable_reads_row_ranges] // [START bigtable_reads_prefix] @@ -190,7 +196,7 @@ public static void readPrefix(String projectId, String instanceId, String tableI // 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).prefix("phone"); + Query query = Query.create(TableId.of(tableId)).prefix("phone"); ServerStream rows = dataClient.readRows(query); for (Row row : rows) { printRow(row); @@ -200,8 +206,41 @@ public static void readPrefix(String projectId, String instanceId, String tableI "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. @@ -218,7 +257,7 @@ public static void readFilter(String projectId, String instanceId, String tableI // 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).filter(filter); + Query query = Query.create(TableId.of(tableId)).filter(filter); ServerStream rows = dataClient.readRows(query); for (Row row : rows) { printRow(row); @@ -228,6 +267,7 @@ public static void readFilter(String projectId, String instanceId, String tableI "Unable to initialize service client, as a network error occurred: \n" + e.toString()); } } + // [END bigtable_reads_filter] // [END_EXCLUDE] diff --git a/samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java b/samples/snippets/src/main/java/com/example/bigtable/SchemaBundleExample.java new file mode 100644 index 0000000000..7ac0af3fcb --- /dev/null +++ b/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/samples/snippets/src/main/java/com/m/examples/bigtable/TableAdminExample.java b/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java similarity index 59% rename from samples/snippets/src/main/java/com/m/examples/bigtable/TableAdminExample.java rename to samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java index 56c47e19a3..009fef3910 100644 --- a/samples/snippets/src/main/java/com/m/examples/bigtable/TableAdminExample.java +++ b/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java @@ -12,28 +12,23 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ - -package com.m.examples.bigtable; + */ -import static com.google.cloud.bigtable.admin.v2.models.GCRules.GCRULES; +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.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.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.GcRuleBuilder; import java.io.IOException; -import java.util.Collection; -import java.util.List; -import java.util.concurrent.TimeUnit; +import java.time.Duration; /** * An example of using Google Cloud Bigtable. @@ -64,6 +59,8 @@ public class TableAdminExample { 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; @@ -81,6 +78,8 @@ public static void main(String[] args) throws IOException { } 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. @@ -108,6 +107,11 @@ public void run() { printModifiedColumnFamily(); deleteColumnFamily(); deleteTable(); + close(); + } + + // Close the client + void close() { adminClient.close(); } @@ -117,9 +121,18 @@ public void createTable() { // Checks if table exists, creates table if does not exist. if (!adminClient.exists(tableId)) { System.out.println("Table does not exist, creating table: " + tableId); - CreateTableRequest createTableRequest = CreateTableRequest.of(tableId).addFamily("cf"); - Table table = adminClient.createTable(createTableRequest); - System.out.printf("Table: %s created successfully%n", table.getId()); + 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] } @@ -130,9 +143,10 @@ public void listAllTables() { // [START bigtable_list_tables] // Lists tables in the current instance. try { - List tableIds = adminClient.listTables(); - for (String tableId : tableIds) { - System.out.println(tableId); + 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()); @@ -146,13 +160,14 @@ public void getTableMeta() { // [START bigtable_get_table_metadata] // Gets table metadata, and applies a view to the table fields. try { - Table table = adminClient.getTable(tableId); - System.out.println("Table: " + table.getId()); - Collection columnFamilies = table.getColumnFamilies(); - for (ColumnFamily columnFamily : columnFamilies) { + 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", - columnFamily.getId(), columnFamily.getGCRule().toString()); + "Column family: %s%nGC Rule: %s%n", entry.getKey(), entry.getValue().getGcRule()); } } catch (NotFoundException e) { System.err.println( @@ -169,15 +184,21 @@ public void addFamilyWithMaxAgeRule() { // where age = current time minus cell timestamp // Defines the GC rule to retain data with max age of 5 days. - DurationRule maxAgeRule = GCRULES.maxAge(5, TimeUnit.DAYS); + GcRule maxAgeRule = GcRuleBuilder.maxAge(Duration.ofDays(5)); // Creates column family with given GC rule. try { - // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is - // being used to add a family - ModifyColumnFamiliesRequest columnFamiliesRequest = - ModifyColumnFamiliesRequest.of(tableId).addFamily(COLUMN_FAMILY_1, maxAgeRule); - adminClient.modifyFamilies(columnFamiliesRequest); + 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( @@ -194,15 +215,21 @@ public void addFamilyWithMaxVersionsRule() { // where 1 = most recent version // Defines the GC policy to retain only the most recent 2 versions. - VersionRule versionRule = GCRULES.maxVersions(2); + GcRule versionRule = GcRuleBuilder.maxVersions(2); // Creates column family with given GC rule. try { - // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is - // being used to add a family - ModifyColumnFamiliesRequest columnFamiliesRequest = - ModifyColumnFamiliesRequest.of(tableId).addFamily(COLUMN_FAMILY_2, versionRule); - adminClient.modifyFamilies(columnFamiliesRequest); + 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( @@ -219,16 +246,25 @@ public void addFamilyWithUnionRule() { // Defines a list of GC rules to drop cells older than 5 days OR not the most recent // version. - UnionRule unionRule = - GCRULES.union().rule(GCRULES.maxAge(5, TimeUnit.DAYS)).rule(GCRULES.maxVersions(1)); + GcRule unionRule = + GcRuleBuilder.union() + .add(GcRuleBuilder.maxAge(Duration.ofDays(5))) + .add(GcRuleBuilder.maxVersions(1)) + .build(); // Creates column family with given GC rule. try { - // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is - // being used to add a family - ModifyColumnFamiliesRequest columnFamiliesRequest = - ModifyColumnFamiliesRequest.of(tableId).addFamily(COLUMN_FAMILY_3, unionRule); - adminClient.modifyFamilies(columnFamiliesRequest); + 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( @@ -244,17 +280,25 @@ public void addFamilyWithIntersectionRule() { // 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. - DurationRule maxAgeRule = GCRULES.maxAge(5, TimeUnit.DAYS); - VersionRule versionRule = GCRULES.maxVersions(2); - IntersectionRule intersectionRule = GCRULES.intersection().rule(maxAgeRule).rule(versionRule); + GcRule intersectionRule = + GcRuleBuilder.intersection() + .add(GcRuleBuilder.maxAge(Duration.ofDays(5))) + .add(GcRuleBuilder.maxVersions(2)) + .build(); // Creates column family with given GC rule. try { - // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is - // being used to add a family - ModifyColumnFamiliesRequest columnFamiliesRequest = - ModifyColumnFamiliesRequest.of(tableId).addFamily(COLUMN_FAMILY_4, intersectionRule); - adminClient.modifyFamilies(columnFamiliesRequest); + 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( @@ -271,19 +315,27 @@ public void addFamilyWithNestedRule() { // 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 - VersionRule versionRule1 = GCRULES.maxVersions(10); - VersionRule versionRule2 = GCRULES.maxVersions(2); - DurationRule maxAgeRule = GCRULES.maxAge(30, TimeUnit.DAYS); - IntersectionRule intersectionRule = GCRULES.intersection().rule(maxAgeRule).rule(versionRule2); - UnionRule unionRule = GCRULES.union().rule(intersectionRule).rule(versionRule1); + 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 { - // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is - // being used to add a family - ModifyColumnFamiliesRequest columnFamiliesRequest = - ModifyColumnFamiliesRequest.of(tableId).addFamily(COLUMN_FAMILY_5, unionRule); - adminClient.modifyFamilies(columnFamiliesRequest); + 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( @@ -298,12 +350,13 @@ public void listColumnFamilies() { // [START bigtable_list_column_families] // Lists all families in the table with GC rules. try { - Table table = adminClient.getTable(tableId); - Collection columnFamilies = table.getColumnFamilies(); - for (ColumnFamily columnFamily : columnFamilies) { + 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", - columnFamily.getId(), columnFamily.getGCRule().toString()); + "Column family: %s%nGC Rule: %s%n", entry.getKey(), entry.getValue().getGcRule()); } } catch (NotFoundException e) { System.err.println( @@ -318,14 +371,19 @@ public void modifyColumnFamilyRule() { // [START bigtable_update_gc_rule] // Updates the column family metadata to update the GC rule. // Updates a column family GC rule. - VersionRule versionRule = GCRULES.maxVersions(1); + GcRule versionRule = GcRuleBuilder.maxVersions(1); try { - // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is - // being used to modify a family - // Updates column family with given GC rule. - ModifyColumnFamiliesRequest updateRequest = - ModifyColumnFamiliesRequest.of(tableId).updateFamily(COLUMN_FAMILY_1, versionRule); - adminClient.modifyFamilies(updateRequest); + 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()); @@ -338,14 +396,13 @@ 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 { - Table table = adminClient.getTable(tableId); - Collection columnFamilies = table.getColumnFamilies(); - for (ColumnFamily columnFamily : columnFamilies) { - if (columnFamily.getId().equals(COLUMN_FAMILY_1)) { - System.out.printf( - "Column family: %s%nGC Rule: %s%n", - columnFamily.getId(), columnFamily.getGCRule().toString()); - } + 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()); @@ -359,9 +416,17 @@ public void deleteColumnFamily() { // [START bigtable_delete_family] // Deletes a column family. try { - ModifyColumnFamiliesRequest deleted = - ModifyColumnFamiliesRequest.of(tableId).dropFamily(COLUMN_FAMILY_2); - adminClient.modifyFamilies(deleted); + 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()); @@ -375,7 +440,9 @@ public void deleteTable() { // Deletes the entire table. System.out.println("\nDelete table: " + tableId); try { - adminClient.deleteTable(tableId); + 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()); diff --git a/samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java b/samples/snippets/src/main/java/com/example/bigtable/WriteAggregate.java new file mode 100644 index 0000000000..b3e0b20052 --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java b/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java index 180793a10b..24e1000a2b 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java +++ b/samples/snippets/src/main/java/com/example/bigtable/WriteBatch.java @@ -18,10 +18,16 @@ // [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.BulkMutation; -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.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"; @@ -32,34 +38,44 @@ public static void writeBatch(String projectId, String instanceId, String tableI // String tableId = "mobile-time-series"; try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { - long timestamp = System.currentTimeMillis() * 1000; + 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"))); - BulkMutation bulkMutation = - BulkMutation.create(tableId) - .add( - "tablet#a0b81f74#20190501", - Mutation.create() - .setCell( - COLUMN_FAMILY_NAME, - ByteString.copyFrom("connected_wifi".getBytes()), - timestamp, - 1) - .setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "12155.0.0-rc1")) - .add( - "tablet#a0b81f74#20190502", - Mutation.create() - .setCell( - COLUMN_FAMILY_NAME, - ByteString.copyFrom("connected_wifi".getBytes()), - timestamp, - 1) - .setCell(COLUMN_FAMILY_NAME, "os_build", timestamp, "12155.0.0-rc6")); - - dataClient.bulkMutateRows(bulkMutation); - - System.out.print("Successfully wrote 2 rows"); + // 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.toString()); + System.out.println("Error during WriteBatch: \n" + e); } } } diff --git a/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java b/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java index ac01cb0c63..82d5fbfaba 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java +++ b/samples/snippets/src/main/java/com/example/bigtable/WriteConditionally.java @@ -24,6 +24,7 @@ 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"; @@ -49,7 +50,9 @@ public static void writeConditionally(String projectId, String instanceId, Strin .filter(FILTERS.value().regex("PQ2A\\..*")); ConditionalRowMutation conditionalRowMutation = - ConditionalRowMutation.create(tableId, rowkey).condition(filter).then(mutation); + ConditionalRowMutation.create(TableId.of(tableId), rowkey) + .condition(filter) + .then(mutation); boolean success = dataClient.checkAndMutateRow(conditionalRowMutation); diff --git a/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java b/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java index 0f91a13717..4f832d5a98 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java +++ b/samples/snippets/src/main/java/com/example/bigtable/WriteIncrement.java @@ -21,6 +21,7 @@ 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 { @@ -36,7 +37,7 @@ public static void writeIncrement(String projectId, String instanceId, String ta // if it is encoded as a 64-bit big-endian signed integer. String rowkey = "phone#4c410523#20190501"; ReadModifyWriteRow mutation = - ReadModifyWriteRow.create(tableId, rowkey) + ReadModifyWriteRow.create(TableId.of(tableId), rowkey) .increment(COLUMN_FAMILY_NAME, "connected_cell", -1); Row success = dataClient.readModifyWriteRow(mutation); diff --git a/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java b/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java index 5d7f4d5b2a..f176703432 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java +++ b/samples/snippets/src/main/java/com/example/bigtable/WriteSimple.java @@ -20,6 +20,7 @@ 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 { @@ -36,7 +37,7 @@ public static void writeSimple(String projectId, String instanceId, String table String rowkey = "phone#4c410523#20190501"; RowMutation rowMutation = - RowMutation.create(tableId, rowkey) + RowMutation.create(TableId.of(tableId), rowkey) .setCell( COLUMN_FAMILY_NAME, ByteString.copyFrom("connected_cell".getBytes()), diff --git a/samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/BatchDeleteExample.java new file mode 100644 index 0000000000..590a618f0b --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/ConditionalDeleteExample.java new file mode 100644 index 0000000000..1da173321f --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteColumnFamilyExample.java new file mode 100644 index 0000000000..e3648fb0a1 --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnExample.java new file mode 100644 index 0000000000..0c68168902 --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromColumnFamilyExample.java new file mode 100644 index 0000000000..64016a6ef0 --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteFromRowExample.java new file mode 100644 index 0000000000..f1d283722f --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/DeleteTableExample.java new file mode 100644 index 0000000000..bdded5fbef --- /dev/null +++ b/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/samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java b/samples/snippets/src/main/java/com/example/bigtable/deletes/DropRowRangeExample.java new file mode 100644 index 0000000000..0575fb38ec --- /dev/null +++ b/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/samples/snippets/src/main/resources/com/example/bigtable/README.md b/samples/snippets/src/main/resources/com/example/bigtable/README.md new file mode 100644 index 0000000000..da219f2e66 --- /dev/null +++ b/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/samples/snippets/src/main/resources/com/example/bigtable/SingerProto.java b/samples/snippets/src/main/resources/com/example/bigtable/SingerProto.java new file mode 100644 index 0000000000..8f1ed90d12 --- /dev/null +++ b/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/samples/snippets/src/main/resources/com/example/bigtable/descriptors.pb b/samples/snippets/src/main/resources/com/example/bigtable/descriptors.pb new file mode 100644 index 0000000000..c8726c6084 Binary files /dev/null and b/samples/snippets/src/main/resources/com/example/bigtable/descriptors.pb differ diff --git a/samples/snippets/src/main/resources/com/example/bigtable/singer.proto b/samples/snippets/src/main/resources/com/example/bigtable/singer.proto new file mode 100644 index 0000000000..8d697fdfd9 --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/AuthorizedViewExampleTest.java b/samples/snippets/src/test/java/com/example/bigtable/AuthorizedViewExampleTest.java new file mode 100644 index 0000000000..5990d66107 --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java b/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java new file mode 100644 index 0000000000..5a4475e898 --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/ConfigureConnectionPoolTest.java b/samples/snippets/src/test/java/com/example/bigtable/ConfigureConnectionPoolTest.java new file mode 100644 index 0000000000..5af6121a92 --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java b/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java index 429b5712c4..f476fb1b23 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java @@ -17,170 +17,25 @@ package com.example.bigtable; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; - -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.BulkMutation; -import com.google.cloud.bigtable.data.v2.models.Mutation; -import com.google.protobuf.ByteString; -import java.io.ByteArrayOutputStream; + import java.io.IOException; -import java.io.PrintStream; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.UUID; -import java.util.logging.Filter; import org.junit.AfterClass; -import org.junit.Before; import org.junit.BeforeClass; -import org.junit.FixMethodOrder; import org.junit.Test; -import org.junit.runners.MethodSorters; - -public class FiltersTest { - - private static final String INSTANCE_ENV = "BIGTABLE_TESTING_INSTANCE"; - private static final String TABLE_ID = - "mobile-time-series-" + UUID.randomUUID().toString().substring(0, 20); - private static final String COLUMN_FAMILY_NAME_STATS = "stats_summary"; - private static final String COLUMN_FAMILY_NAME_DATA = "cell_plan"; - private static final Instant CURRENT_TIME = Instant.now(); - private static final long TIMESTAMP = CURRENT_TIME.toEpochMilli() * 1000; - private static final long TIMESTAMP_MINUS_HR = - CURRENT_TIME.minus(1, ChronoUnit.HOURS).toEpochMilli() * 1000; - - private static String projectId; - private static String instanceId; - private 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; - } + +public class FiltersTest extends MobileTimeSeriesBaseTest { @BeforeClass public static void beforeClass() throws IOException { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); - instanceId = requireEnv(INSTANCE_ENV); - - try (BigtableTableAdminClient adminClient = - BigtableTableAdminClient.create(projectId, instanceId)) { - CreateTableRequest createTableRequest = - CreateTableRequest.of(TABLE_ID) - .addFamily(COLUMN_FAMILY_NAME_STATS) - .addFamily(COLUMN_FAMILY_NAME_DATA); - adminClient.createTable(createTableRequest); - - try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { - BulkMutation bulkMutation = - BulkMutation.create(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") - .setCell( - COLUMN_FAMILY_NAME_DATA, "data_plan_01gb", TIMESTAMP_MINUS_HR, "true") - .setCell(COLUMN_FAMILY_NAME_DATA, "data_plan_01gb", TIMESTAMP, "false") - .setCell(COLUMN_FAMILY_NAME_DATA, "data_plan_05gb", TIMESTAMP, "true")) - .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") - .setCell(COLUMN_FAMILY_NAME_DATA, "data_plan_05gb", TIMESTAMP, "true")) - .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") - .setCell(COLUMN_FAMILY_NAME_DATA, "data_plan_05gb", TIMESTAMP, "true")) - .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") - .setCell(COLUMN_FAMILY_NAME_DATA, "data_plan_10gb", TIMESTAMP, "true")) - .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") - .setCell(COLUMN_FAMILY_NAME_DATA, "data_plan_10gb", TIMESTAMP, "true")); - - dataClient.bulkMutateRows(bulkMutation); - } - } catch (Exception e) { - System.out.println("Error during beforeClass: \n" + e.toString()); - throw (e); - } - } - - @Before - public void setupStream() { - bout = new ByteArrayOutputStream(); - System.setOut(new PrintStream(bout)); + initializeVariables(); + createTable(); + writeStatsData(); + writePlanData(); } @AfterClass public static void afterClass() throws IOException { - try (BigtableTableAdminClient adminClient = - BigtableTableAdminClient.create(projectId, instanceId)) { - adminClient.deleteTable(TABLE_ID); - } catch (Exception e) { - System.out.println("Error during afterClass: \n" + e.toString()); - throw (e); - } + cleanupTable(); } @Test @@ -188,7 +43,7 @@ public void testFilterRowSample() { Filters.filterLimitRowSample(projectId, instanceId, TABLE_ID); String output = bout.toString(); - assertThat(output).contains("Reading data for"); + assertThat(output).contains("Table filter completed."); } @Test diff --git a/samples/snippets/src/test/java/com/m/examples/bigtable/HelloWorldTest.java b/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java similarity index 87% rename from samples/snippets/src/test/java/com/m/examples/bigtable/HelloWorldTest.java rename to samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java index 6904161829..ead4d6c3fd 100644 --- a/samples/snippets/src/test/java/com/m/examples/bigtable/HelloWorldTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.m.examples.bigtable; +package com.example.bigtable; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -26,6 +26,7 @@ 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; @@ -38,28 +39,17 @@ import org.junit.Test; /** Integration tests for {@link HelloWorld} */ -public class HelloWorldTest { +public class HelloWorldTest extends BigtableBaseTest { - private static final String INSTANCE_ENV = "BIGTABLE_TESTING_INSTANCE"; private static final String TABLE_PREFIX = "table"; private static String tableId; private static BigtableDataClient dataClient; private static BigtableTableAdminClient adminClient; - private static String projectId; - private static String instanceId; private HelloWorld helloWorld; - private static String requireEnv(String varName) { - assertNotNull( - System.getenv(varName), - "Environment variable '%s' is required to perform these tests.".format(varName)); - return System.getenv(varName); - } - @BeforeClass public static void beforeClass() throws IOException { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); - instanceId = requireEnv(INSTANCE_ENV); + initializeVariables(); BigtableDataSettings settings = BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId).build(); dataClient = BigtableDataClient.create(settings); @@ -110,9 +100,9 @@ public void testCreateAndDeleteTable() throws IOException { @Test public void testWriteToTable() { // Writes to a table. - assertNull(dataClient.readRow(tableId, "rowKey0")); + assertNull(dataClient.readRow(TableId.of(tableId), "rowKey0")); helloWorld.writeToTable(); - assertNotNull(dataClient.readRow(tableId, "rowKey0")); + assertNotNull(dataClient.readRow(TableId.of(tableId), "rowKey0")); } @Test diff --git a/samples/snippets/src/test/java/com/m/examples/bigtable/InstanceAdminExampleTest.java b/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java similarity index 84% rename from samples/snippets/src/test/java/com/m/examples/bigtable/InstanceAdminExampleTest.java rename to samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java index cf12dfffbe..acab4fca74 100644 --- a/samples/snippets/src/test/java/com/m/examples/bigtable/InstanceAdminExampleTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java @@ -12,9 +12,9 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ -package com.m.examples.bigtable; +package com.example.bigtable; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -23,9 +23,7 @@ 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.Cluster; 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.Instance.Type; import com.google.cloud.bigtable.admin.v2.models.StorageType; import java.io.IOException; @@ -34,32 +32,22 @@ import java.util.regex.Pattern; import org.junit.After; import org.junit.AfterClass; -import org.junit.AssumptionViolatedException; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** Integration tests for {@link InstanceAdminExample} */ -public class InstanceAdminExampleTest { +public class InstanceAdminExampleTest extends BigtableBaseTest { private static final String ID_PREFIX = "instanceadmin"; private static final String CLUSTER = "cluster"; - private static String projectId; private static BigtableInstanceAdminClient adminClient; private String clusterId; - private String instanceId; private InstanceAdminExample instanceAdmin; - private static String requireEnv(String varName) { - assertNotNull( - System.getenv(varName), - "Environment variable '%s' is required to perform these tests.".format(varName)); - return System.getenv(varName); - } - @BeforeClass public static void beforeClass() throws IOException { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); + initializeVariables(); BigtableInstanceAdminSettings instanceAdminSettings = BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId).build(); adminClient = BigtableInstanceAdminClient.create(instanceAdminSettings); @@ -88,6 +76,9 @@ public void after() { if (adminClient.exists(instanceId)) { adminClient.deleteInstance(instanceId); } + if (instanceAdmin != null) { + instanceAdmin.close(); + } } @Test @@ -108,7 +99,7 @@ public void testCreateAndDeleteInstance() throws IOException { @Test public void testGetInstance() { // Gets an instance. - Instance instance = instanceAdmin.getInstance(); + com.google.bigtable.admin.v2.Instance instance = instanceAdmin.getInstance(); assertNotNull(instance); } @@ -116,7 +107,8 @@ public void testGetInstance() { public void testAddAndDeleteCluster() { // Adds a cluster. instanceAdmin.addCluster(); - Cluster cluster = adminClient.getCluster(instanceId, CLUSTER); + com.google.cloud.bigtable.admin.v2.models.Cluster cluster = + adminClient.getCluster(instanceId, CLUSTER); assertNotNull(cluster); // Deletes a cluster. @@ -139,7 +131,8 @@ private static String generateId() { private static void garbageCollect() { Pattern timestampPattern = Pattern.compile(ID_PREFIX + "-([0-9a-f]+)"); System.out.println(); - for (Instance instance : adminClient.listInstances()) { + for (com.google.cloud.bigtable.admin.v2.models.Instance instance : + adminClient.listInstances()) { Matcher matcher = timestampPattern.matcher(instance.getId()); if (!matcher.matches()) { continue; diff --git a/samples/snippets/src/test/java/com/example/bigtable/KeySaltingTest.java b/samples/snippets/src/test/java/com/example/bigtable/KeySaltingTest.java new file mode 100644 index 0000000000..085d992cea --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java b/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java new file mode 100644 index 0000000000..f1a9ae5c01 --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java b/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java new file mode 100644 index 0000000000..b8271de50e --- /dev/null +++ b/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/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java b/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java index 7b526c87ea..a895594979 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java @@ -17,155 +17,24 @@ package com.example.bigtable; import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertNotNull; -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.Mutation; -import com.google.protobuf.ByteString; -import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.io.PrintStream; -import java.util.UUID; import org.junit.AfterClass; -import org.junit.Before; import org.junit.BeforeClass; -import org.junit.FixMethodOrder; import org.junit.Test; -import org.junit.runners.MethodSorters; -@FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class ReadsTest { - - private static final String INSTANCE_ENV = "BIGTABLE_TESTING_INSTANCE"; - private static final String TABLE_ID = - "mobile-time-series-" + UUID.randomUUID().toString().substring(0, 20); - private static final String COLUMN_FAMILY_NAME = "stats_summary"; - private static final long TIMESTAMP = System.currentTimeMillis() * 1000; - - private static String projectId; - private static String instanceId; - private 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; - } +public class ReadsTest extends MobileTimeSeriesBaseTest { @BeforeClass public static void beforeClass() throws IOException { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); - instanceId = requireEnv(INSTANCE_ENV); - - try (BigtableTableAdminClient adminClient = - BigtableTableAdminClient.create(projectId, instanceId)) { - CreateTableRequest createTableRequest = - CreateTableRequest.of(TABLE_ID).addFamily(COLUMN_FAMILY_NAME); - adminClient.createTable(createTableRequest); - - try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { - BulkMutation bulkMutation = - BulkMutation.create(TABLE_ID) - .add( - "phone#4c410523#20190501", - Mutation.create() - .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")) - .add( - "phone#4c410523#20190502", - Mutation.create() - .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.004")) - .add( - "phone#4c410523#20190505", - Mutation.create() - .setCell( - COLUMN_FAMILY_NAME, - ByteString.copyFrom("connected_cell".getBytes()), - TIMESTAMP, - 0) - .setCell( - COLUMN_FAMILY_NAME, - ByteString.copyFrom("connected_wifi".getBytes()), - TIMESTAMP, - 1) - .setCell(COLUMN_FAMILY_NAME, "os_build", TIMESTAMP, "PQ2A.190406.000")) - .add( - "phone#5c10102#20190501", - Mutation.create() - .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.190401.002")) - .add( - "phone#5c10102#20190502", - Mutation.create() - .setCell( - COLUMN_FAMILY_NAME, - ByteString.copyFrom("connected_cell".getBytes()), - TIMESTAMP, - 1) - .setCell( - COLUMN_FAMILY_NAME, - ByteString.copyFrom("connected_wifi".getBytes()), - TIMESTAMP, - 0) - .setCell(COLUMN_FAMILY_NAME, "os_build", TIMESTAMP, "PQ2A.190406.000")); - - dataClient.bulkMutateRows(bulkMutation); - } - } catch (Exception e) { - System.out.println("Error during beforeClass: \n" + e.toString()); - throw (e); - } - } - - @Before - public void setupStream() { - bout = new ByteArrayOutputStream(); - System.setOut(new PrintStream(bout)); + initializeVariables(); + createTable(); + writeStatsData(); } @AfterClass public static void afterClass() throws IOException { - try (BigtableTableAdminClient adminClient = - BigtableTableAdminClient.create(projectId, instanceId)) { - adminClient.deleteTable(TABLE_ID); - } catch (Exception e) { - System.out.println("Error during afterClass: \n" + e.toString()); - throw (e); - } + cleanupTable(); } @Test @@ -317,6 +186,32 @@ public void testReadPrefix() { 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); diff --git a/samples/snippets/src/test/java/com/example/bigtable/SchemaBundleExampleTest.java b/samples/snippets/src/test/java/com/example/bigtable/SchemaBundleExampleTest.java new file mode 100644 index 0000000000..c76d1288eb --- /dev/null +++ b/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/samples/snippets/src/test/java/com/m/examples/bigtable/TableAdminExampleTest.java b/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java similarity index 88% rename from samples/snippets/src/test/java/com/m/examples/bigtable/TableAdminExampleTest.java rename to samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java index 887c54a27a..d4fd4de304 100644 --- a/samples/snippets/src/test/java/com/m/examples/bigtable/TableAdminExampleTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java @@ -12,13 +12,12 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ -package com.m.examples.bigtable; +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.assertNotNull; import static org.junit.Assert.assertTrue; import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; @@ -32,39 +31,26 @@ import com.google.cloud.bigtable.admin.v2.models.GCRules.VersionRule; import java.io.IOException; import java.util.List; -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.AssumptionViolatedException; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** Integration tests for {@link TableAdminExample} */ -public class TableAdminExampleTest { +public class TableAdminExampleTest extends BigtableBaseTest { - private static final String INSTANCE_ENV = "BIGTABLE_TESTING_INSTANCE"; private static final String TABLE_PREFIX = "table"; private static BigtableTableAdminClient adminClient; - private static String instanceId; - private static String projectId; private String tableId; private TableAdminExample tableAdmin; - private static String requireEnv(String varName) { - assertNotNull( - System.getenv(varName), - "Environment variable '%s' is required to perform these tests.".format(varName)); - return System.getenv(varName); - } - @BeforeClass public static void beforeClass() throws IOException { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); - instanceId = requireEnv(INSTANCE_ENV); + initializeVariables(); BigtableTableAdminSettings adminSettings = BigtableTableAdminSettings.newBuilder() .setInstanceId(instanceId) @@ -81,7 +67,7 @@ public static void afterClass() { @Before public void setup() throws IOException { - tableId = generateTableId(); + tableId = generateResourceId(TABLE_PREFIX); tableAdmin = new TableAdminExample(projectId, instanceId, tableId); adminClient.createTable(CreateTableRequest.of(tableId).addFamily("cf")); } @@ -91,12 +77,15 @@ 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 = generateTableId(); + String testTable = generateResourceId(TABLE_PREFIX); TableAdminExample testTableAdmin = new TableAdminExample(projectId, instanceId, testTable); testTableAdmin.createTable(); assertTrue(adminClient.exists(testTable)); @@ -199,11 +188,6 @@ private boolean ruleCheck(GCRule condition) { return found; } - 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()) { diff --git a/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java b/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java index b28a1ef74d..ac6a09b4ef 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java @@ -16,70 +16,28 @@ package com.example.bigtable; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; -import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; -import com.google.cloud.bigtable.admin.v2.models.CreateTableRequest; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import java.util.UUID; +import java.io.IOException; import org.hamcrest.CoreMatchers; import org.junit.AfterClass; -import org.junit.Before; import org.junit.BeforeClass; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class WritesTest { - - private static final String INSTANCE_ENV = "BIGTABLE_TESTING_INSTANCE"; - private static final String TABLE_ID = - "mobile-time-series-" + UUID.randomUUID().toString().substring(0, 20); - private static final String COLUMN_FAMILY_NAME = "stats_summary"; - - private static String projectId; - private static String instanceId; - private 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; - } +public class WritesTest extends MobileTimeSeriesBaseTest { @BeforeClass - public static void beforeClass() { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); - instanceId = requireEnv(INSTANCE_ENV); - try (BigtableTableAdminClient adminClient = - BigtableTableAdminClient.create(projectId, instanceId)) { - CreateTableRequest createTableRequest = - CreateTableRequest.of(TABLE_ID).addFamily(COLUMN_FAMILY_NAME); - adminClient.createTable(createTableRequest); - } catch (Exception e) { - System.out.println("Error during beforeClass: \n" + e.toString()); - } - } - - @Before - public void setupStream() { - bout = new ByteArrayOutputStream(); - System.setOut(new PrintStream(bout)); + public static void beforeClass() throws IOException { + initializeVariables(); + createTable(); } @AfterClass - public static void afterClass() { - try (BigtableTableAdminClient adminClient = - BigtableTableAdminClient.create(projectId, instanceId)) { - adminClient.deleteTable(TABLE_ID); - } catch (Exception e) { - System.out.println("Error during afterClass: \n" + e.toString()); - } + public static void afterClass() throws IOException { + cleanupTable(); } @Test @@ -114,4 +72,12 @@ public void test4_WriteIncrement() { 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/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java b/samples/snippets/src/test/java/com/example/bigtable/deletes/DeletesTest.java new file mode 100644 index 0000000000..308607c891 --- /dev/null +++ b/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/samples/snippets/src/test/java/com/m/examples/bigtable/QuickstartTest.java b/samples/snippets/src/test/java/com/m/examples/bigtable/QuickstartTest.java deleted file mode 100644 index d648d05483..0000000000 --- a/samples/snippets/src/test/java/com/m/examples/bigtable/QuickstartTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.m.examples.bigtable; - -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; - -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; -import org.hamcrest.CoreMatchers; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Integration tests for {@link Quickstart} - */ -public class QuickstartTest { - - private static final String INSTANCE_ENV = "BIGTABLE_TESTING_INSTANCE"; - private static final String TABLE_ID = "quickstart-table"; - private static String projectId; - private static String instanceId; - private ByteArrayOutputStream bout; - - private static String requireEnv(String varName) { - assertNotNull( - System.getenv(varName), - "Environment variable '%s' is required to perform these tests.".format(varName)); - return System.getenv(varName); - } - - @BeforeClass - public static void beforeClass() { - projectId = requireEnv("GOOGLE_CLOUD_PROJECT"); - instanceId = requireEnv(INSTANCE_ENV); - } - - @Before - public void setUp() { - bout = new ByteArrayOutputStream(); - System.setOut(new PrintStream(bout)); - } - - @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/synth.metadata b/synth.metadata index 774154bb0d..e9b708413f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "71a8fd7fe55bd40ad32963ffdfc06999be2ff7fc" + "sha": "ff0266842ddbac752a39f650ae64c202f1f7fca1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f6dd7e47620566925a4b3f1ce029e74e1b2f2516", - "internalRef": "359781040" + "sha": "10380880f030101709b3ebe1eb1dd121fa8b4116", + "internalRef": "420859180" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6946fd71ae9215b0e7ae188f5057df765ee6d7d2" + "sha": "6355638dfed614fe5977a06d59dc010370f88582" } } ], @@ -50,9 +50,10 @@ ".github/PULL_REQUEST_TEMPLATE.md", ".github/blunderbuss.yml", ".github/generated-files-bot.yml", - ".github/readme/synth.py", ".github/release-please.yml", + ".github/release-trigger.yml", ".github/snippet-bot.yml", + ".github/sync-repo-settings.yaml", ".github/trusted-contribution.yml", ".github/workflows/approve-readme.yaml", ".github/workflows/auto-release.yaml", @@ -65,7 +66,6 @@ ".kokoro/common.sh", ".kokoro/continuous/common.cfg", ".kokoro/continuous/java8.cfg", - ".kokoro/continuous/readme.cfg", ".kokoro/dependencies.sh", ".kokoro/nightly/common.cfg", ".kokoro/nightly/java11.cfg", @@ -77,6 +77,7 @@ ".kokoro/presubmit/clirr.cfg", ".kokoro/presubmit/common.cfg", ".kokoro/presubmit/dependencies.cfg", + ".kokoro/presubmit/graalvm-native.cfg", ".kokoro/presubmit/java11.cfg", ".kokoro/presubmit/java7.cfg", ".kokoro/presubmit/java8-osx.cfg", @@ -103,6 +104,7 @@ ".kokoro/trampoline.sh", "CODE_OF_CONDUCT.md", "LICENSE", + "SECURITY.md", "codecov.yaml", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java", @@ -136,6 +138,10 @@ "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileName.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimits.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargets.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfo.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupInfoOrBuilder.java", @@ -173,8 +179,6 @@ "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java", - "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java", - "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java", @@ -244,6 +248,10 @@ "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OperationProgressOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadata.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/OptimizeRestoredTableMetadataOrBuilder.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadata.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequest.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequest.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateInstanceRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ProjectName.java", diff --git a/synth.py b/synth.py deleted file mode 100644 index e26edaac07..0000000000 --- a/synth.py +++ /dev/null @@ -1,156 +0,0 @@ -# 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""This script is used to synthesize generated parts of this library.""" - -import re -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.java as java - -AUTOSYNTH_MULTIPLE_COMMITS = True - -# TODO: try to move the GAPIC surface hiding to the gapic-generator: -# https://github.com/googleapis/gapic-generator/issues/2742 - -def main(): - gapic = gcp.GAPICBazel() - - generate_data_api(gapic) - generate_admin_api(gapic) - - java.format_code(f'./google-cloud-bigtable/src') - - java.common_templates(excludes=[ - '.gitignore', - '.kokoro/presubmit/integration.cfg', - '.kokoro/nightly/integration.cfg', - '.kokoro/presubmit/samples.cfg', - '.kokoro/nightly/samples.cfg', - # todo remove once template is updated - '.github/ISSUE_TEMPLATE/bug_report.md', - 'CONTRIBUTING.md', - ]) - -def generate_data_api(gapic): - library = gapic.java_library( - service='bigtable', - version='v2', - proto_path=f'google/bigtable/v2', - bazel_target=f'//google/bigtable/v2:google-cloud-bigtable-v2-java', - ) - - library = library / 'google-cloud-bigtable-v2-java' - - # Excludes are relative to source `gapic-google-cloud-bigtable-v2/src` - excludes = [ - "build.gradle", - "pom.xml", - "README.md", - "src/main/java/com/google/cloud/bigtable/data/v2/package-info.java", - "src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java", - "src/main/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java", - "src/test/java/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java", - "src/test/java/com/google/cloud/bigtable/data/v2/MockBigtable.java", - "src/test/java/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java", - ] - - # Paths are relative to the destination, which is the current working directory - internal_only = [ - "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java", - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java', - "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java", - "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java", - ] - - package_name = f'com.google.bigtable.v2' - java.fix_proto_headers(library / f'proto-google-cloud-bigtable-v2-java') - java.fix_grpc_headers(library / f'grpc-google-cloud-bigtable-v2-java', package_name) - - s.copy(library / f'gapic-google-cloud-bigtable-v2-java', 'google-cloud-bigtable/', excludes=excludes) - s.copy(library / f'grpc-google-cloud-bigtable-v2-java/src', f'grpc-google-cloud-bigtable-v2/src') - s.copy(library / f'proto-google-cloud-bigtable-v2-java/src', f'proto-google-cloud-bigtable-v2/src') - - make_internal_only(internal_only) - - java.format_code(f'./grpc-google-cloud-bigtable-v2/src') - java.format_code(f'./proto-google-cloud-bigtable-v2/src') - -def generate_admin_api(gapic): - library = gapic.java_library( - service='bigtable-admin', - version='v2', - bazel_target=f'//google/bigtable/admin/v2:google-cloud-bigtable-admin-v2-java', - proto_path=f'google/bigtable/admin/v2', - ) - - library = library / 'google-cloud-bigtable-admin-v2-java' - - # Excludes are relative to source `gapic-google-cloud-bigtable-v2/src` - excludes = [ - "main/java/com/google/cloud/bigtable/admin/v2/package-info.java", - ] - - # Paths are relative to the destination, which is the current working directory - internal_only = [ - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminCallableFactory.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java', - 'google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java', - ] - - package_name = f'com.google.cloud.bigtable.admin.v2' - java.fix_proto_headers(library / f'proto-google-cloud-bigtable-admin-v2-java') - java.fix_grpc_headers(library / f'grpc-google-cloud-bigtable-admin-v2-java', package_name) - - s.copy(library / f'gapic-google-cloud-bigtable-admin-v2-java/src', 'google-cloud-bigtable/src', excludes=excludes) - s.copy(library / f'grpc-google-cloud-bigtable-admin-v2-java/src', f'grpc-google-cloud-bigtable-admin-v2/src') - s.copy(library / f'proto-google-cloud-bigtable-admin-v2-java/src', f'proto-google-cloud-bigtable-admin-v2/src') - - #todo: fix in synthtool removing comments with method - java.remove_method(f'./grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java', "public UnaryCallSettings updateInstanceSettings()") - - java.remove_method(f'./google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java', "/** Returns the builder for the settings used for calls to updateInstance. */") - java.remove_method(f'./google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java', "public UnaryCallSettings.Builder updateInstanceSettings()") - - java.remove_method(f'./google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java', "/** Returns the object with the settings used for calls to updateInstance. */") - java.remove_method(f'./google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java', "public UnaryCallSettings updateInstanceSettings()") - - make_internal_only(internal_only) - - java.format_code(f'./grpc-google-cloud-bigtable-admin-v2/src') - java.format_code(f'./proto-google-cloud-bigtable-admin-v2/src') - -def make_internal_only(sources): - """Annotates all toplevel classes with `@InternalOnly`""" - # Insert InternalOnly import in the non-static. - s.replace(sources, - before=r'^(import (?!static).*?\n)\n', - after=r'\1import com.google.api.core.InternalApi;\n\n', - flags=re.MULTILINE | re.DOTALL) - - # Replace javadoc and annotations before every public class with InternalApi - # javadoc and annotation - s.replace(sources, - before=r'/\*\*.+?\*/\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) - -main() diff --git a/test-proxy/EnableAutoValue.txt b/test-proxy/EnableAutoValue.txt new file mode 100644 index 0000000000..e8237e1cbc --- /dev/null +++ b/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/test-proxy/README.md b/test-proxy/README.md new file mode 100644 index 0000000000..f87a3374ca --- /dev/null +++ b/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/test-proxy/known_failures.txt b/test-proxy/known_failures.txt new file mode 100644 index 0000000000..46d48c46f8 --- /dev/null +++ b/test-proxy/known_failures.txt @@ -0,0 +1 @@ +TestFeatureGap/(traffic_director_enabled|direct_access_requested)|TestReadRows_Retry_WithRetryInfo_MultipleErrorResponse diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml new file mode 100644 index 0000000000..cc4c8605ed --- /dev/null +++ b/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.76.0 + + + + 2.76.0 + + + + + + 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.24.0: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/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/BoundStatementDeserializer.java b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/BoundStatementDeserializer.java new file mode 100644 index 0000000000..43da147274 --- /dev/null +++ b/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/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java new file mode 100644 index 0000000000..d2147e6167 --- /dev/null +++ b/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/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxyMain.java b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxyMain.java new file mode 100644 index 0000000000..77a764f551 --- /dev/null +++ b/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/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/ResultSetSerializer.java b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/ResultSetSerializer.java new file mode 100644 index 0000000000..2467ce5299 --- /dev/null +++ b/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/test-proxy/src/main/proto/test_proxy.proto b/test-proxy/src/main/proto/test_proxy.proto new file mode 100644 index 0000000000..34cf534425 --- /dev/null +++ b/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/versions.txt b/versions.txt index 5ec57505e8..fd244b58b2 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:1.20.1:1.20.2-SNAPSHOT -grpc-google-cloud-bigtable-admin-v2:1.20.1:1.20.2-SNAPSHOT -grpc-google-cloud-bigtable-v2:1.20.1:1.20.2-SNAPSHOT -proto-google-cloud-bigtable-admin-v2:1.20.1:1.20.2-SNAPSHOT -proto-google-cloud-bigtable-v2:1.20.1:1.20.2-SNAPSHOT -google-cloud-bigtable-emulator:0.129.1:0.129.2-SNAPSHOT +google-cloud-bigtable:2.76.0:2.76.0 +grpc-google-cloud-bigtable-admin-v2:2.76.0:2.76.0 +grpc-google-cloud-bigtable-v2:2.76.0:2.76.0 +proto-google-cloud-bigtable-admin-v2:2.76.0:2.76.0 +proto-google-cloud-bigtable-v2:2.76.0:2.76.0 +google-cloud-bigtable-emulator:0.213.0:0.213.0 +google-cloud-bigtable-emulator-core:0.213.0:0.213.0