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.yaml b/.github/.OwlBot-hermetic.yaml similarity index 91% rename from .github/.OwlBot.yaml rename to .github/.OwlBot-hermetic.yaml index 700ec1611c..40c7b4332b 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot-hermetic.yaml @@ -11,10 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -docker: - image: "gcr.io/cloud-devrel-public-resources/owlbot-java:latest" - deep-remove-regex: - "/grpc-google-.*/src" - "/proto-google-.*/src" @@ -34,4 +30,4 @@ deep-copy-regex: - 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" \ No newline at end of file + dest: "/owl-bot-staging/$1/google-cloud-bigtable/src" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7c4d9ac88e..1b14ac10a9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,9 +4,15 @@ # 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/api-bigtable @googleapis/api-bigtable-partners is the default owner for changes in this repo +* @googleapis/yoshi-java @googleapis/api-bigtable @googleapis/api-bigtable-partners + +# for handwritten libraries, keep codeowner_team in .repo-metadata.json as owner +**/*.java @googleapis/api-bigtable @googleapis/api-bigtable-partners + # 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/yoshi-java 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/.OwlBot.lock.yaml b/.github/auto-label.yaml similarity index 68% rename from .github/.OwlBot.lock.yaml rename to .github/auto-label.yaml index 9786771c43..4caef688b7 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/auto-label.yaml @@ -1,16 +1,15 @@ -# Copyright 2022 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. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:3c950ed12391ebaffd1ee66d0374766a1c50144ebe6a7a0042300b2e6bb5856b +requestsize: + enabled: true 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/release-please.yml b/.github/release-please.yml index e31f046214..62a86ce89b 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -23,5 +23,47 @@ branches: - >- 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 extraFiles: - google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml index d4ca94189e..3fe5f7245a 100644 --- a/.github/release-trigger.yml +++ b/.github/release-trigger.yml @@ -1 +1,2 @@ enabled: true +multiScmName: java-bigtable diff --git a/.github/scripts/hermetic_library_generation.sh b/.github/scripts/hermetic_library_generation.sh new file mode 100644 index 0000000000..49a7414cf7 --- /dev/null +++ b/.github/scripts/hermetic_library_generation.sh @@ -0,0 +1,116 @@ +#!/bin/bash +set -e +# This script should be run at the root of the repository. +# This script is used to, when a pull request changes the generation +# configuration (generation_config.yaml by default): +# 1. Find whether the last commit in this pull request contains changes to +# the generation configuration and exit early if it doesn't have such a change +# since the generation result would be the same. +# 2. Compare generation configurations in the current branch (with which the +# pull request associated) and target branch (into which the pull request is +# merged); +# 3. Generate changed libraries using library_generation image; +# 4. Commit the changes to the pull request, if any. +# 5. Edit the PR body with generated pull request description, if applicable. + +# The following commands need to be installed before running the script: +# 1. git +# 2. gh +# 3. docker + +# The parameters of this script is: +# 1. target_branch, the branch into which the pull request is merged. +# 2. current_branch, the branch with which the pull request is associated. +# 3. [optional] generation_config, the path to the generation configuration, +# the default value is generation_config.yaml in the repository root. +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --target_branch) + target_branch="$2" + shift + ;; + --current_branch) + current_branch="$2" + shift + ;; + --generation_config) + generation_config="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${target_branch}" ]; then + echo "missing required argument --target_branch" + exit 1 +fi + +if [ -z "${current_branch}" ]; then + echo "missing required argument --current_branch" + exit 1 +fi + +if [ -z "${generation_config}" ]; then + generation_config=generation_config.yaml + echo "Using default generation config: ${generation_config}" +fi + +workspace_name="/workspace" +baseline_generation_config="baseline_generation_config.yaml" +message="chore: generate libraries at $(date)" + +git checkout "${target_branch}" +git checkout "${current_branch}" + +# copy generation configuration from target branch to current branch. +git show "${target_branch}":"${generation_config}" > "${baseline_generation_config}" + +# parse image tag from the generation configuration. +image_tag=$(grep "gapic_generator_version" "${generation_config}" | cut -d ':' -f 2 | xargs) + +repo_root_dir=$(pwd) +mkdir -p "${repo_root_dir}/output" +# download api definitions from googleapis repository +googleapis_commitish=$(grep googleapis_commitish "${generation_config}" | cut -d ":" -f 2 | xargs) +api_def_dir=$(mktemp -d) +git clone https://github.com/googleapis/googleapis.git "${api_def_dir}" +pushd "${api_def_dir}" +git checkout "${googleapis_commitish}" +cp -r google/ grafeas/ "${repo_root_dir}/output" +popd + +# run hermetic code generation docker image. +docker run \ + --rm \ + -u "$(id -u):$(id -g)" \ + -v "$(pwd):${workspace_name}" \ + gcr.io/cloud-devrel-public-resources/java-library-generation:"${image_tag}" \ + --baseline-generation-config-path="${workspace_name}/${baseline_generation_config}" \ + --current-generation-config-path="${workspace_name}/${generation_config}" + +# remove api definitions after generation +rm -rf "${api_def_dir}" + +# commit the change to the pull request. +rm -rdf output googleapis "${baseline_generation_config}" +git add --all -- ':!pr_description.txt' ':!hermetic_library_generation.sh' +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" != "" ]]; then + echo "Commit changes..." + git commit -m "${message}" + git push +else + echo "There is no generated code change, skip commit." +fi + +# set pr body if pr_description.txt is generated. +if [[ -f "pr_description.txt" ]]; then + pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") + gh pr edit "${pr_num}" --body "$(cat pr_description.txt)" +fi diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh new file mode 100644 index 0000000000..93e1a47bea --- /dev/null +++ b/.github/scripts/update_generation_config.sh @@ -0,0 +1,121 @@ +#!/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 + latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1) + echo "${latest}" +} + +# 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}" +} + +# 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. +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 + ;; + *) + 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 + +current_branch="generate-libraries-${base_branch}" +title="chore: Update generation configuration at $(date)" + +# 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}" +else + gh pr checkout "${pr_num}" +fi + +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 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}" +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." + exit 0 +fi +git commit -m "${title}" +if [ -z "${pr_num}" ]; then + git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" + git fetch -q --unshallow 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 4a2c04441f..487cfdb216 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -8,15 +8,17 @@ branchProtectionRules: requiresCodeOwnerReviews: true requiresStrictStatusChecks: false requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) + - dependencies (17) - lint - clirr - units (8) - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor + - 'Kokoro - Test: Java GraalVM Native Image' + - 'Kokoro - Test: Java 17 GraalVM Native Image' + - javadoc + - conformance - pattern: 1.22.0-sp isAdminEnforced: true requiredApprovingReviewCount: 1 @@ -59,7 +61,100 @@ branchProtectionRules: - units (11) - 'Kokoro - Test: Integration' - cla/google - - OwlBot Post Processor + - 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 permissionRules: - team: yoshi-admins permission: admin diff --git a/.github/trusted-contribution.yml b/.github/trusted-contribution.yml index a0ba1f7d90..88d3ac9bf1 100644 --- a/.github/trusted-contribution.yml +++ b/.github/trusted-contribution.yml @@ -1,3 +1,9 @@ trustedContributors: - 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 1bb1823276..59f00b8eb6 100644 --- a/.github/workflows/approve-readme.yaml +++ b/.github/workflows/approve-readme.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'googleapis' && github.head_ref == 'autosynth-readme' steps: - - uses: actions/github-script@v5 + - uses: actions/github-script@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 18e23230d9..0000000000 --- a/.github/workflows/auto-release.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# 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-release -jobs: - approve: - runs-on: ubuntu-latest - if: contains(github.head_ref, 'release-please') - steps: - - uses: actions/github-script@v5 - 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(main): release " - if ( !context.payload.pull_request.title.startsWith("chore(main): release") ) { - return; - } - - // only approve PRs with pom.xml and versions.txt changes - const filesPromise = github.rest.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.rest.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.rest.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.rest.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 6b5e56aaac..b91fa381f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,24 +25,48 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [11, 17, 21] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/build.sh env: JOB_TYPE: test + 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@v2 + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - distribution: zulu + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -52,22 +76,34 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [17] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - distribution: zulu + distribution: temurin java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh + javadoc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - distribution: zulu + distribution: temurin java-version: 11 - run: java -version - run: .kokoro/build.sh @@ -76,10 +112,10 @@ jobs: clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - distribution: zulu + distribution: temurin java-version: 8 - run: java -version - run: .kokoro/build.sh 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..51a087f8e5 --- /dev/null +++ b/.github/workflows/hermetic_library_generation.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: Hermetic library generation upon generation config change through pull requests +on: + pull_request: + +env: + HEAD_REF: ${{ github.head_ref }} + REPO_FULL_NAME: ${{ github.event.pull_request.head.repo.full_name }} + GITHUB_REPOSITORY: ${{ github.repository }} + +jobs: + library_generation: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Generate changed libraries + shell: bash + run: | + set -ex + if [[ "${GITHUB_REPOSITORY}" != "${REPO_FULL_NAME}" ]]; then + echo "This PR comes from a fork. Generation will be skipped" + exit 0 + fi + [ -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/hermetic_library_generation.sh \ + --target_branch ${{ github.base_ref }} \ + --current_branch $HEAD_REF + env: + GH_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..7c5ec7865e --- /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-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - 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 d5d964df15..03b2939567 100644 --- a/.github/workflows/samples.yaml +++ b/.github/workflows/samples.yaml @@ -20,9 +20,10 @@ jobs: checkstyle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: + distribution: temurin java-version: 8 - name: Run checkstyle run: mvn -P lint --quiet --batch-mode checkstyle:check diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml new file mode 100644 index 0000000000..276675e75b --- /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.36.1 + 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..8cbe58ecab --- /dev/null +++ b/.github/workflows/update_generation_config.yaml @@ -0,0 +1,42 @@ +# 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-22.04 + env: + # the branch into which the pull request is merged + base_branch: main + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Update params in generation config to latest + shell: bash + run: | + set -ex + [ -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_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 cc602c9eba..067cf4a4c4 100644 --- a/.kokoro/build.bat +++ b/.kokoro/build.bat @@ -1,18 +1,18 @@ +:: Copyright 2022 Google LLC +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. :: See documentation in type-shell-output.bat -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. "C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 5c9c321e53..605555ecae 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,7 +47,8 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} RETURN_CODE=$? ;; lint) @@ -71,7 +72,12 @@ integration) ;; graalvm) # Run Unit and Integration Tests with Native Image - mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative -Penable-integration-tests test + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test + RETURN_CODE=$? + ;; +graalvm17) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test RETURN_CODE=$? ;; samples) 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..0229a03a70 --- /dev/null +++ b/.kokoro/conformance.sh @@ -0,0 +1,91 @@ +#!/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 + # If there is known failures, please add + # "-skip `cat ../../test-proxy/known_failures.txt`" to the command below. + eval "go test -v -proxy_addr=:9999 ${configFlag}" + 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/dependencies.sh b/.kokoro/dependencies.sh index d7476cfe97..bd8960246f 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -57,54 +57,3 @@ retry_with_backoff 3 10 \ -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/ --.*//' >.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 **/.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 b8016eda9a..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,bigtable-prod-batch-it -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" + 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 index 58049cc38f..6a6ef94eff 100644 --- a/.kokoro/nightly/java11-integration.cfg +++ b/.kokoro/nightly/java11-integration.cfg @@ -35,3 +35,4 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "java-it-service-account" } + diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg new file mode 100644 index 0000000000..b448b1374d --- /dev/null +++ b/.kokoro/presubmit/graalvm-native-17.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.36.1" +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm17" +} + +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "-P bigtable-emulator-it,bigtable-prod-it,bigtable-prod-batch-it,enable-verbose-grpc-logs -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests -Dbigtable.kms_key_name=projects/gcloud-devel/locations/us-east1/keyRings/cmek-test-key-ring/cryptoKeys/cmek-test-key -Dbigtable.wait-for-cmek-key-status=true" +} + +# 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/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index 4c7225ec92..1df13c4bd6 100644 --- a/.kokoro/presubmit/graalvm-native.cfg +++ b/.kokoro/presubmit/graalvm-native.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/graalvm" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.36.1" } env_vars: { @@ -17,6 +17,11 @@ env_vars: { value: "gcloud-devel" } +env_vars: { + key: "INTEGRATION_TEST_ARGS" + value: "-P bigtable-emulator-it,bigtable-prod-it,bigtable-prod-batch-it,enable-verbose-grpc-logs -Dbigtable.project=gcloud-devel -Dbigtable.instance=google-cloud-bigtable -Dbigtable.table=integration-tests -Dbigtable.kms_key_name=projects/gcloud-devel/locations/us-east1/keyRings/cmek-test-key-ring/cryptoKeys/cmek-test-key -Dbigtable.wait-for-cmek-key-status=true" +} + env_vars: { key: "GOOGLE_CLOUD_PROJECT" value: "gcloud-devel" diff --git a/.kokoro/presubmit/integration.cfg b/.kokoro/presubmit/integration.cfg index b32d0e2b18..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,bigtable-prod-batch-it -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" + 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 7f78ee414f..0000000000 --- a/.kokoro/release/common.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# 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. - -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 742ec1a886..0000000000 --- a/.kokoro/release/drop.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# 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. - -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 3cac3d8a97..0000000000 --- a/.kokoro/release/promote.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# 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. - -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 7c730844ff..0000000000 --- a/.kokoro/release/publish_javadoc.cfg +++ /dev/null @@ -1,23 +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" -} - -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" - } - } -} diff --git a/.kokoro/release/publish_javadoc.sh b/.kokoro/release/publish_javadoc.sh deleted file mode 100755 index a6782c6cfd..0000000000 --- a/.kokoro/release/publish_javadoc.sh +++ /dev/null @@ -1,53 +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 - -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 - -# 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} 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 2af6c7caba..0000000000 --- a/.kokoro/release/publish_javadoc11.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# 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. - -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) - -# cloud RAD generation -mvn clean javadoc:aggregate -B -q -P docFX -# include CHANGELOG -cp CHANGELOG.md target/docfx-yml/history.md - -pushd target/docfx-yml - -# create metadata -python3 -m docuploader create-metadata \ - --name ${NAME} \ - --version ${VERSION} \ - --xrefs devsite://java/gax \ - --xrefs devsite://java/google-cloud-core \ - --xrefs devsite://java/api-common \ - --xrefs devsite://java/proto-google-common-protos \ - --xrefs devsite://java/google-api-client \ - --xrefs devsite://java/google-http-client \ - --xrefs devsite://java/protobuf \ - --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 1f55b77024..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 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 77dc4e8f0f..0000000000 --- a/.kokoro/release/stage.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# 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. - -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 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/.readme-partials.yml b/.readme-partials.yml index dd804349e4..c9386d33fb 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,6 +115,40 @@ custom_content: | TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). + ## Client side metrics + + Cloud Bigtable client supports publishing client side metrics to + [Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview) under the + `bigtable.googleapis.com/client` namespace. + + This feature is available once you upgrade to version 2.16.0 and above. + Follow the guide on https://cloud.google.com/bigtable/docs/client-side-metrics-setup to enable. + + Since version 2.38.0, [client side metrics](https://cloud.google.com/bigtable/docs/client-side-metrics) + is enabled by default. This feature collects useful telemetry data in the client and is recommended to + use in conjunction with server-side metrics to get a complete, actionable view of your Bigtable + performance. There is no additional cost to publish and view client-side metrics + in Cloud Monitoring. + + ### Opt-out client side metrics + + You can opt-out client side metrics with the following settings: + + ```java + BigtableDataSettings settings = BigtableDataSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .build(); + ``` + + ### Use a custom OpenTelemetry instance + + If your application already has OpenTelemetry integration, you can register client side metrics on + your OpenTelemetry instance. You can refer to + [CustomOpenTelemetryMetricsProvider](https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java) + on how to set it up. + ## Client request tracing: OpenCensus Tracing Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/), @@ -129,13 +163,13 @@ custom_content: | io.opencensus opencensus-impl - 0.24.0 + 0.31.1 runtime io.opencensus opencensus-exporter-trace-stackdriver - 0.24.0 + 0.31.1 io.grpc @@ -188,134 +222,46 @@ custom_content: | ); ``` - ## 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. + ### Disable Bigtbale traces - * `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 OpenCensus 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() ); ``` diff --git a/.repo-metadata.json b/.repo-metadata.json index 0fd6f4361b..154ecb6af5 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,16 +2,20 @@ "api_shortname": "bigtable", "name_pretty": "Cloud Bigtable", "product_documentation": "https://cloud.google.com/bigtable", + "api_description": "API for reading and writing the contents of Bigtables associated with a cloud project.", "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-bigtable/latest/history", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", "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", "library_type": "GAPIC_COMBO", - "extra_versioned_modules": "google-cloud-bigtable-emulator", - "excluded_poms": "google-cloud-bigtable-bom" -} + "requires_billing": true, + "codeowner_team": "@googleapis/api-bigtable @googleapis/api-bigtable-partners", + "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 965f672ea2..ffe38c778b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,1089 @@ # Changelog +## [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) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d05ad023a..3803aa5903 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,6 +38,8 @@ 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 `bigtable-emulator-it` and other options are `bigtable-prod-it` and `bigtable-directpath-it`. @@ -68,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.coveo: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. \ No newline at end of file diff --git a/README.md b/README.md index e285b78f7f..db9a8510e3 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Java idiomatic client for [Cloud Bigtable][product-docs]. ## 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 @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 24.2.0 + 26.37.0 pom import @@ -34,36 +34,38 @@ 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 - 2.5.2 + 2.40.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:24.2.0') +implementation platform('com.google.cloud:libraries-bom:26.47.0') 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 -implementation 'com.google.cloud:google-cloud-bigtable:2.5.2' +implementation 'com.google.cloud:google-cloud-bigtable:2.45.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" % "2.5.2" +libraryDependencies += "com.google.cloud" % "google-cloud-bigtable" % "2.45.0" ``` + ## Authentication @@ -78,9 +80,9 @@ The client application making API calls must be granted [authorization scopes][a ### 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 @@ -91,7 +93,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. @@ -99,7 +101,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. @@ -213,6 +215,40 @@ try { TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts). +## Client side metrics + +Cloud Bigtable client supports publishing client side metrics to +[Cloud Monitoring](https://cloud.google.com/monitoring/docs/monitoring-overview) under the +`bigtable.googleapis.com/client` namespace. + +This feature is available once you upgrade to version 2.16.0 and above. +Follow the guide on https://cloud.google.com/bigtable/docs/client-side-metrics-setup to enable. + +Since version 2.38.0, [client side metrics](https://cloud.google.com/bigtable/docs/client-side-metrics) +is enabled by default. This feature collects useful telemetry data in the client and is recommended to +use in conjunction with server-side metrics to get a complete, actionable view of your Bigtable +performance. There is no additional cost to publish and view client-side metrics +in Cloud Monitoring. + +### Opt-out client side metrics + +You can opt-out client side metrics with the following settings: + +```java +BigtableDataSettings settings = BigtableDataSettings.newBuilder() + .setProjectId("my-project") + .setInstanceId("my-instance") + .setMetricsProvider(NoopMetricsProvider.INSTANCE) + .build(); +``` + +### Use a custom OpenTelemetry instance + +If your application already has OpenTelemetry integration, you can register client side metrics on +your OpenTelemetry instance. You can refer to +[CustomOpenTelemetryMetricsProvider](https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.java) +on how to set it up. + ## Client request tracing: OpenCensus Tracing Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/), @@ -227,13 +263,13 @@ If you are using Maven, add this to your pom.xml file io.opencensus opencensus-impl - 0.24.0 + 0.31.1 runtime io.opencensus opencensus-exporter-trace-stackdriver - 0.24.0 + 0.31.1 io.grpc @@ -286,134 +322,46 @@ Tracing.getTraceConfig().updateActiveTraceParams( ); ``` -## 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" -``` +### Disable Bigtbale traces -At the start of your application configure the exporter and enable the Bigtable stats views: +If your application already has OpenCensus 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() ); ``` @@ -472,17 +420,28 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigtable/tree | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| 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) | | 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) | @@ -490,6 +449,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-bigtable/tree To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. +## Transport + +Cloud Bigtable uses gRPC for the transport layer. + ## Supported Java Versions Java 8 or above is required for using this client. @@ -582,19 +545,19 @@ Java is a registered trademark of Oracle and/or its affiliates. [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-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.45.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/main/troubleshooting/readme.md#troubleshooting +[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 diff --git a/generation_config.yaml b/generation_config.yaml new file mode 100644 index 0000000000..afd2786fa1 --- /dev/null +++ b/generation_config.yaml @@ -0,0 +1,38 @@ +gapic_generator_version: 2.46.1 +googleapis_commitish: 16a1580c06b3b32e8ab33c39d846bba7e21bfae3 +libraries_bom_version: 26.47.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/api-bigtable @googleapis/api-bigtable-partners' + 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 281d8a7680..c7206d0a2b 100644 --- a/google-cloud-bigtable-bom/pom.xml +++ b/google-cloud-bigtable-bom/pom.xml @@ -3,12 +3,13 @@ 4.0.0 com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.0 pom com.google.cloud - google-cloud-shared-config - 1.2.7 + sdk-platform-java-config + 3.36.1 + Google Cloud Bigtable BOM @@ -62,32 +63,37 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.45.0 com.google.cloud google-cloud-bigtable-emulator - 0.142.3 + 0.182.0 + + + com.google.cloud + google-cloud-bigtable-emulator-core + 0.182.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.45.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.5.3 + 2.45.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.45.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.5.3 + 2.45.0 diff --git a/google-cloud-bigtable-deps-bom/pom.xml b/google-cloud-bigtable-deps-bom/pom.xml index 1d6cdaf886..ea48a6f451 100644 --- a/google-cloud-bigtable-deps-bom/pom.xml +++ b/google-cloud-bigtable-deps-bom/pom.xml @@ -6,13 +6,14 @@ com.google.cloud - google-cloud-shared-config - 1.2.7 + sdk-platform-java-config + 3.36.1 + com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom @@ -62,13 +63,37 @@ + + + io.grpc + grpc-bom + 1.67.1 + pom + import + + + + + com.google.cloud + gapic-libraries-bom + 1.45.0 + pom + import + com.google.cloud google-cloud-shared-dependencies - 2.7.0 + ${google-cloud-shared-dependencies.version} pom import + + + 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..773bcced61 --- /dev/null +++ b/google-cloud-bigtable-emulator-core/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + + + google-cloud-bigtable-parent + com.google.cloud + 2.45.0 + + + google-cloud-bigtable-emulator-core + 0.182.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..9ac9245f22 --- /dev/null +++ b/google-cloud-bigtable-emulator-core/src/main/java/com/google/cloud/bigtable/emulator/core/EmulatorController.java @@ -0,0 +1,251 @@ +/* + * 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 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() throws IOException, TimeoutException, InterruptedException { + if (!isStopped) { + throw new IllegalStateException("Emulator is already started"); + } + this.port = getAvailablePort(); + + // 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; + } + } + pipeStreamToLog(process.getInputStream(), Level.INFO); + pipeStreamToLog(process.getErrorStream(), Level.WARNING); + isStopped = false; + + shutdownHook = + new Thread( + () -> { + if (!isStopped) { + isStopped = true; + process.destroy(); + } + }); + + Runtime.getRuntime().addShutdownHook(shutdownHook); + + waitForPort(port); + } + + /** 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(); + } + } + + 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 void 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(); + } + // +} diff --git a/google-cloud-bigtable-emulator/pom.xml b/google-cloud-bigtable-emulator/pom.xml index a3758215ac..775ce5c3b4 100644 --- a/google-cloud-bigtable-emulator/pom.xml +++ b/google-cloud-bigtable-emulator/pom.xml @@ -5,7 +5,7 @@ 4.0.0 google-cloud-bigtable-emulator - 0.142.3 + 0.182.0 Google Cloud Java - Bigtable Emulator https://github.com/googleapis/java-bigtable @@ -14,7 +14,7 @@ com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.45.0 scm:git:git@github.com:googleapis/java-bigtable.git @@ -41,7 +41,7 @@ com.google.cloud google-cloud-gcloud-maven-plugin - 0.1.4 + 0.1.5 @@ -69,8 +69,8 @@ org.apache.maven.plugins maven-dependency-plugin - - io.grpc:grpc-netty-shaded + + com.google.api:gax-grpc @@ -81,14 +81,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.0 pom import @@ -96,16 +96,29 @@ - + + com.google.cloud + google-cloud-bigtable-emulator-core + 0.182.0 + + com.google.api api-common + + + com.google.guava + guava + io.grpc grpc-api - - provided + + + + com.google.api + gax-grpc @@ -160,11 +173,5 @@ - - - io.grpc - grpc-netty-shaded - test - 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 b43322831c..b30fad7ebb 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,29 +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.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.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}. @@ -47,17 +36,12 @@ 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. @@ -65,98 +49,23 @@ public static Emulator createFromPath(Path path) { * 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(); - - // 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; - } - } - 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); - - waitForPort(port); + controller.start(); } /** 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(); @@ -177,27 +86,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) @@ -208,110 +109,20 @@ 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; - 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 {@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-stats/pom.xml b/google-cloud-bigtable-stats/pom.xml deleted file mode 100644 index 4d55e456d7..0000000000 --- a/google-cloud-bigtable-stats/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - com.google.cloud - google-cloud-bigtable-parent - 2.5.3 - - 4.0.0 - - - google-cloud-bigtable-stats - 2.5.3 - Experimental project to shade OpenCensus dependencies. - - - - - com.google.cloud - google-cloud-bigtable-deps-bom - 2.5.3 - pom - import - - - - - - - io.opencensus - opencensus-api - - - io.opencensus - opencensus-impl - - - io.opencensus - opencensus-exporter-stats-stackdriver - - - - - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - false - true - - - io.opencensus:* - - - - - io.opencensus - - com.google.bigtable.veneer.repackaged.io.opencensus - - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.2.0 - - - * - - - - - - diff --git a/google-cloud-bigtable/clirr-ignored-differences.xml b/google-cloud-bigtable/clirr-ignored-differences.xml index 767e12e548..a3dc564c44 100644 --- a/google-cloud-bigtable/clirr-ignored-differences.xml +++ b/google-cloud-bigtable/clirr-ignored-differences.xml @@ -34,11 +34,22 @@ 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 @@ -49,7 +60,7 @@ 8001 com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracer$Builder - change method args is ok because HeaderTracerStreamingCallable is InternalApi + 7004 com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable @@ -61,4 +72,207 @@ 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 + * + diff --git a/google-cloud-bigtable/pom.xml b/google-cloud-bigtable/pom.xml index c80aa6d05f..8f93502873 100644 --- a/google-cloud-bigtable/pom.xml +++ b/google-cloud-bigtable/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-bigtable - 2.5.3 + 2.45.0 jar Google Cloud Bigtable https://github.com/googleapis/java-bigtable @@ -12,11 +12,11 @@ com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.45.0 - 2.5.3 + 2.45.0 google-cloud-bigtable @@ -25,7 +25,12 @@ false ${skipTests} ${skipTests} - + + src/test/resources/logging.properties @@ -36,6 +41,10 @@ batch-bigtable.googleapis.com:443 + + + 1.65.0 + 3.25.4 @@ -43,14 +52,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.0 pom import @@ -60,7 +69,6 @@ - com.google.api @@ -118,14 +126,6 @@ com.google.guava guava - - com.google.http-client - google-http-client - - - com.google.http-client - google-http-client-gson - com.google.protobuf protobuf-java @@ -143,6 +143,21 @@ grpc-alts runtime + + 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 + + + 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 @@ -276,17 +331,19 @@ mockito-core test + + com.google.guava + guava-testlib + test + - enable-verbose-grpc-logs true - + src/test/resources/logging-verbose.properties @@ -296,6 +353,7 @@ 1 none + true @@ -440,7 +498,6 @@ false - cloud ${bigtable.directpath-data-endpoint} @@ -449,6 +506,9 @@ ${project.build.directory}/test-grpc-logs/directpath-it REQUIRE_DIRECT_PATH + + true + com.google.cloud.bigtable.data.v2.it.*IT @@ -525,6 +585,9 @@ ${project.build.directory}/test-grpc-logs/directpath-ipv4only-it REQUIRE_DIRECT_PATH_IPV4 + + true + com.google.cloud.bigtable.data.v2.it.*IT @@ -541,11 +604,40 @@ + + + kr.motd.maven + os-maven-plugin + 1.7.1 + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + + + test-compile + test-compile-custom + + + + + + com.google.protobuf:protoc:${test-protoc.version}:exe:${os.detected.classifier} + + grpc-java + + io.grpc:protoc-gen-grpc-java:${test-protoc-grpc.version}:exe:${os.detected.classifier} + + + org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.6.0 add-source @@ -564,7 +656,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0 + 3.5.0 @@ -599,12 +691,12 @@ org.codehaus.mojo extra-enforcer-rules - 1.5.1 + 1.8.0 org.apache.maven.shared maven-dependency-tree - 3.1.0 + 3.3.0 @@ -614,11 +706,10 @@ maven-dependency-plugin - io.grpc:grpc-auth,io.grpc:grpc-grpclb + io.grpc:grpc-auth io.opencensus:opencensus-impl-core @@ -632,11 +723,18 @@ true - classes - 10 + + 4 + false false + + ${java-log-config} + @@ -652,6 +750,10 @@ 10 false + + + src/test/resources/logging.properties + diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java index 35fe7ced09..c3005eb13e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/Version.java @@ -20,6 +20,6 @@ @InternalApi("For internal use only") public final class Version { // {x-version-update-start:google-cloud-bigtable:current} - public static String VERSION = "2.5.3"; + public static String VERSION = "2.45.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 37f148141f..749947a6f6 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 2021 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. @@ -18,7 +18,6 @@ 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; @@ -44,12 +43,15 @@ 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.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.PartialUpdateClusterMetadata; @@ -106,7 +108,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); } @@ -123,7 +124,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; @@ -134,7 +134,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; } @@ -159,6 +158,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 (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
    *     BaseBigtableInstanceAdminClient.create()) {
    *   ProjectName parent = ProjectName.of("[PROJECT]");
@@ -208,6 +212,11 @@ public final OperationFuture createInstanceAsy
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -350,6 +374,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]");
@@ -374,6 +403,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();
@@ -397,6 +431,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 =
@@ -421,6 +460,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 =
@@ -445,6 +489,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]");
@@ -471,6 +520,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();
@@ -494,6 +548,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 =
@@ -519,6 +578,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 =
@@ -545,6 +609,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 =
@@ -553,6 +622,7 @@ public final UnaryCallable listInst
    *           .setDisplayName("displayName1714148973")
    *           .putAllLabels(new HashMap())
    *           .setCreateTime(Timestamp.newBuilder().build())
+   *           .setSatisfiesPzs(true)
    *           .build();
    *   Instance response = baseBigtableInstanceAdminClient.updateInstance(request);
    * }
@@ -573,6 +643,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 =
@@ -581,6 +656,7 @@ public final Instance updateInstance(Instance request) {
    *           .setDisplayName("displayName1714148973")
    *           .putAllLabels(new HashMap())
    *           .setCreateTime(Timestamp.newBuilder().build())
+   *           .setSatisfiesPzs(true)
    *           .build();
    *   ApiFuture future =
    *       baseBigtableInstanceAdminClient.updateInstanceCallable().futureCall(request);
@@ -601,6 +677,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();
@@ -633,6 +714,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 =
@@ -660,6 +746,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 =
@@ -689,6 +780,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 =
@@ -715,6 +811,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]");
@@ -739,6 +840,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();
@@ -762,6 +868,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 =
@@ -786,6 +897,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 =
@@ -815,6 +931,11 @@ public final UnaryCallable deleteInstanceCallable(
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -989,6 +1130,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]");
@@ -1013,6 +1159,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();
@@ -1036,6 +1187,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 =
@@ -1060,6 +1216,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 =
@@ -1084,6 +1245,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]");
@@ -1112,6 +1278,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();
@@ -1137,6 +1308,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 =
@@ -1162,6 +1338,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 =
@@ -1190,6 +1371,11 @@ public final UnaryCallable listCluste
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -1291,6 +1487,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()) {
    *   Cluster cluster = Cluster.newBuilder().build();
@@ -1332,6 +1533,11 @@ public final OperationFuture partialUpdat
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -1456,6 +1677,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();
@@ -1479,6 +1705,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 =
@@ -1503,6 +1734,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 =
@@ -1527,6 +1763,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]");
@@ -1564,6 +1805,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();
@@ -1601,6 +1847,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 =
@@ -1628,6 +1879,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 =
@@ -1655,6 +1911,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]");
@@ -1679,6 +1940,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();
@@ -1702,6 +1968,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 =
@@ -1726,6 +1997,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 =
@@ -1750,6 +2026,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]");
@@ -1781,6 +2062,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();
@@ -1809,6 +2095,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 =
@@ -1838,6 +2129,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 =
@@ -1867,6 +2163,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 =
@@ -1878,7 +2179,7 @@ public final ListAppProfilesPagedResponse listAppProfiles(ListAppProfilesRequest
    *   while (true) {
    *     ListAppProfilesResponse response =
    *         baseBigtableInstanceAdminClient.listAppProfilesCallable().call(request);
-   *     for (AppProfile element : response.getResponsesList()) {
+   *     for (AppProfile element : response.getAppProfilesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -1903,6 +2204,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();
@@ -1934,6 +2240,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 =
@@ -1961,6 +2272,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 =
@@ -1988,6 +2304,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 =
@@ -2014,6 +2335,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]");
@@ -2038,6 +2364,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();
@@ -2061,6 +2392,11 @@ 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()) {
    *   DeleteAppProfileRequest request =
@@ -2086,6 +2422,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 =
@@ -2112,9 +2453,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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
    *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(resource);
    * }
    * }
@@ -2139,6 +2485,11 @@ 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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
@@ -2163,11 +2514,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(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
    *   Policy response = baseBigtableInstanceAdminClient.getIamPolicy(request);
@@ -2189,11 +2545,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(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
    *   ApiFuture future =
@@ -2214,9 +2575,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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
    *   Policy policy = Policy.newBuilder().build();
    *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(resource, policy);
    * }
@@ -2245,6 +2611,11 @@ 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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
@@ -2273,12 +2644,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(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
    *   Policy response = baseBigtableInstanceAdminClient.setIamPolicy(request);
    * }
@@ -2298,12 +2675,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(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
    *   ApiFuture future =
    *       baseBigtableInstanceAdminClient.setIamPolicyCallable().futureCall(request);
@@ -2323,9 +2706,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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]");
    *   List permissions = new ArrayList<>();
    *   TestIamPermissionsResponse response =
    *       baseBigtableInstanceAdminClient.testIamPermissions(resource, permissions);
@@ -2356,6 +2744,11 @@ 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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
@@ -2389,11 +2782,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(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .addAllPermissions(new ArrayList())
    *           .build();
    *   TestIamPermissionsResponse response =
@@ -2415,11 +2813,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(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(InstanceName.of("[PROJECT]", "[INSTANCE]").toString())
    *           .addAllPermissions(new ArrayList())
    *           .build();
    *   ApiFuture future =
@@ -2434,6 +2837,191 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
     return stub.testIamPermissionsCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD.
+  /**
+   * Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based
+   * on CPU usage.
+   *
+   * 

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (BaseBigtableInstanceAdminClient baseBigtableInstanceAdminClient =
+   *     BaseBigtableInstanceAdminClient.create()) {
+   *   ListHotTabletsRequest request =
+   *       ListHotTabletsRequest.newBuilder()
+   *           .setParent(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString())
+   *           .setStartTime(Timestamp.newBuilder().build())
+   *           .setEndTime(Timestamp.newBuilder().build())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListHotTabletsResponse response =
+   *         baseBigtableInstanceAdminClient.listHotTabletsCallable().call(request);
+   *     for (HotTablet element : response.getHotTabletsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listHotTabletsCallable() { + return stub.listHotTabletsCallable(); + } + @Override public final void close() { stub.close(); @@ -2540,4 +3128,80 @@ 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); + } + } } 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 cdec6f3393..65b582f74a 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 2021 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. @@ -17,9 +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 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; @@ -49,6 +49,8 @@ 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.PartialUpdateClusterMetadata; @@ -216,6 +218,13 @@ 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(); + } + public static final BaseBigtableInstanceAdminSettings create( BigtableInstanceAdminStubSettings stub) throws IOException { return new BaseBigtableInstanceAdminSettings.Builder(stub.toBuilder()).build(); @@ -250,7 +259,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(); } @@ -457,6 +465,13 @@ 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(); + } + @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 336bbf1031..cb4787b2e4 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 2021 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. @@ -18,7 +18,6 @@ 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; @@ -29,26 +28,36 @@ 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.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.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.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.ListSnapshotsRequest; @@ -64,7 +73,13 @@ 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.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; @@ -77,6 +92,7 @@ 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; @@ -109,7 +125,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); } @@ -126,7 +141,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; @@ -137,7 +151,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; } @@ -158,6 +171,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]");
@@ -193,6 +211,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();
@@ -228,6 +251,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 =
@@ -256,6 +284,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 =
@@ -289,6 +322,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]");
@@ -335,6 +373,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]");
@@ -381,6 +424,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();
@@ -427,6 +475,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();
@@ -473,6 +526,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 =
@@ -507,6 +565,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 =
@@ -544,6 +607,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 =
@@ -572,6 +640,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]");
@@ -598,6 +671,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();
@@ -623,6 +701,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 =
@@ -651,6 +734,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 =
@@ -679,6 +767,11 @@ 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 =
@@ -690,7 +783,7 @@ public final UnaryCallable listTable
    *   while (true) {
    *     ListTablesResponse response =
    *         baseBigtableTableAdminClient.listTablesCallable().call(request);
-   *     for (Table element : response.getResponsesList()) {
+   *     for (Table element : response.getTablesList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -714,6 +807,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]");
@@ -738,6 +836,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();
@@ -761,6 +864,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 =
@@ -785,6 +893,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 =
@@ -801,6 +914,225 @@ 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` + *
+ *

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())
+   *           .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())
+   *           .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())
+   *           .build();
+   *   ApiFuture future =
+   *       baseBigtableTableAdminClient.updateTableCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateTableCallable() { + return stub.updateTableCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes a specified table and all of its data. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    * try (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
-   *   TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
-   *   baseBigtableTableAdminClient.deleteTable(name);
+   *   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 table to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. + * @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 deleteTable(TableName name) { - DeleteTableRequest request = - DeleteTableRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deleteTable(request); + 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 table and all of its data. + * 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 = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
-   *   baseBigtableTableAdminClient.deleteTable(name);
+   *   String name =
+   *       AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *           .toString();
+   *   baseBigtableTableAdminClient.deleteAuthorizedView(name);
    * }
    * }
* - * @param name Required. The unique name of the table to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. + * @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 deleteTable(String name) { - DeleteTableRequest request = DeleteTableRequest.newBuilder().setName(name).build(); - deleteTable(request); + public final void deleteAuthorizedView(String name) { + DeleteAuthorizedViewRequest request = + DeleteAuthorizedViewRequest.newBuilder().setName(name).build(); + deleteAuthorizedView(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes a specified table and all of its data. + * 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()) {
-   *   DeleteTableRequest request =
-   *       DeleteTableRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *   DeleteAuthorizedViewRequest request =
+   *       DeleteAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
    *           .build();
-   *   baseBigtableTableAdminClient.deleteTable(request);
+   *   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 deleteTable(DeleteTableRequest request) { - deleteTableCallable().call(request); + public final void deleteAuthorizedView(DeleteAuthorizedViewRequest request) { + deleteAuthorizedViewCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Permanently deletes a specified table and all of its data. + * 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()) {
-   *   DeleteTableRequest request =
-   *       DeleteTableRequest.newBuilder()
-   *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
+   *   DeleteAuthorizedViewRequest request =
+   *       DeleteAuthorizedViewRequest.newBuilder()
+   *           .setName(
+   *               AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]")
+   *                   .toString())
+   *           .setEtag("etag3123477")
    *           .build();
    *   ApiFuture future =
-   *       baseBigtableTableAdminClient.deleteTableCallable().futureCall(request);
+   *       baseBigtableTableAdminClient.deleteAuthorizedViewCallable().futureCall(request);
    *   // Do something.
    *   future.get();
    * }
    * }
*/ - public final UnaryCallable deleteTableCallable() { - return stub.deleteTableCallable(); + public final UnaryCallable deleteAuthorizedViewCallable() { + return stub.deleteAuthorizedViewCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. @@ -905,6 +2073,11 @@ public final UnaryCallable deleteTableCallable() { *

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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();
@@ -973,12 +2151,18 @@ public final Table modifyColumnFamilies(
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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);
    * }
@@ -1000,12 +2184,18 @@ public final Table modifyColumnFamilies(ModifyColumnFamiliesRequest 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()) {
    *   ModifyColumnFamiliesRequest request =
    *       ModifyColumnFamiliesRequest.newBuilder()
    *           .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString())
    *           .addAllModifications(new ArrayList())
+   *           .setIgnoreWarnings(true)
    *           .build();
    *   ApiFuture future =
    *       baseBigtableTableAdminClient.modifyColumnFamiliesCallable().futureCall(request);
@@ -1026,6 +2216,11 @@ public final UnaryCallable modifyColumnFamil
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -1051,6 +2246,11 @@ public final void dropRowRange(DropRowRangeRequest 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()) {
    *   DropRowRangeRequest request =
@@ -1077,6 +2277,11 @@ public final UnaryCallable dropRowRangeCallable() {
    * 

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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();
@@ -1133,6 +2343,11 @@ public final GenerateConsistencyTokenResponse generateConsistencyToken(String na
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -1277,6 +2512,11 @@ public final CheckConsistencyResponse checkConsistency(CheckConsistencyRequest r
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -1309,6 +2549,11 @@ public final CheckConsistencyResponse checkConsistency(CheckConsistencyRequest r
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -1633,6 +2913,11 @@ public final Snapshot getSnapshot(SnapshotName 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 =
@@ -1662,6 +2947,11 @@ public final Snapshot getSnapshot(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()) {
    *   GetSnapshotRequest request =
@@ -1692,6 +2982,11 @@ public final Snapshot getSnapshot(GetSnapshotRequest 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()) {
    *   GetSnapshotRequest request =
@@ -1722,6 +3017,11 @@ public final UnaryCallable getSnapshotCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -1757,6 +3057,11 @@ public final ListSnapshotsPagedResponse listSnapshots(ClusterName 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 = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
@@ -1789,6 +3094,11 @@ public final ListSnapshotsPagedResponse listSnapshots(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()) {
    *   ListSnapshotsRequest request =
@@ -1822,6 +3132,11 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest reque
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -1856,6 +3171,11 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest reque
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -1867,7 +3187,7 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest reque
    *   while (true) {
    *     ListSnapshotsResponse response =
    *         baseBigtableTableAdminClient.listSnapshotsCallable().call(request);
-   *     for (Snapshot element : response.getResponsesList()) {
+   *     for (Snapshot element : response.getSnapshotsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -1896,6 +3216,11 @@ public final UnaryCallable listSnap
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -1925,6 +3250,11 @@ public final void deleteSnapshot(SnapshotName 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 =
@@ -1954,6 +3284,11 @@ public final void deleteSnapshot(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()) {
    *   DeleteSnapshotRequest request =
@@ -1984,6 +3319,11 @@ public final void deleteSnapshot(DeleteSnapshotRequest 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()) {
    *   DeleteSnapshotRequest request =
@@ -2015,6 +3355,11 @@ public final UnaryCallable deleteSnapshotCallable(
    * 

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -2223,6 +3593,11 @@ public final Backup getBackup(BackupName 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 = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
@@ -2246,6 +3621,11 @@ public final Backup getBackup(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()) {
    *   GetBackupRequest request =
@@ -2270,6 +3650,11 @@ public final Backup getBackup(GetBackupRequest 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()) {
    *   GetBackupRequest request =
@@ -2294,6 +3679,11 @@ public final UnaryCallable getBackupCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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();
@@ -2304,7 +3694,8 @@ public final UnaryCallable getBackupCallable() {
    *
    * @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`.
+   *     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 @@ -2324,6 +3715,11 @@ public final Backup updateBackup(Backup backup, FieldMask updateMask) { *

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -2349,6 +3745,11 @@ public final Backup updateBackup(UpdateBackupRequest 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()) {
    *   UpdateBackupRequest request =
@@ -2374,6 +3775,11 @@ public final UnaryCallable updateBackupCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -2398,6 +3804,11 @@ public final void deleteBackup(BackupName 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 = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString();
@@ -2421,6 +3832,11 @@ public final void deleteBackup(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()) {
    *   DeleteBackupRequest request =
@@ -2445,6 +3861,11 @@ public final void deleteBackup(DeleteBackupRequest 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()) {
    *   DeleteBackupRequest request =
@@ -2469,6 +3890,11 @@ public final UnaryCallable deleteBackupCallable() {
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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]");
@@ -2499,6 +3925,11 @@ public final ListBackupsPagedResponse listBackups(ClusterName 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 = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString();
@@ -2526,6 +3957,11 @@ public final ListBackupsPagedResponse listBackups(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()) {
    *   ListBackupsRequest request =
@@ -2556,6 +3992,11 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest 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()) {
    *   ListBackupsRequest request =
@@ -2587,6 +4028,11 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest 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()) {
    *   ListBackupsRequest request =
@@ -2600,7 +4046,7 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) {
    *   while (true) {
    *     ListBackupsResponse response =
    *         baseBigtableTableAdminClient.listBackupsCallable().call(request);
-   *     for (Backup element : response.getResponsesList()) {
+   *     for (Backup element : response.getBackupsList()) {
    *       // doThingsWith(element);
    *     }
    *     String nextPageToken = response.getNextPageToken();
@@ -2619,17 +4065,21 @@ public final UnaryCallable listBackupsC
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD.
   /**
-   * Create a new table by restoring from a completed backup. The new table must be in the same
-   * project as the instance containing the backup. The returned table [long-running
+   * 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.
    *
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -2651,17 +4101,21 @@ public final OperationFuture restoreTableAsync(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD.
   /**
-   * Create a new table by restoring from a completed backup. The new table must be in the same
-   * project as the instance containing the backup. The returned table [long-running
+   * 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.
    *
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -2683,17 +4137,21 @@ public final OperationFuture restoreTableAsync(
 
   // AUTO-GENERATED DOCUMENTATION AND METHOD.
   /**
-   * Create a new table by restoring from a completed backup. The new table must be in the same
-   * project as the instance containing the backup. The returned table [long-running
+   * 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.
    *
    * 

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 =
@@ -2712,6 +4170,340 @@ public final UnaryCallable restoreTableCallable(
     return stub.restoreTableCallable();
   }
 
+  // AUTO-GENERATED DOCUMENTATION AND METHOD.
+  /**
+   * Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the
+   * destination instance and project.
+   *
+   * 

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: * *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating 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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
    *   Policy response = baseBigtableTableAdminClient.getIamPolicy(resource);
    * }
    * }
@@ -2747,6 +4544,11 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
@@ -2771,11 +4573,17 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   GetIamPolicyRequest request =
    *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
    *   Policy response = baseBigtableTableAdminClient.getIamPolicy(request);
@@ -2797,11 +4605,17 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   GetIamPolicyRequest request =
    *       GetIamPolicyRequest.newBuilder()
-   *           .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .setOptions(GetPolicyOptions.newBuilder().build())
    *           .build();
    *   ApiFuture future =
@@ -2822,9 +4636,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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
-   *   ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
    *   Policy policy = Policy.newBuilder().build();
    *   Policy response = baseBigtableTableAdminClient.setIamPolicy(resource, policy);
    * }
@@ -2853,6 +4672,11 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
@@ -2881,12 +4705,19 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   SetIamPolicyRequest request =
    *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
    *   Policy response = baseBigtableTableAdminClient.setIamPolicy(request);
    * }
@@ -2906,12 +4737,19 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   SetIamPolicyRequest request =
    *       SetIamPolicyRequest.newBuilder()
-   *           .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
    *           .build();
    *   ApiFuture future =
    *       baseBigtableTableAdminClient.setIamPolicyCallable().futureCall(request);
@@ -2931,9 +4769,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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
-   *   ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]");
+   *   ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]");
    *   List permissions = new ArrayList<>();
    *   TestIamPermissionsResponse response =
    *       baseBigtableTableAdminClient.testIamPermissions(resource, permissions);
@@ -2964,6 +4807,11 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   String resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString();
@@ -2997,11 +4845,17 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   TestIamPermissionsRequest request =
    *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .addAllPermissions(new ArrayList())
    *           .build();
    *   TestIamPermissionsResponse response =
@@ -3023,11 +4877,17 @@ 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 (BaseBigtableTableAdminClient baseBigtableTableAdminClient =
    *     BaseBigtableTableAdminClient.create()) {
    *   TestIamPermissionsRequest request =
    *       TestIamPermissionsRequest.newBuilder()
-   *           .setResource(AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]").toString())
+   *           .setResource(
+   *               BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString())
    *           .addAllPermissions(new ArrayList())
    *           .build();
    *   ApiFuture future =
@@ -3145,6 +5005,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,
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 5d9a1eb923..35494a28f7 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 2021 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.
@@ -16,12 +16,12 @@
 
 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.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;
@@ -33,23 +33,32 @@
 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.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.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.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.ListSnapshotsRequest;
@@ -63,7 +72,13 @@
 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.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;
@@ -112,11 +127,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 +289,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();
@@ -259,7 +350,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();
   }
@@ -352,11 +442,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() {
@@ -453,6 +612,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();
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 795e791469..793766c26a 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
@@ -523,12 +523,7 @@ public Cluster createCluster(CreateClusterRequest request) {
   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());
   }
 
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..42b0ea9b5d 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; @@ -115,12 +124,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 b8515ea17e..889598020a 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 @@ -22,11 +22,14 @@ 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.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.GetTableRequest; +import com.google.bigtable.admin.v2.ListAuthorizedViewsRequest; import com.google.bigtable.admin.v2.ListBackupsRequest; import com.google.bigtable.admin.v2.ListTablesRequest; import com.google.bigtable.admin.v2.RestoreTableMetadata; @@ -34,12 +37,18 @@ 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.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.CreateTableRequest; import com.google.cloud.bigtable.admin.v2.models.EncryptionInfo; @@ -49,8 +58,11 @@ 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.UpdateAuthorizedViewRequest; import com.google.cloud.bigtable.admin.v2.models.UpdateBackupRequest; +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.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -144,8 +156,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); } @@ -258,6 +272,72 @@ public ApiFuture
createTableAsync(CreateTableRequest request) { this.stub.createTableCallable().futureCall(request.toProto(projectId, instanceId))); } + /** + * 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. + */ + public Table updateTable(UpdateTableRequest request) { + return ApiExceptions.callAndTranslateApiException(updateTableAsync(request)); + } + + /** + * 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. + */ + 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()); + } + /** * Creates, updates and drops column families as specified in the request. * @@ -841,6 +921,11 @@ 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. * @@ -1218,7 +1303,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 * @@ -1241,13 +1327,96 @@ public void awaitOptimizeRestoredTable(OptimizeRestoredTableOperationToken token * }, * MoreExecutors.directExecutor() * ); - * */ + * } + */ public ApiFuture awaitOptimizeRestoredTableAsync( OptimizeRestoredTableOperationToken token) { return transformToVoid( stub.awaitOptimizeRestoredTableCallable().resumeFutureCall(token.getOperationName())); } + /** + * 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);
+   * }
+ */ + public Backup copyBackup(CopyBackupRequest request) { + return ApiExceptions.callAndTranslateApiException(copyBackupAsync(request)); + } + + /** + * 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()
+   * );
+   * }
+ */ + 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()); + } + /** * 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 @@ -1282,6 +1451,352 @@ public ApiFuture awaitReplicationAsync(final String tableId) { return stub.awaitReplicationCallable().futureCall(tableName); } + /** + * Creates a new authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * CreateAuthorizedViewRequest request =
+   *     CreateAuthorizedViewRequest.of("my-table", "my-new-authorized-view")
+   *         .setDeletionProtection(true)
+   *         .setAuthorizedViewType(
+   *             SubsetView.create()
+   *                 .addRowPrefix("row#")
+   *                 .addFamilySubsets(
+   *                     "my-family", FamilySubsets.create().addQualifier("column")));
+   *
+   * AuthorizedView response = client.createAuthorizedView(request);
+   * }
+ * + * @see CreateAuthorizedViewRequest for available options. + */ + public AuthorizedView createAuthorizedView(CreateAuthorizedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(createAuthorizedViewAsync(request)); + } + + /** + * Asynchronously creates a new authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * CreateAuthorizedViewRequest request =
+   *     CreateAuthorizedViewRequest.of("my-table", "my-new-authorized-view")
+   *         .setDeletionProtection(true)
+   *         .setAuthorizedViewType(
+   *             SubsetView.create()
+   *                 .addRowPrefix("row#")
+   *                 .addFamilySubsets(
+   *                     "my-family", FamilySubsets.create().addQualifier("column")));
+   *
+   * ApiFuture future = client.createAuthorizedViewAsync(request);
+   *
+   * ApiFutures.addCallback(
+   *   future,
+   *   new ApiFutureCallback() {
+   *     public void onSuccess(AuthorizedView authorizedView) {
+   *       System.out.println("Successfully created the authorized view: " + authorizedView.getId());
+   *     }
+   *
+   *     public void onFailure(Throwable t) {
+   *       t.printStackTrace();
+   *     }
+   *   },
+   *   MoreExecutors.directExecutor()
+   * );
+   * }
+ * + * @see CreateAuthorizedViewRequest for available options. + */ + 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()); + } + + /** + * Updates an existing authorized view with the specified configuration. + * + *

Sample code: + * + *

{@code
+   * AuthorizedView existingAuthorizedView = client.getAuthorizedView("my-table", "my-authorized-view");
+   *
+   * UpdateAuthorizedViewRequest request =
+   *     UpdateAuthorizedViewRequest.of(existingAuthorizedView).setDeletionProtection(true);
+   *
+   * AuthorizedView response = client.updateAuthorizedView(request);
+   * }
+ * + * @see UpdateAuthorizedViewRequest for available options. + */ + public AuthorizedView updateAuthorizedView(UpdateAuthorizedViewRequest request) { + return ApiExceptions.callAndTranslateApiException(updateAuthorizedViewAsync(request)); + } + + /** + * 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. + */ + 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()); + } + + /** + * 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");
+   * }
+ */ + public AuthorizedView getAuthorizedView(String tableId, String authorizedViewId) { + return ApiExceptions.callAndTranslateApiException( + getAuthorizedViewAsync(tableId, authorizedViewId)); + } + + /** + * 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()
+   * );
+   * }
+ */ + 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()); + } + + /** + * Lists all authorized view IDs in the specified table. + * + *

Sample code: + * + *

{@code
+   * List authorizedViews = client.listAuthorizedViews("my-table");
+   * }
+ */ + public List listAuthorizedViews(String tableId) { + return ApiExceptions.callAndTranslateApiException(listAuthorizedViewsAsync(tableId)); + } + + /** + * 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()
+   * );
+   * }
+ */ + 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()); + } + + /** + * 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");
+   * }
+ */ + public void deleteAuthorizedView(String tableId, String authorizedViewId) { + ApiExceptions.callAndTranslateApiException( + deleteAuthorizedViewAsync(tableId, authorizedViewId)); + } + + /** + * 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()
+   * );
+   * }
+ */ + 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)); + } + /** * Helper method to construct the table name in format: * projects/{project}/instances/{instance}/tables/{tableId} @@ -1666,6 +2181,187 @@ public ApiFuture> testBackupIamPermissionAsync( return testResourceIamPermissions(backupName, permissions); } + /** + * 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") + public Policy getAuthorizedViewIamPolicy(String tableId, String authorizedViewId) { + return ApiExceptions.callAndTranslateApiException( + getAuthorizedViewIamPolicyAsync(tableId, authorizedViewId)); + } + + /** + * 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") + public ApiFuture getAuthorizedViewIamPolicyAsync( + String tableId, String authorizedViewId) { + String authorizedViewName = + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId); + return getResourceIamPolicy(authorizedViewName); + } + + /** + * 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") + public Policy setAuthorizedViewIamPolicy(String tableId, String authorizedViewId, Policy policy) { + return ApiExceptions.callAndTranslateApiException( + setAuthorizedViewIamPolicyAsync(tableId, authorizedViewId, policy)); + } + + /** + * 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") + public ApiFuture setAuthorizedViewIamPolicyAsync( + String tableId, String authorizedViewId, Policy policy) { + String authorizedViewName = + NameUtil.formatAuthorizedViewName(projectId, instanceId, tableId, authorizedViewId); + return setResourceIamPolicy(policy, authorizedViewName); + } + + /** + * 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"}) + public List testAuthorizedViewIamPermission( + String tableId, String authorizedViewId, String... permissions) { + return ApiExceptions.callAndTranslateApiException( + testAuthorizedViewIamPermissionAsync(tableId, authorizedViewId, permissions)); + } + + /** + * 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"}) + 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..9da3e9af17 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,23 @@ 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()) .toString(); } @@ -170,14 +189,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 d9ca5e5df6..796badc1bb 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 @@ -46,6 +46,9 @@ "ListClusters": { "methods": ["listClusters", "listClusters", "listClusters", "listClustersCallable"] }, + "ListHotTablets": { + "methods": ["listHotTablets", "listHotTablets", "listHotTablets", "listHotTabletsPagedCallable", "listHotTabletsCallable"] + }, "ListInstances": { "methods": ["listInstances", "listInstances", "listInstances", "listInstancesCallable"] }, @@ -82,6 +85,12 @@ "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"] }, @@ -91,6 +100,9 @@ "CreateTableFromSnapshot": { "methods": ["createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotOperationCallable", "createTableFromSnapshotCallable"] }, + "DeleteAuthorizedView": { + "methods": ["deleteAuthorizedView", "deleteAuthorizedView", "deleteAuthorizedView", "deleteAuthorizedViewCallable"] + }, "DeleteBackup": { "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] }, @@ -106,6 +118,9 @@ "GenerateConsistencyToken": { "methods": ["generateConsistencyToken", "generateConsistencyToken", "generateConsistencyToken", "generateConsistencyTokenCallable"] }, + "GetAuthorizedView": { + "methods": ["getAuthorizedView", "getAuthorizedView", "getAuthorizedView", "getAuthorizedViewCallable"] + }, "GetBackup": { "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] }, @@ -118,6 +133,9 @@ "GetTable": { "methods": ["getTable", "getTable", "getTable", "getTableCallable"] }, + "ListAuthorizedViews": { + "methods": ["listAuthorizedViews", "listAuthorizedViews", "listAuthorizedViews", "listAuthorizedViewsPagedCallable", "listAuthorizedViewsCallable"] + }, "ListBackups": { "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] }, @@ -142,8 +160,17 @@ "TestIamPermissions": { "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] }, + "UndeleteTable": { + "methods": ["undeleteTableAsync", "undeleteTableAsync", "undeleteTableAsync", "undeleteTableOperationCallable", "undeleteTableCallable"] + }, + "UpdateAuthorizedView": { + "methods": ["updateAuthorizedViewAsync", "updateAuthorizedViewAsync", "updateAuthorizedViewOperationCallable", "updateAuthorizedViewCallable"] + }, "UpdateBackup": { "methods": ["updateBackup", "updateBackup", "updateBackupCallable"] + }, + "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..a2b59d6b5b 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 @@ -34,6 +34,9 @@ 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/([^/]+)"); + public static String formatProjectName(String projectId) { return "projects/" + projectId; } @@ -55,6 +58,11 @@ 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 extractTableIdFromTableName(String fullTableName) { Matcher matcher = TABLE_PATTERN.matcher(fullTableName); if (!matcher.matches()) { @@ -71,6 +79,15 @@ 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 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 52be2b0d52..bd7a534640 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,7 +16,10 @@ 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.Priority; +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; @@ -76,6 +79,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() { @@ -292,4 +306,211 @@ 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; + } + + @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; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataBoostIsolationReadOnlyPolicy that = (DataBoostIsolationReadOnlyPolicy) o; + return Objects.equal(proto, that.proto); + } + + @Override + public int hashCode() { + return Objects.hashCode(proto); + } + } } diff --git a/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 ce0ed7efc9..1c340910a0 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,20 @@ 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. * 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 8580fc9897..189685cfc0 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 @@ -177,6 +177,20 @@ public int getAutoscalingCpuPercentageTarget() { .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 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 index 1a0a135640..617618b800 100644 --- 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 @@ -104,6 +104,21 @@ public ClusterAutoscalingConfig setCpuUtilizationTargetPercent(int cpuUtilizatio 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 @@ -131,6 +146,20 @@ public int getCpuUtilizationTargetPercent() { .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. @@ -184,6 +213,15 @@ public boolean equals(Object o) { .getClusterAutoscalingConfig() .getAutoscalingTargets() .getCpuUtilizationPercent()) + && Objects.equal( + clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode(), + that.clusterConfigBuilder + .getClusterAutoscalingConfig() + .getAutoscalingTargets() + .getStorageUtilizationGibPerNode()) && Objects.equal(clusterId, that.clusterId) && Objects.equal(instanceId, that.instanceId); } @@ -203,6 +241,10 @@ public int hashCode() { .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..0718af03c1 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequest.java @@ -0,0 +1,71 @@ +/* + * 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 javax.annotation.Nonnull; + +@AutoValue +public abstract class ConsistencyRequest { + @Nonnull + protected abstract String getTableId(); + + @Nonnull + protected abstract CheckConsistencyRequest.ModeCase getMode(); + + public static ConsistencyRequest forReplication(String tableId) { + return new AutoValue_ConsistencyRequest( + tableId, CheckConsistencyRequest.ModeCase.STANDARD_READ_REMOTE_WRITES); + } + + public static ConsistencyRequest forDataBoost(String tableId) { + return new AutoValue_ConsistencyRequest( + tableId, CheckConsistencyRequest.ModeCase.DATA_BOOST_READ_LOCAL_WRITES); + } + + @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 65ecae8d78..851f0e677f 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 @@ -110,12 +110,13 @@ public CreateClusterRequest setScalingMode(@Nonnull StaticClusterSize staticClus /** * Sets the scaling mode to autoscaling by accepting an AutoscalingConfig where min nodes, max - * nodes, and CPU utlization percent target are set. + * 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() @@ -135,6 +136,12 @@ public CreateClusterRequest setScalingMode(@Nonnull ClusterAutoscalingConfig aut .getClusterAutoscalingConfigBuilder() .getAutoscalingTargetsBuilder() .setCpuUtilizationPercent(cpuTargetPercent); + proto + .getClusterBuilder() + .getClusterConfigBuilder() + .getClusterAutoscalingConfigBuilder() + .getAutoscalingTargetsBuilder() + .setStorageUtilizationGibPerNode(storageUtilizationGibPerNode); return this; } 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..0fbffcb190 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,11 +63,40 @@ 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; } @@ -76,6 +107,22 @@ public CreateTableRequest addSplit(ByteString 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; + } + @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/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/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 0547ebae01..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 @@ -29,37 +29,57 @@ public final class RestoreTableRequest { private final String sourceBackupId; private final String sourceClusterId; private final String sourceInstanceId; + private final String sourceProjectId; /** * Create a {@link RestoreTableRequest} object. It assumes the source backup locates in the same - * instance as the destination table. To restore a table from a backup in another instance, use - * {@link #of(String, String, String) of} method. + * 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); + RestoreTableRequest request = + new RestoreTableRequest(null, sourceClusterId, sourceBackupId, null); return request; } /** - * Create a {@link RestoreTableRequest} object. The source backup could locate in a the same or a - * different instance. + * 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); + 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) { + @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) { @@ -80,13 +100,18 @@ public boolean equals(Object o) { return Objects.equal(requestBuilder.getTableId(), that.requestBuilder.getTableId()) && Objects.equal(sourceInstanceId, that.sourceInstanceId) && Objects.equal(sourceClusterId, that.sourceClusterId) - && Objects.equal(sourceBackupId, that.sourceBackupId); + && Objects.equal(sourceBackupId, that.sourceBackupId) + && Objects.equal(sourceProjectId, that.sourceProjectId); } @Override public int hashCode() { return Objects.hashCode( - requestBuilder.getTableId(), sourceInstanceId, sourceClusterId, sourceBackupId); + requestBuilder.getTableId(), + sourceInstanceId, + sourceClusterId, + sourceBackupId, + sourceProjectId); } @InternalApi @@ -99,7 +124,7 @@ public com.google.bigtable.admin.v2.RestoreTableRequest toProto( .setParent(NameUtil.formatInstanceName(projectId, instanceId)) .setBackup( NameUtil.formatBackupName( - projectId, + sourceProjectId == null ? projectId : sourceProjectId, sourceInstanceId == null ? instanceId : sourceInstanceId, sourceClusterId, sourceBackupId)) 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..6ace603e46 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/SubsetView.java @@ -0,0 +1,123 @@ +/* + * 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 + 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..31aa612f18 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 @@ -25,6 +25,7 @@ import java.util.Map; import java.util.Map.Entry; import javax.annotation.Nonnull; +import org.threeten.bp.Duration; /** Wrapper for {@link Table} protocol buffer object */ public final class Table { @@ -103,6 +104,8 @@ public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState toProto( private final Map replicationStatesByClusterId; private final List columnFamilies; + private final Duration changeStreamRetention; + @InternalApi public static Table fromProto(@Nonnull com.google.bigtable.admin.v2.Table proto) { ImmutableMap.Builder replicationStates = ImmutableMap.builder(); @@ -120,18 +123,31 @@ 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()); + } + return new Table( - TableName.parse(proto.getName()), replicationStates.build(), columnFamilies.build()); + TableName.parse(proto.getName()), + replicationStates.build(), + columnFamilies.build(), + changeStreamConfig); } private Table( TableName tableName, Map replicationStatesByClusterId, - List columnFamilies) { + List columnFamilies, + Duration changeStreamRetention) { this.instanceId = tableName.getInstance(); this.id = tableName.getTable(); this.replicationStatesByClusterId = replicationStatesByClusterId; this.columnFamilies = columnFamilies; + this.changeStreamRetention = changeStreamRetention; } /** Gets the table's id. */ @@ -152,6 +168,10 @@ public List getColumnFamilies() { return columnFamilies; } + public Duration getChangeStreamRetention() { + return changeStreamRetention; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -164,11 +184,13 @@ 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); } @Override public int hashCode() { - return Objects.hashCode(id, instanceId, replicationStatesByClusterId, columnFamilies); + return Objects.hashCode( + id, instanceId, replicationStatesByClusterId, columnFamilies, changeStreamRetention); } } 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..99f7f98c79 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/Type.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 +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(); + } + 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(); + } + 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/UpdateAppProfileRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java index 49d4c5d702..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); 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/UpdateTableRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java new file mode 100644 index 0000000000..034736aa56 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequest.java @@ -0,0 +1,98 @@ +/* + * 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(); + + 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); + } + + @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; + return Objects.equals(requestBuilder, that.requestBuilder); + } + + @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..7cdcb66599 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/AwaitConsistencyCallable.java @@ -0,0 +1,195 @@ +/* + * 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.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.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) { + 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 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(); + } + } +} 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..2cb8549f5d 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,25 @@ *

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; + private final AwaitConsistencyCallable awaitConsistencyCallable; - static AwaitReplicationCallable create( - UnaryCallable - generateCallable, - UnaryCallable checkCallable, - ClientContext clientContext, - RetrySettings pollingSettings) { + static AwaitReplicationCallable create(AwaitConsistencyCallable awaitConsistencyCallable) { - RetryAlgorithm retryAlgorithm = - new RetryAlgorithm<>( - new PollResultAlgorithm(), - new ExponentialPollAlgorithm(pollingSettings, clientContext.getClock())); - - 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); - } + ConsistencyRequest consistencyRequest = ConsistencyRequest.forReplication(tableName.getTable()); - 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 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; - } + return awaitConsistencyCallable.futureCall(consistencyRequest, context); } - /** - * 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 88d457643a..7b066da10d 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 2021 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. @@ -17,6 +17,7 @@ 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 com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -40,6 +41,8 @@ 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.PartialUpdateClusterMetadata; @@ -187,6 +190,15 @@ 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()"); + } + @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 865bdf8db6..d9ada0ebff 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 2021 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. @@ -17,10 +17,11 @@ 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 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; @@ -57,11 +58,14 @@ 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.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.PartialUpdateClusterMetadata; @@ -102,9 +106,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
@@ -114,11 +125,48 @@
  *             .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://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) 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)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * baseBigtableInstanceAdminSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class BigtableInstanceAdminStubSettings @@ -175,6 +223,9 @@ public class BigtableInstanceAdminStubSettings private final UnaryCallSettings setIamPolicySettings; private final UnaryCallSettings testIamPermissionsSettings; + private final PagedCallSettings< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings; private static final PagedListDescriptor< ListAppProfilesRequest, ListAppProfilesResponse, AppProfile> @@ -209,9 +260,42 @@ 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(); } }; @@ -232,6 +316,23 @@ 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); + } + }; + /** Returns the object with the settings used for calls to createInstance. */ public UnaryCallSettings createInstanceSettings() { return createInstanceSettings; @@ -372,7 +473,13 @@ 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; + } + public BigtableInstanceAdminStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -384,12 +491,19 @@ 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"; } @@ -421,7 +535,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( @@ -476,6 +589,7 @@ protected BigtableInstanceAdminStubSettings(Builder settingsBuilder) throws IOEx getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + listHotTabletsSettings = settingsBuilder.listHotTabletsSettings().build(); } /** Builder for BigtableInstanceAdminStubSettings. */ @@ -530,6 +644,9 @@ public static class Builder private final UnaryCallSettings.Builder setIamPolicySettings; private final UnaryCallSettings.Builder testIamPermissionsSettings; + private final PagedCallSettings.Builder< + ListHotTabletsRequest, ListHotTabletsResponse, ListHotTabletsPagedResponse> + listHotTabletsSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -537,14 +654,15 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "no_retry_5_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_4_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_6_codes", + "retry_policy_5_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); definitions.put( - "no_retry_7_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_6_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -560,7 +678,7 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(300000L)) .setTotalTimeout(Duration.ofMillis(300000L)) .build(); - definitions.put("no_retry_5_params", settings); + definitions.put("no_retry_4_params", settings); settings = RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(1000L)) @@ -571,7 +689,7 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_6_params", settings); + definitions.put("retry_policy_5_params", settings); settings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(60000L)) @@ -579,7 +697,9 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("no_retry_7_params", settings); + definitions.put("no_retry_6_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -616,6 +736,7 @@ protected Builder(ClientContext clientContext) { getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listHotTabletsSettings = PagedCallSettings.newBuilder(LIST_HOT_TABLETS_PAGE_STR_FACT); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -638,7 +759,8 @@ protected Builder(ClientContext clientContext) { deleteAppProfileSettings, getIamPolicySettings, setIamPolicySettings, - testIamPermissionsSettings); + testIamPermissionsSettings, + listHotTabletsSettings); initDefaults(this); } @@ -673,6 +795,7 @@ protected Builder(BigtableInstanceAdminStubSettings settings) { getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + listHotTabletsSettings = settings.listHotTabletsSettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( @@ -695,7 +818,8 @@ protected Builder(BigtableInstanceAdminStubSettings settings) { deleteAppProfileSettings, getIamPolicySettings, setIamPolicySettings, - testIamPermissionsSettings); + testIamPermissionsSettings, + listHotTabletsSettings); } private static Builder createDefault() { @@ -704,7 +828,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -714,111 +837,116 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder .createInstanceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); builder .getInstanceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .listInstancesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .updateInstanceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .partialUpdateInstanceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .deleteInstanceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .createClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .getClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .listClustersSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .updateClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .partialUpdateClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .deleteClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .createAppProfileSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .getAppProfileSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .listAppProfilesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .updateAppProfileSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .deleteAppProfileSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .getIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .setIamPolicySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); builder .testIamPermissionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + builder + .listHotTabletsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); builder .createInstanceOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) @@ -841,8 +969,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) @@ -865,8 +993,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_7_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_7_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -888,8 +1016,8 @@ private static Builder initDefaults(Builder builder) { .updateClusterOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -912,8 +1040,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) @@ -937,8 +1065,8 @@ private static Builder initDefaults(Builder builder) { .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_6_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_6_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(AppProfile.class)) @@ -980,8 +1108,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; @@ -1010,8 +1136,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() { @@ -1029,8 +1153,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; @@ -1053,8 +1175,6 @@ 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; @@ -1067,8 +1187,6 @@ public UnaryCallSettings.Builder updateClusterSettings() { } /** Returns the builder for the settings used for calls to partialUpdateCluster. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings.Builder< PartialUpdateClusterRequest, Cluster, PartialUpdateClusterMetadata> partialUpdateClusterOperationSettings() { @@ -1105,8 +1223,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() { @@ -1134,6 +1250,13 @@ 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; + } + @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 a99bf13824..df3bf12094 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 2021 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. @@ -16,6 +16,7 @@ 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.ListSnapshotsPagedResponse; import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; @@ -24,23 +25,32 @@ 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.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.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.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.ListSnapshotsRequest; @@ -54,7 +64,13 @@ 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.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; @@ -102,10 +118,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 +262,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()"); } 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 9a342b066f..0d796b941e 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 2021 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. @@ -16,13 +16,14 @@ 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.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; @@ -46,23 +47,32 @@ 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.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.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.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.ListSnapshotsRequest; @@ -76,7 +86,13 @@ 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.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; @@ -108,9 +124,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,11 +143,48 @@
  *             .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://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) 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)
+ *             .setMaxRetryDelay(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * baseBigtableTableAdminSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
*/ @Generated("by gapic-generator-java") public class BigtableTableAdminStubSettings extends StubSettings { @@ -148,7 +208,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,6 +256,9 @@ 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 @@ -209,9 +294,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 +366,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 +400,7 @@ public String extractNextToken(ListBackupsResponse payload) { @Override public Iterable extractResources(ListBackupsResponse payload) { - return payload.getBackupsList() == null - ? ImmutableList.of() - : payload.getBackupsList(); + return payload.getBackupsList(); } }; @@ -304,6 +421,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 = @@ -367,11 +505,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 +665,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 +692,6 @@ public UnaryCallSettings setIamPolicySettings() { return testIamPermissionsSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public BigtableTableAdminStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -492,12 +703,19 @@ 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"; } @@ -529,7 +747,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( @@ -562,7 +779,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(); @@ -580,6 +810,8 @@ 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(); @@ -599,7 +831,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; @@ -629,6 +886,9 @@ 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 @@ -648,14 +908,9 @@ public static class Builder 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())); + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_3_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -685,14 +940,6 @@ public static class Builder .setTotalTimeout(Duration.ofMillis(60000L)) .build(); definitions.put("retry_policy_2_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(60000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(60000L)) - .setTotalTimeout(Duration.ofMillis(60000L)) - .build(); - definitions.put("no_retry_1_params", settings); settings = RetrySettings.newBuilder() .setInitialRpcTimeout(Duration.ofMillis(3600000L)) @@ -700,18 +947,15 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(3600000L)) .setTotalTimeout(Duration.ofMillis(3600000L)) .build(); - definitions.put("no_retry_4_params", settings); + definitions.put("no_retry_3_params", settings); settings = RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(1000L)) - .setRetryDelayMultiplier(2.0) - .setMaxRetryDelay(Duration.ofMillis(60000L)) .setInitialRpcTimeout(Duration.ofMillis(60000L)) .setRpcTimeoutMultiplier(1.0) .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_3_params", settings); + definitions.put("no_retry_1_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -727,7 +971,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(); @@ -745,6 +1001,8 @@ 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(); @@ -755,7 +1013,14 @@ protected Builder(ClientContext clientContext) { createTableFromSnapshotSettings, listTablesSettings, getTableSettings, + updateTableSettings, deleteTableSettings, + undeleteTableSettings, + createAuthorizedViewSettings, + listAuthorizedViewsSettings, + getAuthorizedViewSettings, + updateAuthorizedViewSettings, + deleteAuthorizedViewSettings, modifyColumnFamiliesSettings, dropRowRangeSettings, generateConsistencyTokenSettings, @@ -770,6 +1035,7 @@ protected Builder(ClientContext clientContext) { deleteBackupSettings, listBackupsSettings, restoreTableSettings, + copyBackupSettings, getIamPolicySettings, setIamPolicySettings, testIamPermissionsSettings); @@ -785,7 +1051,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(); @@ -803,6 +1082,8 @@ 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(); @@ -813,7 +1094,14 @@ protected Builder(BigtableTableAdminStubSettings settings) { createTableFromSnapshotSettings, listTablesSettings, getTableSettings, + updateTableSettings, deleteTableSettings, + undeleteTableSettings, + createAuthorizedViewSettings, + listAuthorizedViewsSettings, + getAuthorizedViewSettings, + updateAuthorizedViewSettings, + deleteAuthorizedViewSettings, modifyColumnFamiliesSettings, dropRowRangeSettings, generateConsistencyTokenSettings, @@ -828,6 +1116,7 @@ protected Builder(BigtableTableAdminStubSettings settings) { deleteBackupSettings, listBackupsSettings, restoreTableSettings, + copyBackupSettings, getIamPolicySettings, setIamPolicySettings, testIamPermissionsSettings); @@ -839,7 +1128,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -867,10 +1155,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() @@ -879,18 +1202,18 @@ private static Builder initDefaults(Builder builder) { builder .dropRowRangeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); 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() - .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 .snapshotTableSettings() @@ -904,13 +1227,13 @@ 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() @@ -929,8 +1252,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() @@ -942,10 +1265,15 @@ private static Builder initDefaults(Builder builder) { .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() @@ -954,8 +1282,8 @@ 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 .createTableFromSnapshotOperationSettings() @@ -982,6 +1310,103 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(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() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(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() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(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() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(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() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + builder .snapshotTableOperationSettings() .setInitialCallSettings( @@ -1054,6 +1479,29 @@ private static Builder initDefaults(Builder builder) { .setTotalTimeout(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() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + return builder; } @@ -1084,8 +1532,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() { @@ -1103,11 +1549,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() { @@ -1138,8 +1653,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; @@ -1168,8 +1681,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; @@ -1203,13 +1714,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; 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..1cb80e0c49 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,42 @@ public class EnhancedBigtableTableAdminStub extends GrpcBigtableTableAdminStub { private final BigtableTableAdminStubSettings settings; private final ClientContext clientContext; + private final TableAdminRequestContext requestContext; + 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(); } private AwaitReplicationCallable createAwaitReplicationCallable() { + return AwaitReplicationCallable.create(awaitConsistencyCallable); + } + + private AwaitConsistencyCallable createAwaitConsistencyCallable() { // TODO(igorbernstein2): expose polling settings RetrySettings pollingSettings = RetrySettings.newBuilder() @@ -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 @@ -194,6 +212,10 @@ 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 e08d1a6a6a..b76b0933ca 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 2021 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. 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 feba805623..76d82e57ea 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 2021 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. @@ -17,6 +17,7 @@ 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 com.google.api.core.InternalApi; import com.google.api.gax.core.BackgroundResource; @@ -25,6 +26,7 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; import com.google.bigtable.admin.v2.AppProfile; import com.google.bigtable.admin.v2.Cluster; @@ -44,6 +46,8 @@ 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.PartialUpdateClusterMetadata; @@ -53,7 +57,6 @@ 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.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -265,6 +268,17 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) .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())) + .build(); + private final UnaryCallable createInstanceCallable; private final OperationCallable createInstanceOperationCallable; @@ -303,6 +317,9 @@ public class GrpcBigtableInstanceAdminStub extends BigtableInstanceAdminStub { private final UnaryCallable setIamPolicyCallable; private final UnaryCallable testIamPermissionsCallable; + private final UnaryCallable listHotTabletsCallable; + private final UnaryCallable + listHotTabletsPagedCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -353,9 +370,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(createInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getInstanceTransportSettings = @@ -363,9 +380,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(getInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listInstancesTransportSettings = @@ -373,9 +390,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(listInstancesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateInstanceTransportSettings = @@ -383,9 +400,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(updateInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -394,9 +411,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(partialUpdateInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("instance.name", String.valueOf(request.getInstance().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance.name", String.valueOf(request.getInstance().getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteInstanceTransportSettings = @@ -404,9 +421,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(deleteInstanceMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings createClusterTransportSettings = @@ -414,9 +431,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(createClusterMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getClusterTransportSettings = @@ -424,9 +441,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(getClusterMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listClustersTransportSettings = @@ -434,9 +451,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(listClustersMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateClusterTransportSettings = @@ -444,9 +461,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(updateClusterMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings partialUpdateClusterTransportSettings = @@ -454,9 +471,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(partialUpdateClusterMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("cluster.name", String.valueOf(request.getCluster().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("cluster.name", String.valueOf(request.getCluster().getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteClusterTransportSettings = @@ -464,9 +481,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(deleteClusterMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings createAppProfileTransportSettings = @@ -474,9 +491,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(createAppProfileMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getAppProfileTransportSettings = @@ -484,9 +501,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(getAppProfileMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -495,9 +512,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(listAppProfilesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings updateAppProfileTransportSettings = @@ -505,9 +522,10 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(updateAppProfileMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("app_profile.name", String.valueOf(request.getAppProfile().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "app_profile.name", String.valueOf(request.getAppProfile().getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteAppProfileTransportSettings = @@ -515,9 +533,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(deleteAppProfileMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings getIamPolicyTransportSettings = @@ -525,9 +543,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings setIamPolicyTransportSettings = @@ -535,9 +553,9 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings @@ -546,9 +564,20 @@ protected GrpcBigtableInstanceAdminStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + 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(); @@ -657,6 +686,12 @@ protected GrpcBigtableInstanceAdminStub( testIamPermissionsTransportSettings, settings.testIamPermissionsSettings(), clientContext); + this.listHotTabletsCallable = + callableFactory.createUnaryCallable( + listHotTabletsTransportSettings, settings.listHotTabletsSettings(), clientContext); + this.listHotTabletsPagedCallable = + callableFactory.createPagedCallable( + listHotTabletsTransportSettings, settings.listHotTabletsSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -809,6 +844,17 @@ public UnaryCallable setIamPolicyCallable() { return testIamPermissionsCallable; } + @Override + public UnaryCallable listHotTabletsCallable() { + return listHotTabletsCallable; + } + + @Override + public UnaryCallable + listHotTabletsPagedCallable() { + return listHotTabletsPagedCallable; + } + @Override public final void close() { try { 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 b0b24e52f9..70559ba873 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 2021 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. 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 3b1f248264..82319941ee 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 2021 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. @@ -16,6 +16,7 @@ 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.ListSnapshotsPagedResponse; import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; @@ -27,24 +28,34 @@ import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.admin.v2.AuthorizedView; import com.google.bigtable.admin.v2.Backup; import com.google.bigtable.admin.v2.CheckConsistencyRequest; import com.google.bigtable.admin.v2.CheckConsistencyResponse; +import com.google.bigtable.admin.v2.CopyBackupMetadata; +import com.google.bigtable.admin.v2.CopyBackupRequest; +import com.google.bigtable.admin.v2.CreateAuthorizedViewMetadata; +import com.google.bigtable.admin.v2.CreateAuthorizedViewRequest; import com.google.bigtable.admin.v2.CreateBackupMetadata; import com.google.bigtable.admin.v2.CreateBackupRequest; import com.google.bigtable.admin.v2.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.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.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.ListSnapshotsRequest; @@ -58,8 +69,13 @@ 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.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; @@ -115,6 +131,14 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Table.getDefaultInstance())) .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())) + .build(); + private static final MethodDescriptor deleteTableMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -123,6 +147,67 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .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())) + .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())) + .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())) + .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())) + .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())) + .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())) + .build(); + private static final MethodDescriptor modifyColumnFamiliesMethodDescriptor = MethodDescriptor.newBuilder() @@ -257,6 +342,14 @@ public class GrpcBigtableTableAdminStub extends BigtableTableAdminStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .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())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -293,7 +386,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 @@ -320,6 +433,9 @@ 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 @@ -374,9 +490,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(createTableMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings @@ -385,9 +501,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(createTableFromSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings listTablesTransportSettings = @@ -395,9 +511,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(listTablesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getTableTransportSettings = @@ -405,9 +521,19 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(getTableMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + 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 = @@ -415,9 +541,72 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(deleteTableMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + 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 = @@ -425,9 +614,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(modifyColumnFamiliesMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings dropRowRangeTransportSettings = @@ -435,9 +624,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(dropRowRangeMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -447,9 +636,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(generateConsistencyTokenMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings @@ -458,9 +647,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(checkConsistencyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings snapshotTableTransportSettings = @@ -468,9 +657,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(snapshotTableMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings getSnapshotTransportSettings = @@ -478,9 +667,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(getSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listSnapshotsTransportSettings = @@ -488,9 +677,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(listSnapshotsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings deleteSnapshotTransportSettings = @@ -498,9 +687,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(deleteSnapshotMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings createBackupTransportSettings = @@ -508,9 +697,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(createBackupMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings getBackupTransportSettings = @@ -518,9 +707,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(getBackupMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings updateBackupTransportSettings = @@ -528,9 +717,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(updateBackupMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("backup.name", String.valueOf(request.getBackup().getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("backup.name", String.valueOf(request.getBackup().getName())); + return builder.build(); }) .build(); GrpcCallSettings deleteBackupTransportSettings = @@ -538,9 +727,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(deleteBackupMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); }) .build(); GrpcCallSettings listBackupsTransportSettings = @@ -548,9 +737,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(listBackupsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); }) .build(); GrpcCallSettings restoreTableTransportSettings = @@ -558,9 +747,19 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(restoreTableMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); + 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 = @@ -568,9 +767,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(getIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings setIamPolicyTransportSettings = @@ -578,9 +777,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(setIamPolicyMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); GrpcCallSettings @@ -589,9 +788,9 @@ protected GrpcBigtableTableAdminStub( .setMethodDescriptor(testIamPermissionsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("resource", String.valueOf(request.getResource())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); }) .build(); @@ -618,9 +817,69 @@ protected GrpcBigtableTableAdminStub( 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, @@ -691,6 +950,15 @@ protected GrpcBigtableTableAdminStub( 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); @@ -743,11 +1011,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; @@ -849,6 +1185,17 @@ public UnaryCallable restoreTableCallable() { return restoreTableOperationCallable; } + @Override + public UnaryCallable copyBackupCallable() { + return copyBackupCallable; + } + + @Override + public OperationCallable + copyBackupOperationCallable() { + return copyBackupOperationCallable; + } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; 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 index 83f7c188d4..d0ca6fd127 100644 --- 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 @@ -16,6 +16,7 @@ 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 @@ -23,7 +24,9 @@ * *

This primarily wraps the protobuf {@link com.google.rpc.Status}. */ -public final class 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), 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..df5c6dcd95 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/common/Type.java @@ -0,0 +1,398 @@ +/* + * 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.collect.ImmutableList; +import com.google.protobuf.ByteString; +import java.util.List; +import org.threeten.bp.Instant; + +/** + * 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 +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 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 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 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 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 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 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 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 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 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 + 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 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 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 java.lang.String toString() { + return getCode().name() + + "{keyType=" + + getKeyType().toString() + + ", valueType=" + + getValueType().toString() + + "}"; + } + } + + // 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 ce9a57fa7e..61f51924f1 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 @@ -25,22 +25,33 @@ 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.ClientContext; 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.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.ResultSet; +import com.google.cloud.bigtable.data.v2.models.sql.Statement; 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; @@ -163,6 +174,18 @@ public static BigtableDataClient create(BigtableDataSettings settings) throws IO return new BigtableDataClient(stub); } + /** + * Constructs an instance of BigtableDataClient with the provided client context. This is used by + * {@link BigtableDataClientFactory} and the client context will not be closed unless {@link + * BigtableDataClientFactory#close()} is called. + */ + static BigtableDataClient createWithClientContext( + BigtableDataSettings settings, ClientContext context) throws IOException { + EnhancedBigtableStub stub = + EnhancedBigtableStub.createWithClientContext(settings.getStubSettings(), context); + return new BigtableDataClient(stub); + } + @InternalApi("Visible for testing") BigtableDataClient(EnhancedBigtableStub stub) { this.stub = stub; @@ -190,7 +213,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)); } @@ -217,11 +242,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. * @@ -246,7 +331,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)); } @@ -275,10 +363,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 @@ -322,7 +477,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)); } @@ -352,7 +509,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)); @@ -388,7 +547,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)); @@ -424,11 +585,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. @@ -457,7 +761,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); } @@ -490,7 +797,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); } @@ -528,7 +838,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); } @@ -566,17 +880,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: * @@ -584,24 +899,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"); @@ -609,26 +909,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: * @@ -636,9 +935,183 @@ 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")); + * + * 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));
@@ -862,11 +1335,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 @@ -892,9 +1395,48 @@ 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)); + } + + /** + * 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)); } /** @@ -933,11 +1475,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}. @@ -1071,8 +1664,10 @@ 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 newBulkMutationBatcher(tableId, null); } @@ -1103,7 +1698,11 @@ public Batcher newBulkMutationBatcher(@Nonnull String ta * // Before `batcher` is closed, all remaining(If any) mutations are applied. * } * } + * + * @deprecated Please use {@link BigtableDataClient#newBulkMutationBatcher(TargetId, + * GrpcCallContext)} instead. */ + @Deprecated @BetaApi("This surface is likely to change as the batching surface evolves.") public Batcher newBulkMutationBatcher( @Nonnull String tableId, @Nullable GrpcCallContext ctx) { @@ -1111,25 +1710,97 @@ public Batcher newBulkMutationBatcher( } /** - * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. The - * returned Batcher instance is not threadsafe, it can only be used from a single thread. + * Mutates multiple rows in a batch on the specified {@link TargetId}. * - *

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. + *

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]")) {
-   *   List> rows = new ArrayList<>();
-   *
-   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher("[TABLE]")) {
+   *   try (Batcher batcher = bigtableDataClient.newBulkMutationBatcher(TableId.of("[TABLE]"))) {
    *     for (String someValue : someCollection) {
-   *       ApiFuture rowFuture =
-   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
-   *       rows.add(rowFuture);
+   *       ApiFuture entryFuture =
+   *           batcher.add(
+   *               RowMutationEntry.create("[ROW KEY]")
+   *                   .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *     }
+   *
+   *     // Blocks until mutations are applied on all submitted row entries.
+   *     batcher.flush();
+   *   }
+   *   // Before `batcher` is closed, all remaining(If any) mutations are applied.
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + @BetaApi("This surface is likely to change as the batching surface evolves.") + public Batcher newBulkMutationBatcher(TargetId targetId) { + return newBulkMutationBatcher(targetId, null); + } + + /** + * Mutates multiple rows in a batch on the specified {@link TargetId}. + * + *

Each individual row is mutated atomically as in MutateRow, but the entire batch is not + * executed atomically. The returned Batcher instance is not threadsafe, it can only be used from + * single thread. This method allows customization of the underlying RPCs by passing in a {@link + * com.google.api.gax.grpc.GrpcCallContext}. The same context will be reused for all batches. This + * can be used to customize things like per attempt timeouts. + * + *

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   GrpcCallContext ctx = GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10));
+   *   try (Batcher batcher = bigtableDataClient.newBulkMutationBatcher(TableId.of("[TABLE]"), ctx)) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture entryFuture =
+   *           batcher.add(
+   *               RowMutationEntry.create("[ROW KEY]")
+   *                   .setCell("[FAMILY NAME]", "[QUALIFIER]", "[VALUE]"));
+   *     }
+   *
+   *     // Blocks until mutations are applied on all submitted row entries.
+   *     batcher.flush();
+   *   }
+   *   // Before `batcher` is closed, all remaining(If any) mutations are applied.
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + @BetaApi("This surface is likely to change as the batching surface evolves.") + public Batcher newBulkMutationBatcher( + TargetId targetId, @Nullable GrpcCallContext ctx) { + return stub.newMutateRowsBatcher(targetId, ctx); + } + + /** + * Reads rows for given tableId in a batch. If the row does not exist, the value will be null. The + * returned Batcher instance is not threadsafe, it can only be used from a single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher("[TABLE]")) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
    *     }
    *
    *     // [Optional] Sends collected elements for batching asynchronously.
@@ -1144,7 +1815,10 @@ public Batcher newBulkMutationBatcher(
    *   List actualRows = ApiFutures.allAsList(rows).get();
    * }
    * }
+ * + * @deprecated Please use {@link BigtableDataClient#newBulkReadRowsBatcher(TargetId)} instead. */ + @Deprecated public Batcher newBulkReadRowsBatcher(String tableId) { return newBulkReadRowsBatcher(tableId, null); } @@ -1190,7 +1864,11 @@ public Batcher newBulkReadRowsBatcher(String tableId) { * 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); @@ -1240,12 +1918,167 @@ public Batcher newBulkReadRowsBatcher( * 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) { - Query query = Query.create(tableId); + return newBulkReadRowsBatcher(TableId.of(tableId), filter, ctx); + } + + /** + * Reads rows for given tableId in a batch on the specified {@link TargetId}. + * + *

If the row does not exist, the value will be null. The returned Batcher instance is not + * threadsafe, it can only be used from a single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(TableId.of("[TABLE]"))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Batcher newBulkReadRowsBatcher(TargetId targetId) { + return newBulkReadRowsBatcher(targetId, null); + } + + /** + * Reads rows for given tableId and filter criteria in a batch on the specified {@link TargetId}. + * + *

If the row does not exist, the value will be null. The returned Batcher instance is not + * threadsafe, it can only be used from a single thread. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.key().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(TableId.of("[TABLE]"), filter)) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Batcher newBulkReadRowsBatcher( + TargetId targetId, @Nullable Filter filter) { + return newBulkReadRowsBatcher(targetId, filter, null); + } + + /** + * Reads rows for given tableId and filter criteria in a batch on the specified {@link TargetId}. + * + *

If the row does not exist, the value will be null. The returned Batcher instance is not + * threadsafe, it can only be used from a single thread. This method allows customization of the + * underlying RPCs by passing in a {@link com.google.api.gax.grpc.GrpcCallContext}. The same + * context will be reused for all batches. This can be used to customize things like per attempt + * timeouts. + * + *

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

Sample Code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *
+   *  // Build the filter expression
+   *  Filter filter = FILTERS.chain()
+   *         .filter(FILTERS.key().regex("prefix.*"))
+   *         .filter(FILTERS.limit().cellsPerRow(10));
+   *
+   *   List> rows = new ArrayList<>();
+   *
+   *   try (Batcher batcher = bigtableDataClient.newBulkReadRowsBatcher(
+   *    TableId.of("[TABLE]"), filter, GrpcCallContext.createDefault().withTimeout(Duration.ofSeconds(10)))) {
+   *     for (String someValue : someCollection) {
+   *       ApiFuture rowFuture =
+   *           batcher.add(ByteString.copyFromUtf8("[ROW KEY]"));
+   *       rows.add(rowFuture);
+   *     }
+   *
+   *     // [Optional] Sends collected elements for batching asynchronously.
+   *     batcher.sendOutstanding();
+   *
+   *     // [Optional] Invokes sendOutstanding() and awaits until all pending entries are resolved.
+   *     batcher.flush();
+   *   }
+   *   // batcher.close() invokes `flush()` which will in turn invoke `sendOutstanding()` with await for
+   *   pending batches until its resolved.
+   *
+   *   List actualRows = ApiFutures.allAsList(rows).get();
+   * }
+   * }
+ * + * @see com.google.cloud.bigtable.data.v2.models.AuthorizedViewId + * @see TableId + */ + public Batcher newBulkReadRowsBatcher( + TargetId targetId, @Nullable Filter filter, @Nullable GrpcCallContext ctx) { + Query query = Query.create(targetId); if (filter != null) { - query.filter(filter); + query = query.filter(filter); } return stub.newBulkReadRowsBatcher(query, ctx); } @@ -1489,6 +2322,326 @@ 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. + * + *

Sample code: + * + *

{@code
+   * try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
+   *   String query = "SELECT CAST(cf['stringCol'] AS STRING) FROM [TABLE]";
+   *
+   *   try (ResultSet resultSet = bigtableDataClient.executeQuery(Statement.of(query))) {
+   *     while (resultSet.next()) {
+   *        String s = resultSet.getString("stringCol");
+   *        // do something with data
+   *     }
+   *   } catch (RuntimeException e) {
+   *     e.printStackTrace();
+   *   }
+   * }
+ * + * @see Statement For query options. + */ + @BetaApi + public ResultSet executeQuery(Statement statement) { + SqlServerStream stream = stub.createExecuteQueryCallable().call(statement); + return ResultSetImpl.create(stream); + } + /** 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..34ec77bdfc 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 @@ -17,14 +17,12 @@ 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.stub.EnhancedBigtableStub; +import io.opentelemetry.api.OpenTelemetry; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.annotation.Nonnull; /** @@ -67,8 +65,12 @@ */ @BetaApi("This feature is currently experimental and can change in the future") public final class BigtableDataClientFactory implements AutoCloseable { + + private static final Logger logger = Logger.getLogger(BigtableDataClientFactory.class.getName()); + private final BigtableDataSettings defaultSettings; private final ClientContext sharedClientContext; + private final OpenTelemetry openTelemetry; /** * Create a instance of this factory. @@ -78,14 +80,31 @@ 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); + ClientContext sharedClientContext = + EnhancedBigtableStub.createClientContext(defaultSettings.getStubSettings()); + OpenTelemetry openTelemetry = null; + try { + // We don't want client side metrics to crash the client, so catch any exception when getting + // the OTEL instance and log the exception instead. + openTelemetry = + EnhancedBigtableStub.getOpenTelemetry( + defaultSettings.getProjectId(), + defaultSettings.getMetricsProvider(), + sharedClientContext.getCredentials(), + defaultSettings.getStubSettings().getMetricsEndpoint()); + } catch (Throwable t) { + logger.log(Level.WARNING, "Failed to get OTEL, will skip exporting client side metrics", t); + } + return new BigtableDataClientFactory(sharedClientContext, defaultSettings, openTelemetry); } private BigtableDataClientFactory( - ClientContext sharedClientContext, BigtableDataSettings defaultSettings) { + ClientContext sharedClientContext, + BigtableDataSettings defaultSettings, + OpenTelemetry openTelemetry) { this.sharedClientContext = sharedClientContext; this.defaultSettings = defaultSettings; + this.openTelemetry = openTelemetry; } /** @@ -110,12 +129,16 @@ 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); + ClientContext clientContext = + sharedClientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + defaultSettings.getStubSettings(), openTelemetry)) + .build(); + + return BigtableDataClient.createWithClientContext(defaultSettings, clientContext); } catch (IOException e) { // Should never happen because the connection has been established already throw new RuntimeException( @@ -133,12 +156,17 @@ 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()); + BigtableDataSettings settings = + defaultSettings.toBuilder().setAppProfileId(appProfileId).build(); - return BigtableDataClient.create(settingsBuilder.build()); + ClientContext clientContext = + sharedClientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + settings.getStubSettings(), openTelemetry)) + .build(); + return BigtableDataClient.createWithClientContext(settings, clientContext); } /** @@ -152,16 +180,23 @@ public BigtableDataClient createForAppProfile(@Nonnull String appProfileId) thro */ public BigtableDataClient createForInstance(@Nonnull String projectId, @Nonnull String instanceId) throws IOException { - BigtableDataSettings.Builder settingsBuilder = + BigtableDataSettings settings = defaultSettings .toBuilder() .setProjectId(projectId) .setInstanceId(instanceId) - .setDefaultAppProfileId(); + .setDefaultAppProfileId() + .build(); - patchStubSettings(settingsBuilder.stubSettings()); + ClientContext clientContext = + sharedClientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + settings.getStubSettings(), openTelemetry)) + .build(); - return BigtableDataClient.create(settingsBuilder.build()); + return BigtableDataClient.createWithClientContext(settings, clientContext); } /** @@ -176,32 +211,20 @@ public BigtableDataClient createForInstance(@Nonnull String projectId, @Nonnull public BigtableDataClient createForInstance( @Nonnull String projectId, @Nonnull String instanceId, @Nonnull String appProfileId) throws IOException { - BigtableDataSettings.Builder settingsBuilder = + BigtableDataSettings settings = defaultSettings .toBuilder() .setProjectId(projectId) .setInstanceId(instanceId) - .setAppProfileId(appProfileId); - - patchStubSettings(settingsBuilder.stubSettings()); - - return BigtableDataClient.create(settingsBuilder.build()); - } - - // 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()); + .setAppProfileId(appProfileId) + .build(); + ClientContext clientContext = + sharedClientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + settings.getStubSettings(), openTelemetry)) + .build(); + return BigtableDataClient.createWithClientContext(settings, clientContext); } } 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 edde257527..928159aa6d 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,21 +15,25 @@ */ 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.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; @@ -70,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; @@ -117,17 +125,13 @@ public static Builder newBuilderForEmulator(String hostname, int port) { .stubSettings() .setCredentialsProvider(NoCredentialsProvider.create()) .setEndpoint(hostname + ":" + port) + // disable channel refreshing when creating an emulator + .setRefreshingChannel(false) .setTransportChannelProvider( InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(256 * 1024 * 1024) - .setPoolSize(1) - .setChannelConfigurator( - new ApiFunction() { - @Override - public ManagedChannelBuilder apply(ManagedChannelBuilder input) { - return input.usePlaintext(); - } - }) + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(1)) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) .setKeepAliveTime(Duration.ofSeconds(61)) // sends ping in this interval .setKeepAliveTimeout( Duration.ofSeconds(10)) // wait this long before considering the connection dead @@ -193,6 +197,36 @@ 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(); @@ -208,17 +242,21 @@ 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(); } @@ -242,6 +280,20 @@ 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(); + } + /** Returns the underlying RPC settings. */ public EnhancedBigtableStubSettings getStubSettings() { return stubSettings; @@ -359,41 +411,44 @@ 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(); } @@ -466,6 +521,52 @@ 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(); + } + /** * 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..1134631db2 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,24 @@ "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"] + }, + "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..dff4d4e0b2 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReader.java @@ -0,0 +1,339 @@ +/* + * 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.ByteString; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.threeten.bp.Instant; + +@InternalApi +public abstract class AbstractProtoStructReader implements StructReader { + + abstract List values(); + + // Force subclasses to override equals and hashcode. We need this for tests. + public abstract boolean equals(Object other); + + 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 toInstant(value.getTimestampValue()); + } + + @Override + public Instant getTimestamp(String columnName) { + int columnIndex = getColumnIndex(columnName); + checkNonNullOfType(columnIndex, SqlType.timestamp(), columnName); + Value value = values().get(columnIndex); + return 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); + 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); + 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); + 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); + return (Map) 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 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 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 Instant toInstant(Timestamp timestamp) { + return Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos()); + } + + 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/NameUtil.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/NameUtil.java index 4744d3ef1e..68c66067b1 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,9 @@ 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.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 +33,8 @@ 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/([^/]+)"); public static String formatInstanceName(@Nonnull String projectId, @Nonnull String instanceId) { return "projects/" + projectId + "/instances/" + instanceId; @@ -40,6 +45,14 @@ public static String formatTableName( return formatInstanceName(projectId, instanceId) + "/tables/" + tableId; } + 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 extractTableIdFromTableName(@Nonnull String fullTableName) { Matcher matcher = TABLE_PATTERN.matcher(fullTableName); if (!matcher.matches()) { @@ -47,4 +60,59 @@ 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); + } + + /** A helper to convert fully qualified tableName and authorizedViewName to a {@link TargetId} */ + public static TargetId extractTargetId( + @Nonnull String tableName, @Nonnull String authorizedViewName) { + if (tableName.isEmpty() && authorizedViewName.isEmpty()) { + throw new IllegalArgumentException( + "Either table name or authorized view name must be specified. Table name: " + + tableName + + ", authorized view name: " + + authorizedViewName); + } + if (!tableName.isEmpty() && !authorizedViewName.isEmpty()) { + throw new IllegalArgumentException( + "Table name and authorized view name cannot be specified at the same time. Table name: " + + tableName + + ", authorized view name: " + + authorizedViewName); + } + + if (!tableName.isEmpty()) { + String tableId = extractTableIdFromTableName(tableName); + return TableId.of(tableId); + } else { + String tableId = extractTableIdFromAuthorizedViewName(authorizedViewName); + String authorizedViewId = extractAuthorizedViewIdFromAuthorizedViewName(authorizedViewName); + return AuthorizedViewId.of(tableId, authorizedViewId); + } + } } 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..36bbdf5008 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ProtoResultSetMetadata.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.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.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; + } +} 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/ResultSetImpl.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java new file mode 100644 index 0000000000..1d2bd37f2d --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImpl.java @@ -0,0 +1,218 @@ +/* + * 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.ByteString; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.threeten.bp.Instant; + +/** + * 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); + } +} 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..68f81cc56f 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; @@ -50,173 +50,173 @@ public final class RowSetUtil { private RowSetUtil() {} /** - * 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(); + + if (rowSet.getRowKeysList().isEmpty() && rowSet.getRowRangesList().isEmpty()) { + rowSet = RowSet.newBuilder().addRowRanges(RowRange.getDefaultInstance()).build(); + } + + // Handle point lookups + for (ByteString key : rowSet.getRowKeysList()) { + if (fromStart) { + // key is right of the split + if (ByteStringComparator.INSTANCE.compare(key, splitPoint) > 0) { + newRowSet.addRowKeys(key); + } + } else { + // key is left of the split + if (ByteStringComparator.INSTANCE.compare(key, splitPoint) < 0) { + newRowSet.addRowKeys(key); + } + } + } - List splits = split(rowSet, splitPoints, true); + // Handle ranges + for (RowRange rowRange : rowSet.getRowRangesList()) { + RowRange newRange = truncateRange(rowRange, splitPoint, fromStart); + if (newRange != null) { + newRowSet.addRowRanges(newRange); + } + } - return Split.of(splits.get(0), splits.get(1)); + // 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(); } /** * 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 +297,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..edb8cf6dcf --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtil.java @@ -0,0 +1,69 @@ +/* + * 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.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() { + merger = new SqlRowMerger(); + } + + @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/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..5f64190b5c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewId.java @@ -0,0 +1,55 @@ +/* + * 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); + } + + abstract String getTableId(); + + 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; + } +} 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..f6a09d0b6d 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,31 @@ */ 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 +96,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, + String.format( + "Too many mutations, got %s, limit is %s", + mutationCountSum + mutationCount, MAX_MUTATION)); + this.mutationCountSum += mutationCount; + builder.addEntries( MutateRowsRequest.Entry.newBuilder() .setRowKey(rowKey) @@ -105,14 +128,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 +152,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 +165,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..23fb47bd82 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutation.java @@ -0,0 +1,270 @@ +/* + * 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.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; +import org.threeten.bp.Instant; + +/** + * 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, + Instant commitTimestamp, + int tieBreaker) { + return builder() + .setRowKey(rowKey) + .setType(MutationType.USER) + .setSourceClusterId(sourceClusterId) + .setCommitTimestamp(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, Instant commitTimestamp, int tieBreaker) { + return builder() + .setRowKey(rowKey) + .setType(MutationType.GARBAGE_COLLECTION) + .setSourceClusterId("") + .setCommitTimestamp(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(); + + /** Get the commit timestamp of the current mutation. */ + public abstract Instant getCommitTimestamp(); + + /** + * 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(); + + /** Get the low watermark of the current mutation. */ + public abstract Instant getEstimatedLowWatermark(); + + /** 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(@Nonnull ByteString rowKey); + + abstract Builder setType(@Nonnull MutationType type); + + abstract Builder setSourceClusterId(@Nonnull String sourceClusterId); + + abstract Builder setCommitTimestamp(Instant commitTimestamp); + + abstract Builder setTieBreaker(int tieBreaker); + + abstract ImmutableList.Builder entriesBuilder(); + + abstract Builder setToken(@Nonnull String token); + + abstract Builder setEstimatedLowWatermark(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, 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..40a71b1d3c --- /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 javax.annotation.Nonnull; +import org.threeten.bp.Instant; + +/** + * 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..14841f9f4d 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,49 @@ 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 +104,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 +154,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 +174,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..d40ad7621c --- /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 javax.annotation.Nonnull; +import javax.annotation.Nullable; +import org.threeten.bp.Instant; + +/** + * 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( + @Nonnull 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( + @Nonnull String token, Instant estimatedLowWatermark) { + this.changeStreamMutationBuilder.setToken(token); + this.changeStreamMutationBuilder.setEstimatedLowWatermark(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..2ff139081c 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,7 +75,8 @@ public Row createRowFromProto(com.google.bigtable.v2.Row row) { return builder.finishRow(); } - /** {@inheritDoc} */ + /** Internal implementation detail for {@link DefaultRowAdapter}. */ + @InternalApi() public class DefaultRowBuilder implements RowBuilder { private ByteString currentKey; private TreeMap> cellsByFamily; 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..8e3d865790 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Heartbeat.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.models; + +import com.google.api.core.InternalApi; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ReadChangeStreamResponse; +import java.io.Serializable; +import javax.annotation.Nonnull; +import org.threeten.bp.Instant; + +/** 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, 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()), + Instant.ofEpochSecond( + heartbeat.getEstimatedLowWatermark().getSeconds(), + heartbeat.getEstimatedLowWatermark().getNanos())); + } + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public abstract ChangeStreamContinuationToken getChangeStreamContinuationToken(); + + @InternalApi("Intended for use by the BigtableIO in apache/beam only.") + public abstract Instant getEstimatedLowWatermark(); +} 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 986a0ca1a5..1b4cb8d680 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; @@ -46,20 +47,31 @@ public final class Query implements Serializable { // 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(); + /** @deprecated Please use {@link Query#create(TargetId)} instead. */ + @Deprecated + public static Query create(String tableId) { + return new Query(TableId.of(tableId)); + } + /** - * Constructs a new Query object for the specified table id. The table id will be combined with - * the instance name specified in the {@link + * 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 TableId */ - public static Query create(String tableId) { - return new Query(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 { @@ -183,6 +195,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 +271,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 +281,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 +315,14 @@ 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.scopedForAuthorizedView()) { + builder.setAuthorizedViewName(resourceName); + } else { + builder.setTableName(resourceName); + } + return builder.setAppProfileId(requestContext.getAppProfileId()).build(); } /** @@ -277,15 +333,17 @@ 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(); - Query query = new Query(NameUtil.extractTableIdFromTableName(request.getTableName())); + Query query = new Query(NameUtil.extractTargetId(tableName, authorizedViewName)); query.builder = request.toBuilder(); return query; } public Query clone() { - Query query = Query.create(tableId); + Query query = Query.create(targetId); query.builder = this.builder.clone(); return query; } @@ -297,6 +355,80 @@ 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. + */ + @BetaApi("This surface is stable yet it might be removed in the future.") + 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 +438,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 +447,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 +455,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..a6dfb7666d --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQuery.java @@ -0,0 +1,280 @@ +/* + * 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.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; +import org.threeten.bp.Instant; + +/** 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()); + } + + /** Sets the startTime to read the change stream. */ + public ReadChangeStreamQuery startTime(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; + } + + /** Sets the endTime to read the change stream. */ + public ReadChangeStreamQuery endTime(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; + } + + /** Sets the heartbeat duration for the change stream. */ + public ReadChangeStreamQuery heartbeatDuration(org.threeten.bp.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..554a0268b9 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,49 @@ 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)); } - public static ReadModifyWriteRow create(@Nonnull String tableId, @Nonnull ByteString key) { - return new ReadModifyWriteRow(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, String key) { + return new ReadModifyWriteRow(targetId, ByteString.copyFromUtf8(key)); + } + + /** @deprecated Please use {@link ReadModifyWriteRow#create(TargetId, ByteString)} instead. */ + @Deprecated + public static ReadModifyWriteRow create(String tableId, ByteString key) { + return new ReadModifyWriteRow(TableId.of(tableId), key); + } + + /** + * Creates a new instance of the ReadModifyWriteRow for the given target with targetId. + * + * @see AuthorizedViewId + * @see TableId + */ + public static ReadModifyWriteRow create(TargetId targetId, ByteString key) { + return new ReadModifyWriteRow(targetId, key); } private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException { @@ -129,14 +153,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 +171,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..cee0a37f19 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,102 @@ 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); + } + + /** @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 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 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 +227,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 +271,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 +300,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..80ffe53737 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, + String.format( + "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..08d9a3ca23 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequest.java @@ -0,0 +1,84 @@ +/* + * 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.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 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(); + + SampleRowKeysRequest sampleRowKeysRequest = + SampleRowKeysRequest.create(NameUtil.extractTargetId(tableName, authorizedViewName)); + + 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); + } +} 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..15b2cd9d95 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TableId.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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); + } + + 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; + } +} 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..ae5be23598 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/TargetId.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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). + */ + @InternalApi + boolean scopedForAuthorizedView(); +} 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..80b8eedd4c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Value.java @@ -0,0 +1,133 @@ +/* + * 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()); + } + throw new UnsupportedOperationException(); + } +} diff --git a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/MavenPlaceholderShaded.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java similarity index 54% rename from google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/MavenPlaceholderShaded.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java index 44b0633b5b..0a722a914d 100644 --- a/google-cloud-bigtable-stats/src/main/java/com/google/cloud/bigtable/stats/MavenPlaceholderShaded.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ColumnMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 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. @@ -13,14 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.google.cloud.bigtable.stats; +package com.google.cloud.bigtable.data.v2.models.sql; -public final class MavenPlaceholderShaded { - /** - * This class is here to force generation of source javadoc jars so that the maven release process - * doesn't complain. The shading plugin generated a shaded jar of bigtable-stats, but it doesn't - * generate javadoc or source files; this class is here as a hack and better methods should be - * employed. - */ - private MavenPlaceholderShaded() {} +import com.google.api.core.BetaApi; + +/** Represents the metadata for a column in a {@link ResultSet} */ +@BetaApi +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/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..807e995712 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/ResultSet.java @@ -0,0 +1,65 @@ +/* + * 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; + +/** + * 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. + */ +@BetaApi +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..23e7155e67 --- /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 com.google.api.core.BetaApi; +import java.util.List; + +/** Provides information about the schema of a {@link ResultSet}. */ +@BetaApi +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..50146f292a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/SqlType.java @@ -0,0 +1,286 @@ +/* + * 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.ByteString; +import java.io.Serializable; +import java.util.List; +import org.threeten.bp.Instant; + +/** + * 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 + */ +@BetaApi +public interface SqlType extends Serializable { + + /* Enumeration of the types */ + enum Code { + BYTES, + STRING, + INT64, + FLOAT64, + FLOAT32, + BOOL, + TIMESTAMP, + DATE, + STRUCT, + ARRAY, + MAP + } + + /** @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. */ + String name(); + + /** @return the {@link SqlType} of the field */ + 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); + } + + /** 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()));
+  }
+
+  /**
+   * 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 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 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/Statement.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Statement.java new file mode 100644 index 0000000000..58c16e2c5c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Statement.java @@ -0,0 +1,379 @@ +/* + * 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.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.RequestContext; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; +import org.threeten.bp.Instant; + +/** + * A SQL statement that can be executed by calling {@link + * com.google.cloud.bigtable.data.v2.BigtableDataClient#executeQuery(Statement)}. + * + *

A statement contains a SQL string and optional parameters. 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 } + * + *

It is an error to execute an SQL query with placeholders for unset parameters. + * + *

Parameterized Statements are constructed using a {@link Builder} and calling + * setTypeParam(String paramName, Type value) for the appropriate type. For example: + * + *

{@code
+ * Statement statement = Statement
+ *     .newBuilder("SELECT cf[@qualifer] FROM table WHERE _key=@key")
+ *     .setBytesParam("qualifier", ByteString.copyFromUtf8("test"))
+ *     .setBytesParam("key", ByteString.copyFromUtf8("testKey"))
+ *     .build();
+ * }
+ */ +@BetaApi +public class Statement { + + 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 final String sql; + private final Map params; + + private Statement(String sql, Map params) { + this.sql = sql; + this.params = params; + } + + /** Creates a {@code Statement} with the given SQL query and no query parameters. */ + public static Statement of(String sql) { + return newBuilder(sql).build(); + } + + /** Creates a new {@code Builder} with the given SQL query */ + public static Builder newBuilder(String sql) { + return new Builder(sql); + } + + public static class Builder { + private final String sql; + private final Map params; + + private Builder(String sql) { + this.sql = sql; + this.params = new HashMap<>(); + } + + /** Builds a {@code Statement} from the builder */ + public Statement build() { + return new Statement(sql, 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + 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) { + params.put(paramName, arrayParamOf(value, arrayType)); + return this; + } + + private static Value stringParamOf(@Nullable String value) { + Value.Builder builder = nullValueWithType(STRING_TYPE); + if (value != null) { + builder.setStringValue(value); + } + return builder.build(); + } + + private static Value bytesParamOf(@Nullable ByteString value) { + Value.Builder builder = nullValueWithType(BYTES_TYPE); + if (value != null) { + builder.setBytesValue(value); + } + return builder.build(); + } + + private static Value int64ParamOf(@Nullable Long value) { + Value.Builder builder = nullValueWithType(INT64_TYPE); + if (value != null) { + builder.setIntValue(value); + } + return builder.build(); + } + + private static Value float32ParamOf(@Nullable Float value) { + Value.Builder builder = nullValueWithType(FLOAT32_TYPE); + if (value != null) { + builder.setFloatValue(value); + } + return builder.build(); + } + + private static Value float64ParamOf(@Nullable Double value) { + Value.Builder builder = nullValueWithType(FLOAT64_TYPE); + if (value != null) { + builder.setFloatValue(value); + } + return builder.build(); + } + + private static Value booleanParamOf(@Nullable Boolean value) { + Value.Builder builder = nullValueWithType(BOOL_TYPE); + if (value != null) { + builder.setBoolValue(value); + } + return builder.build(); + } + + private static Value timestampParamOf(@Nullable Instant value) { + Value.Builder builder = nullValueWithType(TIMESTAMP_TYPE); + if (value != null) { + builder.setTimestampValue(toTimestamp(value)); + } + return builder.build(); + } + + private static Value dateParamOf(@Nullable Date value) { + Value.Builder builder = nullValueWithType(DATE_TYPE); + if (value != null) { + builder.setDateValue(toProtoDate(value)); + } + return builder.build(); + } + + private static Value arrayParamOf(@Nullable List value, SqlType.Array arrayType) { + Type type = + Type.newBuilder() + .setArrayType( + Type.Array.newBuilder().setElementType(getElementType(arrayType)).build()) + .build(); + Value.Builder builder = nullValueWithType(type); + if (value != null) { + builder.setArrayValue(arrayValueOf(value, arrayType)); + } + return builder.build(); + } + + private static Type getElementType(SqlType.Array arrayType) { + switch (arrayType.getElementType().getCode()) { + case BYTES: + return BYTES_TYPE; + case STRING: + return STRING_TYPE; + case INT64: + return INT64_TYPE; + case FLOAT32: + return FLOAT32_TYPE; + case FLOAT64: + return FLOAT64_TYPE; + case BOOL: + return BOOL_TYPE; + case TIMESTAMP: + return TIMESTAMP_TYPE; + case DATE: + return DATE_TYPE; + default: + throw new IllegalArgumentException( + "Unsupported query parameter Array element type: " + arrayType.getElementType()); + } + } + + 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(RequestContext requestContext) { + return ExecuteQueryRequest.newBuilder() + .setInstanceName( + NameUtil.formatInstanceName( + requestContext.getProjectId(), requestContext.getInstanceId())) + .setAppProfileId(requestContext.getAppProfileId()) + .setQuery(sql) + .putAllParams(params) + .build(); + } +} 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..23b113f9f7 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/Struct.java @@ -0,0 +1,26 @@ +/* + * 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 java.io.Serializable; + +/** + * The representation of a SQL Struct type. Data can be accessed using the methods from the {@code + * StructReader} interface. + */ +@BetaApi +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..8f450bbd92 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/sql/StructReader.java @@ -0,0 +1,201 @@ +/* + * 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.ByteString; +import java.util.List; +import java.util.Map; +import org.threeten.bp.Instant; + +/** + * 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. + */ +@BetaApi +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); +} 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 09e657ac07..3e2b540635 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,6 +16,7 @@ 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; @@ -27,6 +28,7 @@ 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; @@ -56,16 +58,19 @@ * @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 final 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); batchingCallSettings = @@ -77,6 +82,7 @@ private BigtableBatchingCallSettings(Builder builder) { 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. */ @@ -85,7 +91,8 @@ public BatchingSettings getBatchingSettings() { } /** Returns an adapter that packs and unpacks batching elements. */ - BatchingDescriptor getBatchingDescriptor() { + BatchingDescriptor + getBatchingDescriptor() { return batchingCallSettings.getBatchingDescriptor(); } @@ -109,8 +116,15 @@ 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); } @@ -130,6 +144,7 @@ public String toString() { .add("isLatencyBasedThrottlingEnabled", isLatencyBasedThrottlingEnabled) .add("targetRpcLatency", targetRpcLatencyMs) .add("dynamicFlowControlSettings", dynamicFlowControlSettings) + .add("isServerInitiatedFlowControlEnabled", isServerInitiatedFlowControlEnabled) .toString(); } @@ -137,17 +152,22 @@ public String 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"); } @@ -159,6 +179,7 @@ private Builder(@Nonnull BigtableBatchingCallSettings settings) { this.isLatencyBasedThrottlingEnabled = settings.isLatencyBasedThrottlingEnabled(); this.targetRpcLatencyMs = settings.getTargetRpcLatencyMs(); this.dynamicFlowControlSettings = settings.getDynamicFlowControlSettings(); + this.isServerInitiatedFlowControlEnabled = settings.isServerInitiatedFlowControlEnabled(); } /** Sets the batching settings with various thresholds. */ @@ -263,32 +284,45 @@ 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 defaultSettings = batchingSettings.getFlowControlSettings(); + FlowControlSettings flowControlSettings = batchingSettings.getFlowControlSettings(); Preconditions.checkState( - defaultSettings.getMaxOutstandingElementCount() != null, + flowControlSettings.getMaxOutstandingElementCount() != null, "maxOutstandingElementCount must be set in BatchingSettings#FlowControlSettings"); Preconditions.checkState( - defaultSettings.getMaxOutstandingRequestBytes() != null, + flowControlSettings.getMaxOutstandingRequestBytes() != null, "maxOutstandingRequestBytes must be set in BatchingSettings#FlowControlSettings"); Preconditions.checkArgument( batchingSettings.getElementCountThreshold() == null - || defaultSettings.getMaxOutstandingElementCount() - >= batchingSettings.getElementCountThreshold(), - "if elementCountThreshold is set in BatchingSettings, maxOutstandingElementCount must be >= elementCountThreshold"); + || flowControlSettings.getMaxOutstandingElementCount() + > batchingSettings.getElementCountThreshold(), + "if batch elementCountThreshold is set in BatchingSettings, flow control maxOutstandingElementCount must be > elementCountThreshold"); Preconditions.checkArgument( batchingSettings.getRequestByteThreshold() == null - || defaultSettings.getMaxOutstandingRequestBytes() - >= batchingSettings.getRequestByteThreshold(), - "if requestByteThreshold is set in BatchingSettings, getMaxOutstandingRequestBytes must be >= getRequestByteThreshold"); + || 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 = defaultSettings.getMaxOutstandingElementCount(); - long maxThrottlingRequestByteCount = defaultSettings.getMaxOutstandingRequestBytes(); + 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. @@ -305,7 +339,7 @@ public BigtableBatchingCallSettings build() { } dynamicFlowControlSettings = DynamicFlowControlSettings.newBuilder() - .setLimitExceededBehavior(defaultSettings.getLimitExceededBehavior()) + .setLimitExceededBehavior(flowControlSettings.getLimitExceededBehavior()) .setInitialOutstandingElementCount(initialElementCount) .setMaxOutstandingElementCount(maxThrottlingElementCount) .setMinOutstandingElementCount(minElementCount) @@ -316,13 +350,15 @@ public BigtableBatchingCallSettings build() { } else { dynamicFlowControlSettings = DynamicFlowControlSettings.newBuilder() - .setLimitExceededBehavior(defaultSettings.getLimitExceededBehavior()) - .setInitialOutstandingElementCount(defaultSettings.getMaxOutstandingElementCount()) - .setMaxOutstandingElementCount(defaultSettings.getMaxOutstandingElementCount()) - .setMinOutstandingElementCount(defaultSettings.getMaxOutstandingElementCount()) - .setInitialOutstandingRequestBytes(defaultSettings.getMaxOutstandingRequestBytes()) - .setMinOutstandingRequestBytes(defaultSettings.getMaxOutstandingRequestBytes()) - .setMaxOutstandingRequestBytes(defaultSettings.getMaxOutstandingRequestBytes()) + .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 93f2cf3ef0..ecbef85be5 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,7 +15,6 @@ */ package com.google.cloud.bigtable.data.v2.stub; -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; @@ -23,25 +22,13 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.rpc.FixedTransportChannelProvider; import com.google.auth.Credentials; -import com.google.bigtable.v2.ReadRowsRequest; -import com.google.bigtable.v2.RowFilter; -import com.google.bigtable.v2.RowSet; -import com.google.bigtable.v2.TableName; -import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; -import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; 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 java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; 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 @@ -54,49 +41,27 @@ 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 BigtableChannelPrimer create( - Credentials credentials, - String projectId, - String instanceId, - String appProfileId, - List tableIds) { + Credentials credentials, String projectId, String instanceId, String appProfileId) { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(projectId) .setInstanceId(instanceId) .setAppProfileId(appProfileId) .setCredentialsProvider(FixedCredentialsProvider.create(credentials)) + // Disable refreshing channel here to avoid creating settings in a loop + .setRefreshingChannel(false) .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); + return new BigtableChannelPrimer(builder.build()); } - private BigtableChannelPrimer( - EnhancedBigtableStubSettings settingsTemplate, List tableIds) { + private BigtableChannelPrimer(EnhancedBigtableStubSettings settingsTemplate) { Preconditions.checkNotNull(settingsTemplate, "settingsTemplate can't be null"); this.settingsTemplate = settingsTemplate; - this.tableIds = ImmutableList.copyOf(tableIds); } @Override @@ -110,25 +75,7 @@ public void primeChannel(ManagedChannel managedChannel) { } private void primeChannelUnsafe(ManagedChannel managedChannel) throws IOException { - if (tableIds.isEmpty()) { - waitForChannelReady(managedChannel); - } else { - sendPrimeRequests(managedChannel); - } - } - - 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; - } - } + sendPrimeRequests(managedChannel); } private void sendPrimeRequests(ManagedChannel managedChannel) throws IOException { @@ -141,41 +88,24 @@ private void sendPrimeRequests(ManagedChannel managedChannel) throws IOException .build(); 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.createReadRowsRawCallable(new DefaultRowAdapter()) - .first() - .futureCall( - ReadRowsRequest.newBuilder() - .setTableName( - TableName.format( - primingSettings.getProjectId(), - primingSettings.getInstanceId(), - tableId)) - .setAppProfileId(primingSettings.getAppProfileId()) - .setRows(RowSet.newBuilder().addRowKeys(PRIMING_ROW_KEY).build()) - .setFilter(RowFilter.newBuilder().setBlockAllFilter(true).build()) - .setRowsLimit(1) - .build()); + PingAndWarmRequest request = + PingAndWarmRequest.newBuilder() + .setName( + NameUtil.formatInstanceName( + primingSettings.getProjectId(), primingSettings.getInstanceId())) + .setAppProfileId(primingSettings.getAppProfileId()) + .build(); - 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(); - } - LOG.warning( - String.format( - "Failed to prime channel for table: %s: %s", entry.getKey(), e.getMessage())); + try { + stub.pingAndWarmCallable().call(request); + } 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. + if (e instanceof ExecutionException) { + e = e.getCause(); } + LOG.warning(String.format("Failed to prime channel: %s", e)); } } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java index 316e156854..9d887d6ccd 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 2021 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. @@ -22,10 +22,18 @@ 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.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 +70,32 @@ 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 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 0ec95f1488..f3897f802d 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 2021 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. @@ -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; @@ -35,10 +35,18 @@ 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.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; @@ -78,8 +86,17 @@ 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 ServerStreamingCallSettings + executeQuerySettings; /** Returns the object with the settings used for calls to readRows. */ public ServerStreamingCallSettings readRowsSettings() { @@ -108,13 +125,39 @@ 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 executeQuery. */ + public ServerStreamingCallSettings + executeQuerySettings() { + return executeQuerySettings; + } + public BigtableStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -126,12 +169,19 @@ 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"; } @@ -163,7 +213,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)) @@ -194,7 +243,12 @@ 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(); + executeQuerySettings = settingsBuilder.executeQuerySettings().build(); } /** Builder for BigtableStubSettings. */ @@ -209,8 +263,19 @@ 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 ServerStreamingCallSettings.Builder + executeQuerySettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -218,18 +283,23 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_3_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "retry_policy_4_codes", ImmutableSet.copyOf( Lists.newArrayList( StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); definitions.put( - "retry_policy_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "no_retry_5_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "no_retry_6_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -240,26 +310,20 @@ public static class Builder extends StubSettings.Builder>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings); initDefaults(this); } @@ -324,11 +407,19 @@ 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(); + executeQuerySettings = settings.executeQuerySettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - mutateRowSettings, checkAndMutateRowSettings, readModifyWriteRowSettings); + mutateRowSettings, + checkAndMutateRowSettings, + pingAndWarmSettings, + readModifyWriteRowSettings); } private static Builder createDefault() { @@ -337,7 +428,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -347,13 +437,13 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { builder .readRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_3_params")); builder .sampleRowKeysSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); builder .mutateRowSettings() @@ -362,18 +452,38 @@ private static Builder initDefaults(Builder builder) { builder .mutateRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_2_params")); builder .checkAndMutateRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .pingAndWarmSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); builder .readModifyWriteRowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .generateInitialChangeStreamPartitionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_5_params")); + + builder + .readChangeStreamSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_6_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_6_params")); + + builder + .executeQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); return builder; } @@ -422,12 +532,40 @@ 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 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/ConvertExceptionCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.java new file mode 100644 index 0000000000..31109abb03 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/ConvertExceptionCallable.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.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; + +/** + * 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 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 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 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 boolean isRstStreamError(Throwable t) { + if (t instanceof InternalException && t.getMessage() != null) { + String error = t.getMessage().toLowerCase(); + return error.contains("rst_stream") || error.contains("rst stream"); + } + return false; + } + + private 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/EnhancedBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStub.java index d8daaa80e6..91c63c2b85 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,6 +15,12 @@ */ package com.google.cloud.bigtable.data.v2.stub; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.APP_PROFILE_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.BIGTABLE_PROJECT_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_NAME_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.INSTANCE_ID_KEY; + +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; @@ -28,6 +34,7 @@ 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; @@ -37,7 +44,10 @@ 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.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.tracing.ApiTracerFactory; import com.google.api.gax.tracing.OpencensusTracerFactory; import com.google.api.gax.tracing.SpanName; import com.google.api.gax.tracing.TracedServerStreamingCallable; @@ -47,65 +57,110 @@ 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.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.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.RowRange; import com.google.bigtable.v2.SampleRowKeysResponse; import com.google.cloud.bigtable.Version; +import com.google.cloud.bigtable.data.v2.BigtableDataSettings; import com.google.cloud.bigtable.data.v2.internal.JwtCredentialsWithAudience; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; import com.google.cloud.bigtable.data.v2.models.BulkMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamMutation; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecordAdapter; import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; +import com.google.cloud.bigtable.data.v2.models.DefaultChangeStreamRecordAdapter; import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; import com.google.cloud.bigtable.data.v2.models.KeyOffset; import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.cloud.bigtable.data.v2.models.RowAdapter; import com.google.cloud.bigtable.data.v2.models.RowMutation; import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TargetId; +import com.google.cloud.bigtable.data.v2.models.sql.Statement; +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.BigtableTracerStreamingCallable; +import com.google.cloud.bigtable.data.v2.stub.metrics.BigtableTracerUnaryCallable; +import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsTracerFactory; 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.CustomOpenTelemetryMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.metrics.ErrorCountPerConnectionMetricTracker; +import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider; import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsTracerFactory; +import com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider; import com.google.cloud.bigtable.data.v2.stub.metrics.RpcMeasureConstants; 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.metrics.TracedBatcherUnaryCallable; 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.ReadRowsBatchingDescriptor; -import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsConvertExceptionCallable; +import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsFirstCallable; import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsResumptionStrategy; import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsRetryCompletedCallable; import com.google.cloud.bigtable.data.v2.stub.readrows.ReadRowsUserCallable; import com.google.cloud.bigtable.data.v2.stub.readrows.RowMergingCallable; +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallContext; +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallable; +import com.google.cloud.bigtable.data.v2.stub.sql.MetadataResolvingCallable; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlRowMergingCallable; import com.google.cloud.bigtable.gaxx.retrying.ApiResultRetryAlgorithm; +import com.google.cloud.bigtable.gaxx.retrying.RetryInfoRetryAlgorithm; +import com.google.common.annotations.VisibleForTesting; 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.grpc.ManagedChannelBuilder; 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.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.Attributes; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -123,11 +178,15 @@ */ @InternalApi public class EnhancedBigtableStub implements AutoCloseable { + + private static final Logger logger = Logger.getLogger(EnhancedBigtableStub.class.getName()); + private static final String CLIENT_NAME = "Bigtable"; private static final long FLOW_CONTROL_ADJUSTING_INTERVAL_MS = TimeUnit.SECONDS.toMillis(20); - private final EnhancedBigtableStubSettings settings; private final ClientContext clientContext; + + private final boolean closeClientContext; private final RequestContext requestContext; private final FlowController bulkMutationFlowController; private final DynamicFlowControlStats bulkMutationDynamicFlowControlStats; @@ -136,20 +195,54 @@ public class EnhancedBigtableStub implements AutoCloseable { private final UnaryCallable readRowCallable; private final UnaryCallable> bulkReadRowsCallable; 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; + private final UnaryCallable pingAndWarmCallable; + + private final ServerStreamingCallable + generateInitialChangeStreamPartitionsCallable; + + private final ServerStreamingCallable + readChangeStreamCallable; + + private final ExecuteQueryCallable executeQueryCallable; public static EnhancedBigtableStub create(EnhancedBigtableStubSettings settings) throws IOException { - settings = finalizeSettings(settings, Tags.getTagger(), Stats.getStatsRecorder()); + ClientContext clientContext = createClientContext(settings); + OpenTelemetry openTelemetry = null; + try { + // We don't want client side metrics to crash the client, so catch any exception when getting + // the OTEL instance and log the exception instead. + openTelemetry = + getOpenTelemetry( + settings.getProjectId(), + settings.getMetricsProvider(), + clientContext.getCredentials(), + settings.getMetricsEndpoint()); + } catch (Throwable t) { + logger.log(Level.WARNING, "Failed to get OTEL, will skip exporting client side metrics", t); + } + ClientContext contextWithTracer = + clientContext + .toBuilder() + .setTracerFactory(createBigtableTracerFactory(settings, openTelemetry)) + .build(); + return new EnhancedBigtableStub(settings, contextWithTracer); + } + + public static EnhancedBigtableStub createWithClientContext( + EnhancedBigtableStubSettings settings, ClientContext clientContext) throws IOException { - return new EnhancedBigtableStub(settings, ClientContext.create(settings)); + return new EnhancedBigtableStub(settings, clientContext, false); } - public static EnhancedBigtableStubSettings finalizeSettings( - EnhancedBigtableStubSettings settings, Tagger tagger, StatsRecorder stats) + public static ClientContext createClientContext(EnhancedBigtableStubSettings settings) throws IOException { EnhancedBigtableStubSettings.Builder builder = settings.toBuilder(); @@ -159,68 +252,169 @@ public static EnhancedBigtableStubSettings finalizeSettings( // workaround JWT audience issues 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)); + + InstantiatingGrpcChannelProvider.Builder transportProvider = + builder.getTransportChannelProvider() instanceof InstantiatingGrpcChannelProvider + ? ((InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider()).toBuilder() + : null; + + OpenTelemetry openTelemetry = null; + try { + // We don't want client side metrics to crash the client, so catch any exception when getting + // the OTEL instance and log the exception instead. + openTelemetry = + getOpenTelemetry( + settings.getProjectId(), + settings.getMetricsProvider(), + credentials, + settings.getMetricsEndpoint()); + } catch (Throwable t) { + logger.log(Level.WARNING, "Failed to get OTEL, will skip exporting client side metrics", t); + } + ErrorCountPerConnectionMetricTracker errorCountPerConnectionMetricTracker; + // Skip setting up ErrorCountPerConnectionMetricTracker if openTelemetry is null + if (openTelemetry != null && transportProvider != null) { + errorCountPerConnectionMetricTracker = + new ErrorCountPerConnectionMetricTracker( + openTelemetry, createBuiltinAttributes(settings)); + ApiFunction oldChannelConfigurator = + transportProvider.getChannelConfigurator(); + transportProvider.setChannelConfigurator( + managedChannelBuilder -> { + if (settings.getEnableRoutingCookie()) { + managedChannelBuilder.intercept(new CookiesInterceptor()); + } + + managedChannelBuilder.intercept(errorCountPerConnectionMetricTracker.getInterceptor()); + + if (oldChannelConfigurator != null) { + managedChannelBuilder = oldChannelConfigurator.apply(managedChannelBuilder); + } + return managedChannelBuilder; + }); + } else { + errorCountPerConnectionMetricTracker = null; + } + // 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(); + + if (transportProvider != null) { + transportProvider.setChannelPrimer( + BigtableChannelPrimer.create( + credentials, + settings.getProjectId(), + settings.getInstanceId(), + settings.getAppProfileId())); } - 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()); } + if (transportProvider != null) { + builder.setTransportChannelProvider(transportProvider.build()); + } + + ClientContext clientContext = ClientContext.create(builder.build()); + if (errorCountPerConnectionMetricTracker != null) { + errorCountPerConnectionMetricTracker.startConnectionErrorCountTracker( + clientContext.getExecutor()); + } + return clientContext; + } + + public static ApiTracerFactory createBigtableTracerFactory( + EnhancedBigtableStubSettings settings, @Nullable OpenTelemetry openTelemetry) + throws IOException { + return createBigtableTracerFactory( + settings, Tags.getTagger(), Stats.getStatsRecorder(), openTelemetry); + } + + @VisibleForTesting + public static ApiTracerFactory createBigtableTracerFactory( + EnhancedBigtableStubSettings settings, + Tagger tagger, + StatsRecorder stats, + @Nullable OpenTelemetry openTelemetry) + throws IOException { + String projectId = settings.getProjectId(); + String instanceId = settings.getInstanceId(); + String appProfileId = settings.getAppProfileId(); + 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())) + .put(RpcMeasureConstants.BIGTABLE_PROJECT_ID, TagValue.create(projectId)) + .put(RpcMeasureConstants.BIGTABLE_INSTANCE_ID, TagValue.create(instanceId)) + .put(RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID, TagValue.create(appProfileId)) .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", Version.VERSION) - .build()), - // Add OpenCensus Metrics - MetricsTracerFactory.create(tagger, stats, attributes), - // Add user configured tracer - settings.getTracerFactory()))); - return builder.build(); + + ImmutableList.Builder tracerFactories = ImmutableList.builder(); + tracerFactories + .add( + // Add OpenCensus Tracing + new OpencensusTracerFactory( + ImmutableMap.builder() + // Annotate traces with the same tags as metrics + .put(RpcMeasureConstants.BIGTABLE_PROJECT_ID.getName(), projectId) + .put(RpcMeasureConstants.BIGTABLE_INSTANCE_ID.getName(), instanceId) + .put(RpcMeasureConstants.BIGTABLE_APP_PROFILE_ID.getName(), appProfileId) + // Also annotate traces with library versions + .put("gax", GaxGrpcProperties.getGaxGrpcVersion()) + .put("grpc", GaxGrpcProperties.getGrpcVersion()) + .put("gapic", Version.VERSION) + .build())) + // Add OpenCensus Metrics + .add(MetricsTracerFactory.create(tagger, stats, attributes)) + // Add user configured tracer + .add(settings.getTracerFactory()); + BuiltinMetricsTracerFactory builtinMetricsTracerFactory = + openTelemetry != null + ? BuiltinMetricsTracerFactory.create(openTelemetry, createBuiltinAttributes(settings)) + : null; + if (builtinMetricsTracerFactory != null) { + tracerFactories.add(builtinMetricsTracerFactory); + } + return new CompositeTracerFactory(tracerFactories.build()); + } + + @Nullable + public static OpenTelemetry getOpenTelemetry( + String projectId, + MetricsProvider metricsProvider, + @Nullable Credentials defaultCredentials, + @Nullable String metricsEndpoint) + throws IOException { + if (metricsProvider instanceof CustomOpenTelemetryMetricsProvider) { + CustomOpenTelemetryMetricsProvider customMetricsProvider = + (CustomOpenTelemetryMetricsProvider) metricsProvider; + return customMetricsProvider.getOpenTelemetry(); + } else if (metricsProvider instanceof DefaultMetricsProvider) { + Credentials credentials = + BigtableDataSettings.getMetricsCredentials() != null + ? BigtableDataSettings.getMetricsCredentials() + : defaultCredentials; + DefaultMetricsProvider defaultMetricsProvider = (DefaultMetricsProvider) metricsProvider; + return defaultMetricsProvider.getOpenTelemetry(projectId, metricsEndpoint, credentials); + } else if (metricsProvider instanceof NoopMetricsProvider) { + return null; + } + throw new IOException("Invalid MetricsProvider type " + metricsProvider); + } + + private static Attributes createBuiltinAttributes(EnhancedBigtableStubSettings settings) { + return Attributes.of( + BIGTABLE_PROJECT_ID_KEY, + settings.getProjectId(), + INSTANCE_ID_KEY, + settings.getInstanceId(), + APP_PROFILE_KEY, + settings.getAppProfileId(), + CLIENT_NAME_KEY, + "bigtable-java/" + Version.VERSION); } private static void patchCredentials(EnhancedBigtableStubSettings.Builder settings) @@ -259,8 +453,16 @@ private static void patchCredentials(EnhancedBigtableStubSettings.Builder settin } public EnhancedBigtableStub(EnhancedBigtableStubSettings settings, ClientContext clientContext) { + this(settings, clientContext, true); + } + + public EnhancedBigtableStub( + EnhancedBigtableStubSettings settings, + ClientContext clientContext, + boolean closeClientContext) { this.settings = settings; this.clientContext = clientContext; + this.closeClientContext = closeClientContext; this.requestContext = RequestContext.create( settings.getProjectId(), settings.getInstanceId(), settings.getAppProfileId()); @@ -272,10 +474,19 @@ public EnhancedBigtableStub(EnhancedBigtableStubSettings settings, ClientContext 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()); + pingAndWarmCallable = createPingAndWarmCallable(); + executeQueryCallable = createExecuteQueryCallable(); } // @@ -355,10 +566,16 @@ public UnaryCallable createReadRowCallable(RowAdapter .build(), rowAdapter); - UnaryCallable readRowCallable = - new ReadRowsUserCallable<>(readRowsCallable, requestContext).first(); + ReadRowsUserCallable readRowCallable = + new ReadRowsUserCallable<>(readRowsCallable, requestContext); + + ReadRowsFirstCallable firstRow = new ReadRowsFirstCallable<>(readRowCallable); - return createUserFacingUnaryCallable("ReadRow", readRowCallable); + UnaryCallable traced = + new TracedUnaryCallable<>( + firstRow, clientContext.getTracerFactory(), getSpanName("ReadRow")); + + return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); } /** @@ -369,7 +586,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. * @@ -387,9 +604,17 @@ private ServerStreamingCallable createReadRo new RequestParamsExtractor() { @Override public Map extract(ReadRowsRequest readRowsRequest) { + String tableName = readRowsRequest.getTableName(); + String authorizedViewName = readRowsRequest.getAuthorizedViewName(); + if (tableName.isEmpty()) { + tableName = + NameUtil.extractTableNameFromAuthorizedViewName(authorizedViewName); + } return ImmutableMap.of( - "table_name", readRowsRequest.getTableName(), - "app_profile_id", readRowsRequest.getAppProfileId()); + "table_name", + tableName, + "app_profile_id", + readRowsRequest.getAppProfileId()); } }) .build(), @@ -402,7 +627,7 @@ public Map extract(ReadRowsRequest readRowsRequest) { // 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<>(withStatsHeaders); + new ConvertExceptionCallable<>(withStatsHeaders); ServerStreamingCallable merging = new RowMergingCallable<>(convertException, rowAdapter); @@ -415,21 +640,22 @@ public Map extract(ReadRowsRequest readRowsRequest) { .setRetryableCodes(readRowsSettings.getRetryableCodes()) .setRetrySettings(readRowsSettings.getRetrySettings()) .setIdleTimeout(readRowsSettings.getIdleTimeout()) + .setWaitTimeout(readRowsSettings.getWaitTimeout()) .build(); ServerStreamingCallable watched = Callables.watched(merging, innerSettings, clientContext); - ServerStreamingCallable withHeaderTracer = - new HeaderTracerStreamingCallable<>(watched); + 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); } @@ -465,15 +691,63 @@ private UnaryCallable> createBulkReadRowsCallable( UnaryCallable> tracedBatcher = new TracedBatcherUnaryCallable<>(readRowsUserCallable.all()); - UnaryCallable> withHeaderTracer = - new HeaderTracerUnaryCallable(tracedBatcher); - UnaryCallable> traced = - new TracedUnaryCallable<>(withHeaderTracer, clientContext.getTracerFactory(), span); + new TracedUnaryCallable<>(tracedBatcher, clientContext.getTracerFactory(), span); return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); } + /** + * Helper function that should only be used by createSampleRowKeysCallable() and + * createSampleRowKeysWithRequestCallable(). + */ + private UnaryCallable> + createSampleRowKeysBaseCallable() { + ServerStreamingCallable + base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(BigtableGrpc.getSampleRowKeysMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + com.google.bigtable.v2.SampleRowKeysRequest sampleRowKeysRequest) { + String tableName = sampleRowKeysRequest.getTableName(); + String authorizedViewName = + sampleRowKeysRequest.getAuthorizedViewName(); + if (tableName.isEmpty()) { + tableName = + NameUtil.extractTableNameFromAuthorizedViewName( + authorizedViewName); + } + return ImmutableMap.of( + "table_name", + tableName, + "app_profile_id", + sampleRowKeysRequest.getAppProfileId()); + } + }) + .build(), + settings.sampleRowKeysSettings().getRetryableCodes()); + + UnaryCallable> + spoolable = base.all(); + + UnaryCallable> + withStatsHeaders = new StatsHeadersUnaryCallable<>(spoolable); + + UnaryCallable> + withBigtableTracer = new BigtableTracerUnaryCallable<>(withStatsHeaders); + + UnaryCallable> + retryable = withRetries(withBigtableTracer, settings.sampleRowKeysSettings()); + + return retryable; + } + /** * Creates a callable chain to handle SampleRowKeys RPcs. The chain will: * @@ -489,36 +763,33 @@ private UnaryCallable> createBulkReadRowsCallable( private UnaryCallable> createSampleRowKeysCallable() { 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()); - - UnaryCallable> spoolable = base.all(); - - UnaryCallable> withStatsHeaders = - new StatsHeadersUnaryCallable<>(spoolable); - - UnaryCallable> withHeaderTracer = - new HeaderTracerUnaryCallable<>(withStatsHeaders); + UnaryCallable> + baseCallable = createSampleRowKeysBaseCallable(); + return createUserFacingUnaryCallable( + methodName, new SampleRowKeysCallable(baseCallable, requestContext)); + } - UnaryCallable> retryable = - Callables.retrying(withHeaderTracer, settings.sampleRowKeysSettings(), clientContext); + /** + * Creates a callable chain to handle SampleRowKeys RPcs. The chain will: + * + *
      + *
    • Convert a {@link SampleRowKeysRequest} to a {@link + * com.google.bigtable.v2.SampleRowKeysRequest}. + *
    • Dispatch the request to the GAPIC's {@link BigtableStub#sampleRowKeysCallable()}. + *
    • Spool responses into a list. + *
    • Retry on failure. + *
    • Convert the responses into {@link KeyOffset}s. + *
    • Add tracing & metrics. + *
    + */ + private UnaryCallable> + createSampleRowKeysCallableWithRequest() { + String methodName = "SampleRowKeys"; + UnaryCallable> + baseCallable = createSampleRowKeysBaseCallable(); return createUserFacingUnaryCallable( - methodName, new SampleRowKeysCallable(retryable, requestContext)); + methodName, new SampleRowKeysCallableWithRequest(baseCallable, requestContext)); } /** @@ -539,9 +810,17 @@ private UnaryCallable createMutateRowCallable() { new RequestParamsExtractor() { @Override public Map extract(MutateRowRequest mutateRowRequest) { + String tableName = mutateRowRequest.getTableName(); + String authorizedViewName = mutateRowRequest.getAuthorizedViewName(); + if (tableName.isEmpty()) { + tableName = + NameUtil.extractTableNameFromAuthorizedViewName(authorizedViewName); + } return ImmutableMap.of( - "table_name", mutateRowRequest.getTableName(), - "app_profile_id", mutateRowRequest.getAppProfileId()); + "table_name", + tableName, + "app_profile_id", + mutateRowRequest.getAppProfileId()); } }) .build(), @@ -550,11 +829,11 @@ public Map extract(MutateRowRequest mutateRowRequest) { UnaryCallable withStatsHeaders = new StatsHeadersUnaryCallable<>(base); - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>(withStatsHeaders); + UnaryCallable withBigtableTracer = + new BigtableTracerUnaryCallable<>(withStatsHeaders); UnaryCallable retrying = - Callables.retrying(withHeaderTracer, settings.mutateRowSettings(), clientContext); + withRetries(withBigtableTracer, settings.mutateRowSettings()); return createUserFacingUnaryCallable( methodName, new MutateRowCallable(retrying, requestContext)); @@ -570,37 +849,109 @@ 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() { + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getMutateRowsMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(MutateRowsRequest mutateRowsRequest) { + String tableName = mutateRowsRequest.getTableName(); + String authorizedViewName = mutateRowsRequest.getAuthorizedViewName(); + if (tableName.isEmpty()) { + tableName = + NameUtil.extractTableNameFromAuthorizedViewName(authorizedViewName); + } + return ImmutableMap.of( + "table_name", + tableName, + "app_profile_id", + mutateRowsRequest.getAppProfileId()); + } + }) + .build(), + settings.bulkMutateRowsSettings().getRetryableCodes()); + + ServerStreamingCallable callable = + new StatsHeadersServerStreamingCallable<>(base); + + if (settings.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 withBigtableTracer = + new BigtableTracerStreamingCallable<>(convertException); + + BasicResultRetryAlgorithm resultRetryAlgorithm; + if (settings.getEnableRetryInfo()) { + resultRetryAlgorithm = new RetryInfoRetryAlgorithm<>(); + } else { + resultRetryAlgorithm = new ApiResultRetryAlgorithm<>(); + } + MutateRowsPartialErrorRetryAlgorithm mutateRowsPartialErrorRetryAlgorithm = + new MutateRowsPartialErrorRetryAlgorithm(resultRetryAlgorithm); - UnaryCallable flowControlCallable = null; + RetryAlgorithm retryAlgorithm = + new RetryAlgorithm<>( + mutateRowsPartialErrorRetryAlgorithm, + new ExponentialRetryAlgorithm( + settings.bulkMutateRowsSettings().getRetrySettings(), clientContext.getClock())); + + RetryingExecutorWithContext retryingExecutor = + new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); + UnaryCallable baseCallable = + new MutateRowsRetryingCallable( + clientContext.getDefaultCallContext(), + withBigtableTracer, + retryingExecutor, + settings.bulkMutateRowsSettings().getRetryableCodes(), + retryAlgorithm); + + UnaryCallable withCookie = baseCallable; + + if (settings.getEnableRoutingCookie()) { + withCookie = new CookiesUnaryCallable<>(baseCallable); + } + + UnaryCallable flowControlCallable = null; if (settings.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()) { flowControlCallable = new DynamicFlowControlCallable( - baseCallable, + withCookie, bulkMutationFlowController, bulkMutationDynamicFlowControlStats, settings.bulkMutateRowsSettings().getTargetRpcLatencyMs(), FLOW_CONTROL_ADJUSTING_INTERVAL_MS); } - UnaryCallable userFacing = + UnaryCallable userFacing = new BulkMutateRowsUserFacingCallable( - flowControlCallable != null ? flowControlCallable : baseCallable, requestContext); + flowControlCallable != null ? flowControlCallable : withCookie, requestContext); SpanName spanName = getSpanName("MutateRows"); - UnaryCallable tracedBatcher = new TracedBatcherUnaryCallable<>(userFacing); + UnaryCallable tracedBatcherUnaryCallable = + new TracedBatcherUnaryCallable<>(userFacing); - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>(tracedBatcher); - - UnaryCallable traced = - new TracedUnaryCallable<>(withHeaderTracer, clientContext.getTracerFactory(), spanName); + UnaryCallable traced = + new TracedUnaryCallable<>( + tracedBatcherUnaryCallable, clientContext.getTracerFactory(), spanName); return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); } @@ -636,6 +987,37 @@ public Batcher newMutateRowsBatcher( MoreObjects.firstNonNull(ctx, clientContext.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<>( + settings.bulkMutateRowsSettings().getBatchingDescriptor(), + bulkMutateRowsCallable, + BulkMutation.create(targetId), + settings.bulkMutateRowsSettings().getBatchingSettings(), + clientContext.getExecutor(), + bulkMutationFlowController, + MoreObjects.firstNonNull(ctx, clientContext.getDefaultCallContext())); + } + /** * Creates a {@link BatcherImpl} to handle {@link Query#rowKey(String)}. This is meant for bulk * read with flow control. @@ -664,49 +1046,6 @@ public Batcher newBulkReadRowsBatcher( MoreObjects.firstNonNull(ctx, clientContext.getDefaultCallContext())); } - /** - * Internal helper to create the base MutateRows callable chain. The chain is responsible for - * retrying individual entry in case of error. - * - *

    NOTE: the caller is responsible for adding tracing & metrics. - * - * @see MutateRowsRetryingCallable for more details - */ - 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()); - - ServerStreamingCallable withStatsHeaders = - new StatsHeadersServerStreamingCallable<>(base); - - RetryAlgorithm retryAlgorithm = - new RetryAlgorithm<>( - new ApiResultRetryAlgorithm(), - new ExponentialRetryAlgorithm( - settings.bulkMutateRowsSettings().getRetrySettings(), clientContext.getClock())); - RetryingExecutorWithContext retryingExecutor = - new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor()); - - return new MutateRowsRetryingCallable( - clientContext.getDefaultCallContext(), - withStatsHeaders, - retryingExecutor, - settings.bulkMutateRowsSettings().getRetryableCodes()); - } - /** * Creates a callable chain to handle CheckAndMutateRow RPCs. THe chain will: * @@ -727,9 +1066,18 @@ private UnaryCallable createCheckAndMutateRowCa @Override public Map extract( CheckAndMutateRowRequest checkAndMutateRowRequest) { + String tableName = checkAndMutateRowRequest.getTableName(); + String authorizedViewName = + checkAndMutateRowRequest.getAuthorizedViewName(); + if (tableName.isEmpty()) { + tableName = + NameUtil.extractTableNameFromAuthorizedViewName(authorizedViewName); + } return ImmutableMap.of( - "table_name", checkAndMutateRowRequest.getTableName(), - "app_profile_id", checkAndMutateRowRequest.getAppProfileId()); + "table_name", + tableName, + "app_profile_id", + checkAndMutateRowRequest.getAppProfileId()); } }) .build(), @@ -738,11 +1086,11 @@ public Map extract( UnaryCallable withStatsHeaders = new StatsHeadersUnaryCallable<>(base); - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>(withStatsHeaders); + UnaryCallable withBigtableTracer = + new BigtableTracerUnaryCallable<>(withStatsHeaders); UnaryCallable retrying = - Callables.retrying(withHeaderTracer, settings.checkAndMutateRowSettings(), clientContext); + withRetries(withBigtableTracer, settings.checkAndMutateRowSettings()); return createUserFacingUnaryCallable( methodName, new CheckAndMutateRowCallable(retrying, requestContext)); @@ -767,9 +1115,14 @@ private UnaryCallable createReadModifyWriteRowCallable( new RequestParamsExtractor() { @Override public Map extract(ReadModifyWriteRowRequest request) { + String tableName = request.getTableName(); + String authorizedViewName = request.getAuthorizedViewName(); + if (tableName.isEmpty()) { + tableName = + NameUtil.extractTableNameFromAuthorizedViewName(authorizedViewName); + } return ImmutableMap.of( - "table_name", request.getTableName(), - "app_profile_id", request.getAppProfileId()); + "table_name", tableName, "app_profile_id", request.getAppProfileId()); } }) .build(), @@ -779,16 +1132,265 @@ public Map extract(ReadModifyWriteRowRequest request) { new StatsHeadersUnaryCallable<>(base); String methodName = "ReadModifyWriteRow"; - UnaryCallable withHeaderTracer = - new HeaderTracerUnaryCallable<>(withStatsHeaders); + UnaryCallable withBigtableTracer = + new BigtableTracerUnaryCallable<>(withStatsHeaders); UnaryCallable retrying = - Callables.retrying(withHeaderTracer, settings.readModifyWriteRowSettings(), clientContext); + withRetries(withBigtableTracer, settings.readModifyWriteRowSettings()); return createUserFacingUnaryCallable( methodName, new ReadModifyWriteRowCallable(retrying, requestContext)); } + /** + * 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() { + ServerStreamingCallable< + GenerateInitialChangeStreamPartitionsRequest, + GenerateInitialChangeStreamPartitionsResponse> + base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor( + BigtableGrpc.getGenerateInitialChangeStreamPartitionsMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + GenerateInitialChangeStreamPartitionsRequest + generateInitialChangeStreamPartitionsRequest) { + return ImmutableMap.of( + "table_name", + generateInitialChangeStreamPartitionsRequest.getTableName(), + "app_profile_id", + generateInitialChangeStreamPartitionsRequest.getAppProfileId()); + } + }) + .build(), + settings.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( + settings.generateInitialChangeStreamPartitionsSettings().getRetryableCodes()) + .setRetrySettings( + settings.generateInitialChangeStreamPartitionsSettings().getRetrySettings()) + .setIdleTimeout( + settings.generateInitialChangeStreamPartitionsSettings().getIdleTimeout()) + .setWaitTimeout( + settings.generateInitialChangeStreamPartitionsSettings().getWaitTimeout()) + .build(); + + ServerStreamingCallable watched = + Callables.watched(convertException, innerSettings, clientContext); + + ServerStreamingCallable withBigtableTracer = + new BigtableTracerStreamingCallable<>(watched); + + ServerStreamingCallable retrying = + withRetries(withBigtableTracer, innerSettings); + + SpanName span = getSpanName("GenerateInitialChangeStreamPartitions"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>(retrying, clientContext.getTracerFactory(), span); + + return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); + } + + /** + * Creates a callable chain to handle streaming ReadChangeStream RPCs. The chain will: + * + *
      + *
    • Convert a {@link ReadChangeStreamQuery} into a {@link ReadChangeStreamRequest} and + * dispatch the RPC. + *
    • Upon receiving the response stream, it will produce a stream of ChangeStreamRecordT. In + * case of mutations, it will merge the {@link ReadChangeStreamResponse.DataChange}s into + * {@link ChangeStreamMutation}. The actual change stream record implementation can be + * configured by the {@code changeStreamRecordAdapter} parameter. + *
    • Retry/resume on failure. + *
    • Add tracing & metrics. + *
    + */ + public + ServerStreamingCallable + createReadChangeStreamCallable( + ChangeStreamRecordAdapter changeStreamRecordAdapter) { + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getReadChangeStreamMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract( + ReadChangeStreamRequest readChangeStreamRequest) { + return ImmutableMap.of( + "table_name", readChangeStreamRequest.getTableName(), + "app_profile_id", readChangeStreamRequest.getAppProfileId()); + } + }) + .build(), + settings.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(settings.readChangeStreamSettings().getRetryableCodes()) + .setRetrySettings(settings.readChangeStreamSettings().getRetrySettings()) + .setIdleTimeout(settings.readChangeStreamSettings().getIdleTimeout()) + .setWaitTimeout(settings.readChangeStreamSettings().getWaitTimeout()) + .build(); + + ServerStreamingCallable watched = + Callables.watched(merging, innerSettings, clientContext); + + ServerStreamingCallable withBigtableTracer = + new BigtableTracerStreamingCallable<>(watched); + + ServerStreamingCallable readChangeStreamCallable = + withRetries(withBigtableTracer, innerSettings); + + ServerStreamingCallable + readChangeStreamUserCallable = + new ReadChangeStreamUserCallable<>(readChangeStreamCallable, requestContext); + + SpanName span = getSpanName("ReadChangeStream"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>( + readChangeStreamUserCallable, clientContext.getTracerFactory(), span); + + return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); + } + + /** + * Creates a callable chain to handle streaming ExecuteQuery RPCs. The chain will: + * + *
      + *
    • Convert a {@link Statement} into a {@link ExecuteQueryCallContext}, which passes the + * {@link Statement} & a future for the {@link + * com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata} up the call chain. + *
    • Upon receiving the response stream, it will set the metadata future and translate the + * {@link com.google.bigtable.v2.PartialResultSet}s into {@link SqlRow}s + *
    • Add tracing & metrics. + *
    • Wrap the metadata future & row stream into a {@link + * com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream} + *
    + */ + @InternalApi("For internal use only") + public ExecuteQueryCallable createExecuteQueryCallable() { + // TODO support resumption + // TODO update codes once resumption is implemented + Set retryableCodes = Collections.emptySet(); + ServerStreamingCallable base = + GrpcRawCallableFactory.createServerStreamingCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getExecuteQueryMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExecuteQueryRequest executeQueryRequest) { + return ImmutableMap.of( + "name", executeQueryRequest.getInstanceName(), + "app_profile_id", executeQueryRequest.getAppProfileId()); + } + }) + .build(), + retryableCodes); + + ServerStreamingCallable withStatsHeaders = + new StatsHeadersServerStreamingCallable<>(base); + + ServerStreamingCallSettings watchdogSettings = + ServerStreamingCallSettings.newBuilder() + .setIdleTimeout(settings.executeQuerySettings().getIdleTimeout()) + .setWaitTimeout(settings.executeQuerySettings().getWaitTimeout()) + .build(); + + // Watchdog needs to stay above the metadata observer so that watchdog errors + // are passed through to the metadata future. + ServerStreamingCallable watched = + Callables.watched(withStatsHeaders, watchdogSettings, clientContext); + + ServerStreamingCallable withMetadataObserver = + new MetadataResolvingCallable(watched); + + ServerStreamingCallable merging = + new SqlRowMergingCallable(withMetadataObserver); + + ServerStreamingCallable withBigtableTracer = + new BigtableTracerStreamingCallable<>(merging); + + ServerStreamingCallSettings retrySettings = + ServerStreamingCallSettings.newBuilder() + // TODO add resumption strategy and pass through retry settings unchanged + // we pass through retry settings to use the deadlines now but don't + // support retries + .setRetrySettings( + settings + .executeQuerySettings() + .getRetrySettings() + .toBuilder() + // override maxAttempts as a safeguard against changes from user + .setMaxAttempts(1) + .build()) + .build(); + + // Adding RetryingCallable to the callable chain so that client side metrics can be + // measured correctly and deadlines are set. Retries are currently disabled. + ServerStreamingCallable retries = + withRetries(withBigtableTracer, retrySettings); + + SpanName span = getSpanName("ExecuteQuery"); + ServerStreamingCallable traced = + new TracedServerStreamingCallable<>(retries, clientContext.getTracerFactory(), span); + + return new ExecuteQueryCallable( + traced.withDefaultCallContext(clientContext.getDefaultCallContext()), requestContext); + } + /** * Wraps a callable chain in a user presentable callable that will inject the default call context * and trace the call. @@ -801,6 +1403,60 @@ private UnaryCallable createUserFacin return traced.withDefaultCallContext(clientContext.getDefaultCallContext()); } + + private UnaryCallable createPingAndWarmCallable() { + UnaryCallable pingAndWarm = + GrpcRawCallableFactory.createUnaryCallable( + GrpcCallSettings.newBuilder() + .setMethodDescriptor(BigtableGrpc.getPingAndWarmMethod()) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(PingAndWarmRequest request) { + return ImmutableMap.of( + "name", request.getName(), + "app_profile_id", request.getAppProfileId()); + } + }) + .build(), + Collections.emptySet()); + return pingAndWarm.withDefaultCallContext(clientContext.getDefaultCallContext()); + } + + private UnaryCallable withRetries( + UnaryCallable innerCallable, UnaryCallSettings unaryCallSettings) { + UnaryCallable retrying; + if (settings.getEnableRetryInfo()) { + retrying = + com.google.cloud.bigtable.gaxx.retrying.Callables.retrying( + innerCallable, unaryCallSettings, clientContext); + } else { + retrying = Callables.retrying(innerCallable, unaryCallSettings, clientContext); + } + if (settings.getEnableRoutingCookie()) { + return new CookiesUnaryCallable<>(retrying); + } + return retrying; + } + + private ServerStreamingCallable withRetries( + ServerStreamingCallable innerCallable, + ServerStreamingCallSettings serverStreamingCallSettings) { + + ServerStreamingCallable retrying; + if (settings.getEnableRetryInfo()) { + retrying = + com.google.cloud.bigtable.gaxx.retrying.Callables.retrying( + innerCallable, serverStreamingCallSettings, clientContext); + } else { + retrying = Callables.retrying(innerCallable, serverStreamingCallSettings, clientContext); + } + if (settings.getEnableRoutingCookie()) { + return new CookiesServerStreamingCallable<>(retrying); + } + return retrying; + } + // // @@ -818,15 +1474,24 @@ 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; } @@ -845,6 +1510,28 @@ 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; + } + + UnaryCallable pingAndWarmCallable() { + return pingAndWarmCallable; + } + // private SpanName getSpanName(String methodName) { @@ -853,11 +1540,13 @@ private SpanName getSpanName(String methodName) { @Override public void close() { - for (BackgroundResource backgroundResource : clientContext.getBackgroundResources()) { - try { - backgroundResource.close(); - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); + if (closeClientContext) { + for (BackgroundResource backgroundResource : clientContext.getBackgroundResources()) { + try { + backgroundResource.close(); + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", 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 395ba52b08..2a3d0ddba4 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 @@ -22,8 +22,8 @@ import com.google.api.gax.batching.FlowControlSettings; import com.google.api.gax.batching.FlowController; import com.google.api.gax.batching.FlowController.LimitExceededBehavior; -import com.google.api.gax.core.FixedCredentialsProvider; 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; @@ -32,14 +32,22 @@ 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.SqlRow; +import com.google.cloud.bigtable.data.v2.models.ChangeStreamRecord; import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; import com.google.cloud.bigtable.data.v2.models.KeyOffset; import com.google.cloud.bigtable.data.v2.models.Query; +import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; +import com.google.cloud.bigtable.data.v2.models.ReadChangeStreamQuery; import com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.Statement; +import com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider; +import com.google.cloud.bigtable.data.v2.stub.metrics.MetricsProvider; 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; @@ -47,12 +55,17 @@ 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 javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.threeten.bp.Duration; /** @@ -77,7 +90,7 @@ * .setInstanceId("my-instance-id") * .setAppProfileId("default"); * - * settingsBuilder.readRowsSettings() + * settingsBuilder.stubSettings().readRowsSettings() * .setRetryableCodes(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); * * BigtableDataSettings settings = builder.build(); @@ -91,6 +104,8 @@ public class EnhancedBigtableStubSettings extends StubSettings IDEMPOTENT_RETRY_CODES = ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); @@ -113,6 +128,9 @@ public class EnhancedBigtableStubSettings extends StubSettings READ_ROWS_RETRY_CODES = ImmutableSet.builder().addAll(IDEMPOTENT_RETRY_CODES).add(Code.ABORTED).build(); + // Priming request should have a shorter timeout + private static Duration PRIME_REQUEST_TIMEOUT = Duration.ofSeconds(30); + private static final RetrySettings READ_ROWS_RETRY_SETTINGS = RetrySettings.newBuilder() .setInitialRetryDelay(Duration.ofMillis(10)) @@ -120,9 +138,9 @@ public class EnhancedBigtableStubSettings extends StubSettings GENERATE_INITIAL_CHANGE_STREAM_PARTITIONS_RETRY_CODES = + ImmutableSet.builder().addAll(IDEMPOTENT_RETRY_CODES).add(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) + .setJittered(true) + .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(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) + .setJittered(true) + .setInitialRpcTimeout(Duration.ofMinutes(5)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMinutes(5)) + .setTotalTimeout(Duration.ofHours(12)) + .build(); + + // TODO update this when we support retries for ExecuteQuery + // For preview we don't support resumption yet, so we don't retry anything. + private static final Set EXECUTE_QUERY_RETRY_CODES = Collections.emptySet(); + + // We still setup retry settings in order to set default deadlines + private static final RetrySettings EXECUTE_QUERY_RETRY_SETTINGS = + RetrySettings.newBuilder() + .setMaxAttempts(1) + // Set a conservative deadline to start for preview. We'll increase this in the future + .setInitialRpcTimeout(Duration.ofSeconds(30)) + .setMaxRpcTimeout(Duration.ofSeconds(30)) + .build(); /** * Scopes that are equivalent to JWT's audience. * @@ -164,6 +230,8 @@ public class EnhancedBigtableStubSettings extends StubSettings primedTableIds; private final Map jwtAudienceMapping; + private final boolean enableRoutingCookie; + private final boolean enableRetryInfo; private final ServerStreamingCallSettings readRowsSettings; private final UnaryCallSettings readRowSettings; @@ -173,6 +241,17 @@ public class EnhancedBigtableStubSettings extends StubSettings checkAndMutateRowSettings; private final UnaryCallSettings readModifyWriteRowSettings; + private final ServerStreamingCallSettings + generateInitialChangeStreamPartitionsSettings; + private final ServerStreamingCallSettings + readChangeStreamSettings; + private final UnaryCallSettings pingAndWarmSettings; + private final ServerStreamingCallSettings executeQuerySettings; + + private final FeatureFlags featureFlags; + + private final MetricsProvider metricsProvider; + @Nullable private final String metricsEndpoint; private EnhancedBigtableStubSettings(Builder builder) { super(builder); @@ -198,6 +277,10 @@ private EnhancedBigtableStubSettings(Builder builder) { isRefreshingChannel = builder.isRefreshingChannel; primedTableIds = builder.primedTableIds; jwtAudienceMapping = builder.jwtAudienceMapping; + enableRoutingCookie = builder.enableRoutingCookie; + enableRetryInfo = builder.enableRetryInfo; + metricsProvider = builder.metricsProvider; + metricsEndpoint = builder.metricsEndpoint; // Per method settings. readRowsSettings = builder.readRowsSettings.build(); @@ -208,6 +291,12 @@ private EnhancedBigtableStubSettings(Builder builder) { 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(); + featureFlags = builder.featureFlags.build(); } /** Create a new builder. */ @@ -230,14 +319,21 @@ 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; } @@ -247,22 +343,63 @@ public Map getJwtAudienceMapping() { return jwtAudienceMapping; } + public MetricsProvider getMetricsProvider() { + return metricsProvider; + } + + /** + * Gets if routing cookie is enabled. If true, client will retry a request with extra metadata + * server sent back. + */ + @BetaApi("Routing cookie is not currently stable and may change in the future") + public boolean getEnableRoutingCookie() { + return enableRoutingCookie; + } + + /** + * Gets if RetryInfo is enabled. If true, client bases retry decision and back off time on server + * returned RetryInfo value. Otherwise, client uses {@link RetrySettings}. + */ + @BetaApi("RetryInfo is not currently stable and may change in the future") + public boolean getEnableRetryInfo() { + return enableRetryInfo; + } + + /** + * 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; + } + /** Returns a builder for the default ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return BigtableStubSettings.defaultGrpcTransportProviderBuilder() - .setPoolSize(getDefaultChannelPoolSize()) + Boolean isDirectpathEnabled = Boolean.parseBoolean(System.getenv(CBT_ENABLE_DIRECTPATH)); + InstantiatingGrpcChannelProvider.Builder grpcTransportProviderBuilder = + BigtableStubSettings.defaultGrpcTransportProviderBuilder(); + if (isDirectpathEnabled) { + // Attempts direct access to CBT service over gRPC to improve throughput, + // whether the attempt is allowed is totally controlled by service owner. + grpcTransportProviderBuilder + .setAttemptDirectPathXds() + .setAttemptDirectPath(true) + // Allow using non-default service account in DirectPath. + .setAllowNonDefaultServiceAccount(true); + } + return grpcTransportProviderBuilder + .setChannelPoolSettings( + ChannelPoolSettings.builder() + .setInitialChannelCount(10) + .setMinRpcsPerChannel(1) + .setMaxRpcsPerChannel(50) + .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); - } - - static int getDefaultChannelPoolSize() { - // TODO: tune channels - return 2 * Runtime.getRuntime().availableProcessors(); + Duration.ofSeconds(10)); // wait this long before considering the connection dead } @SuppressWarnings("WeakerAccess") @@ -276,6 +413,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. * @@ -285,17 +427,21 @@ 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() { @@ -316,8 +462,8 @@ 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. * */ @@ -491,6 +637,29 @@ public UnaryCallSettings readModifyWriteRowSettings() { return readModifyWriteRowSettings; } + public ServerStreamingCallSettings + generateInitialChangeStreamPartitionsSettings() { + return generateInitialChangeStreamPartitionsSettings; + } + + public ServerStreamingCallSettings + readChangeStreamSettings() { + return readChangeStreamSettings; + } + + public ServerStreamingCallSettings executeQuerySettings() { + return executeQuerySettings; + } + + /** + * 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 pingAndWarmSettings; + } + /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); @@ -505,6 +674,8 @@ public static class Builder extends StubSettings.Builder primedTableIds; private Map jwtAudienceMapping; + private boolean enableRoutingCookie; + private boolean enableRetryInfo; private final ServerStreamingCallSettings.Builder readRowsSettings; private final UnaryCallSettings.Builder readRowSettings; @@ -515,6 +686,17 @@ public static class Builder extends StubSettings.Builder checkAndMutateRowSettings; private final UnaryCallSettings.Builder readModifyWriteRowSettings; + private final ServerStreamingCallSettings.Builder + generateInitialChangeStreamPartitionsSettings; + private final ServerStreamingCallSettings.Builder + readChangeStreamSettings; + private final UnaryCallSettings.Builder pingAndWarmSettings; + private final ServerStreamingCallSettings.Builder executeQuerySettings; + + private FeatureFlags.Builder featureFlags; + + private MetricsProvider metricsProvider; + @Nullable private String metricsEndpoint; /** * Initializes a new Builder with sane defaults for all settings. @@ -526,10 +708,13 @@ 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)); + .setIdleTimeout(Duration.ofMinutes(5)) + .setWaitTimeout(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()); + .setRetrySettings(IDEMPOTENT_RETRY_SETTINGS); sampleRowKeysSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); sampleRowKeysSettings .setRetryableCodes(IDEMPOTENT_RETRY_CODES) - .setRetrySettings(IDEMPOTENT_RETRY_SETTINGS); + .setRetrySettings( + IDEMPOTENT_RETRY_SETTINGS + .toBuilder() + .setInitialRpcTimeout(Duration.ofMinutes(5)) + .setMaxRpcTimeout(Duration.ofMinutes(5)) + .build()); 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()); + long maxBulkMutateOutstandingElementCount = 20_000L; bulkMutateRowsSettings = BigtableBatchingCallSettings.newBuilder(new MutateRowsBatchingDescriptor()) @@ -601,9 +774,7 @@ private Builder() { long maxBulkReadElementPerBatch = 100L; long maxBulkReadRequestSizePerBatch = 400L * 1024L; - // Enables bulkRead to support 10 outstanding batches per channel - long maxBulkReadOutstandingElementCount = - 10L * maxBulkReadElementPerBatch * getDefaultChannelPoolSize(); + long maxBulkReadOutstandingElementCount = 20_000L; bulkReadRowsSettings = BigtableBulkReadRowsCallSettings.newBuilder(new ReadRowsBatchingDescriptor()) @@ -626,6 +797,40 @@ private Builder() { 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) + // This is used to set deadlines. We do not support retries yet. + .setRetrySettings(EXECUTE_QUERY_RETRY_SETTINGS) + .setIdleTimeout(Duration.ofMinutes(5)) + .setWaitTimeout(Duration.ofMinutes(5)); + + featureFlags = + FeatureFlags.newBuilder().setReverseScans(true).setLastScannedRowResponses(true); } private Builder(EnhancedBigtableStubSettings settings) { @@ -636,6 +841,10 @@ private Builder(EnhancedBigtableStubSettings settings) { isRefreshingChannel = settings.isRefreshingChannel; primedTableIds = settings.primedTableIds; jwtAudienceMapping = settings.jwtAudienceMapping; + enableRoutingCookie = settings.enableRoutingCookie; + enableRetryInfo = settings.enableRetryInfo; + metricsProvider = settings.metricsProvider; + metricsEndpoint = settings.getMetricsEndpoint(); // Per method settings. readRowsSettings = settings.readRowsSettings.toBuilder(); @@ -646,6 +855,12 @@ private Builder(EnhancedBigtableStubSettings settings) { 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(); + featureFlags = settings.featureFlags.toBuilder(); } // @@ -727,33 +942,43 @@ 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") + /** + * @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; } @@ -764,11 +989,91 @@ public Builder setJwtAudienceMapping(Map jwtAudienceMapping) { return this; } + /** + * Sets the {@link MetricsProvider}. + * + *

    By default, this is set to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.DefaultMetricsProvider#INSTANCE} which will + * collect and export client side metrics. + * + *

    To disable client side metrics, set it to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.NoopMetricsProvider#INSTANCE}. + * + *

    To use a custom OpenTelemetry instance, refer to {@link + * com.google.cloud.bigtable.data.v2.stub.metrics.CustomOpenTelemetryMetricsProvider} on how to + * set it up. + */ + public Builder setMetricsProvider(MetricsProvider metricsProvider) { + this.metricsProvider = Preconditions.checkNotNull(metricsProvider); + return this; + } + + /** Gets the {@link MetricsProvider}. */ + public MetricsProvider getMetricsProvider() { + return this.metricsProvider; + } + + /** + * Built-in client side metrics are published through Google Cloud Monitoring endpoint. This + * setting overrides the default endpoint for publishing the metrics. + */ + public Builder setMetricsEndpoint(String endpoint) { + this.metricsEndpoint = endpoint; + return this; + } + + /** + * Get the Google Cloud Monitoring endpoint for publishing client side metrics. If it's null, + * client will publish metrics to the default monitoring endpoint. + */ + @Nullable + public String getMetricsEndpoint() { + return metricsEndpoint; + } + @InternalApi("Used for internal testing") public Map getJwtAudienceMapping() { return jwtAudienceMapping; } + /** + * Sets if routing cookie is enabled. If true, client will retry a request with extra metadata + * server sent back. + */ + @BetaApi("Routing cookie is not currently stable and may change in the future") + public Builder setEnableRoutingCookie(boolean enableRoutingCookie) { + this.enableRoutingCookie = enableRoutingCookie; + return this; + } + + /** + * Gets if routing cookie is enabled. If true, client will retry a request with extra metadata + * server sent back. + */ + @BetaApi("Routing cookie is not currently stable and may change in the future") + public boolean getEnableRoutingCookie() { + return enableRoutingCookie; + } + + /** + * Sets if RetryInfo is enabled. If true, client bases retry decision and back off time on + * server returned RetryInfo value. Otherwise, client uses {@link RetrySettings}. + */ + @BetaApi("RetryInfo is not currently stable and may change in the future") + public Builder setEnableRetryInfo(boolean enableRetryInfo) { + this.enableRetryInfo = enableRetryInfo; + return this; + } + + /** + * Gets if RetryInfo is enabled. If true, client bases retry decision and back off time on + * server returned RetryInfo value. Otherwise, client uses {@link RetrySettings}. + */ + @BetaApi("RetryInfo is not currently stable and may change in the future") + public boolean getEnableRetryInfo() { + return enableRetryInfo; + } + /** Returns the builder for the settings used for calls to readRows. */ public ServerStreamingCallSettings.Builder readRowsSettings() { return readRowsSettings; @@ -809,32 +1114,77 @@ public UnaryCallSettings.Builder readModifyWriteRowSett return readModifyWriteRowSettings; } + /** 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 GenerateInitialChangeStreamPartitions. + */ + public ServerStreamingCallSettings.Builder + generateInitialChangeStreamPartitionsSettings() { + return generateInitialChangeStreamPartitionsSettings; + } + + /** Returns the builder with the settings used for calls to PingAndWarm. */ + public UnaryCallSettings.Builder pingAndWarmSettings() { + return 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 executeQuerySettings; + } + @SuppressWarnings("unchecked") 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(this.getEnableRoutingCookie()); + featureFlags.setRetryInfo(this.getEnableRetryInfo()); + // 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); } // @@ -849,6 +1199,8 @@ public String toString() { .add("isRefreshingChannel", isRefreshingChannel) .add("primedTableIds", primedTableIds) .add("jwtAudienceMapping", jwtAudienceMapping) + .add("enableRoutingCookie", enableRoutingCookie) + .add("enableRetryInfo", enableRetryInfo) .add("readRowsSettings", readRowsSettings) .add("readRowSettings", readRowSettings) .add("sampleRowKeysSettings", sampleRowKeysSettings) @@ -857,6 +1209,14 @@ public String toString() { .add("bulkReadRowsSettings", bulkReadRowsSettings) .add("checkAndMutateRowSettings", checkAndMutateRowSettings) .add("readModifyWriteRowSettings", readModifyWriteRowSettings) + .add( + "generateInitialChangeStreamPartitionsSettings", + generateInitialChangeStreamPartitionsSettings) + .add("readChangeStreamSettings", readChangeStreamSettings) + .add("pingAndWarmSettings", pingAndWarmSettings) + .add("executeQuerySettings", executeQuerySettings) + .add("metricsProvider", metricsProvider) + .add("metricsEndpoint", metricsEndpoint) .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 0d3ead2860..ac688963ae 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 2021 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. diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java index f51cc082c4..d5a81334b9 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 2021 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. @@ -22,21 +22,30 @@ import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcStubCallableFactory; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; import com.google.api.gax.rpc.ServerStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; import com.google.bigtable.v2.CheckAndMutateRowRequest; import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest; +import com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse; import com.google.bigtable.v2.MutateRowRequest; import com.google.bigtable.v2.MutateRowResponse; import com.google.bigtable.v2.MutateRowsRequest; import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.PingAndWarmRequest; +import com.google.bigtable.v2.PingAndWarmResponse; +import com.google.bigtable.v2.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; @@ -98,6 +107,16 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(CheckAndMutateRowResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + pingAndWarmMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.bigtable.v2.Bigtable/PingAndWarm") + .setRequestMarshaller(ProtoUtils.marshaller(PingAndWarmRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(PingAndWarmResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor readModifyWriteRowMethodDescriptor = MethodDescriptor.newBuilder() @@ -109,6 +128,46 @@ public class GrpcBigtableStub extends BigtableStub { ProtoUtils.marshaller(ReadModifyWriteRowResponse.getDefaultInstance())) .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())) + .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())) + .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())) + .build(); + private final ServerStreamingCallable readRowsCallable; private final ServerStreamingCallable sampleRowKeysCallable; @@ -116,13 +175,73 @@ 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 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( + "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"); + 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( + "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"); + 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( + "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"); + 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( + "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"); + 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( + "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"); + 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( + "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}"); + 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)); } @@ -163,9 +282,15 @@ protected GrpcBigtableStub( .setMethodDescriptor(readRowsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getTableName(), "table_name", READ_ROWS_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", READ_ROWS_1_PATH_TEMPLATE); + builder.add( + request.getAuthorizedViewName(), + "authorized_view_name", + READ_ROWS_2_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings sampleRowKeysTransportSettings = @@ -173,9 +298,16 @@ protected GrpcBigtableStub( .setMethodDescriptor(sampleRowKeysMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), "table_name", SAMPLE_ROW_KEYS_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", SAMPLE_ROW_KEYS_1_PATH_TEMPLATE); + builder.add( + request.getAuthorizedViewName(), + "authorized_view_name", + SAMPLE_ROW_KEYS_2_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings mutateRowTransportSettings = @@ -183,9 +315,15 @@ protected GrpcBigtableStub( .setMethodDescriptor(mutateRowMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getTableName(), "table_name", MUTATE_ROW_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", MUTATE_ROW_1_PATH_TEMPLATE); + builder.add( + request.getAuthorizedViewName(), + "authorized_view_name", + MUTATE_ROW_2_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings mutateRowsTransportSettings = @@ -193,9 +331,15 @@ protected GrpcBigtableStub( .setMethodDescriptor(mutateRowsMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getTableName(), "table_name", MUTATE_ROWS_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), "app_profile_id", MUTATE_ROWS_1_PATH_TEMPLATE); + builder.add( + request.getAuthorizedViewName(), + "authorized_view_name", + MUTATE_ROWS_2_PATH_TEMPLATE); + return builder.build(); }) .build(); GrpcCallSettings @@ -204,22 +348,95 @@ protected GrpcBigtableStub( .setMethodDescriptor(checkAndMutateRowMethodDescriptor) .setParamsExtractor( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), + "table_name", + CHECK_AND_MUTATE_ROW_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), + "app_profile_id", + CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE); + builder.add( + request.getAuthorizedViewName(), + "authorized_view_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( request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("table_name", String.valueOf(request.getTableName())); - return params.build(); + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + request.getTableName(), + "table_name", + READ_MODIFY_WRITE_ROW_0_PATH_TEMPLATE); + builder.add( + request.getAppProfileId(), + "app_profile_id", + READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE); + builder.add( + request.getAuthorizedViewName(), + "authorized_view_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 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( @@ -238,11 +455,25 @@ protected GrpcBigtableStub( 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.executeQueryCallable = + callableFactory.createServerStreamingCallable( + executeQueryTransportSettings, settings.executeQuerySettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -279,12 +510,36 @@ 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 ServerStreamingCallable executeQueryCallable() { + return executeQueryCallable; + } + @Override public final void close() { try { 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/RateLimitingServerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java new file mode 100644 index 0000000000..62f8b5abf6 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/RateLimitingServerStreamingCallable.java @@ -0,0 +1,295 @@ +/* + * 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 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.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 org.threeten.bp.Duration; +import org.threeten.bp.Instant; + +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; + + 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) context.getTracer()) + .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()); + + public ConditionalRateLimiter(long defaultQps) { + limiter = RateLimiter.create(defaultQps); + logger.info("Rate limiting 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("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("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. + */ + public void trySetRate(double rate, Duration period) { + Instant nextTime = nextRateUpdateTime.get(); + Instant now = Instant.now(); + + if (now.isBefore(nextTime)) { + return; + } + + Instant newNextTime = now.plusSeconds(period.getSeconds()); + + if (!nextRateUpdateTime.compareAndSet(nextTime, newNextTime)) { + // Someone else updated it already. + return; + } + final double oldRate = limiter.getRate(); + limiter.setRate(rate); + logger.info( + "Updated max rate from " + + oldRate + + " to " + + rate + + " with period " + + period.getSeconds() + + " seconds."); + } + + @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("Response carries no RateLimitInfo"); + return false; + } + + if (response.getRateLimitInfo().getFactor() <= 0 + || response.getRateLimitInfo().getPeriod().getSeconds() <= 0) { + logger.finest("Response carries invalid RateLimitInfo=" + response.getRateLimitInfo()); + return false; + } + + logger.finest("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()))); + } 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); + } + outerObserver.onError(t); + } + + @Override + protected void onCompleteImpl() { + outerObserver.onComplete(); + } + + private void updateQps(double factor, Duration period) { + 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); + } + } + + @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/SafeResponseObserver.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java new file mode 100644 index 0000000000..7c65bdf95a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SafeResponseObserver.java @@ -0,0 +1,123 @@ +/* + * 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"); + 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)); + } + + 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/SampleRowKeysCallableWithRequest.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java new file mode 100644 index 0000000000..034a4048d0 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.bigtable.data.v2.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.util.concurrent.MoreExecutors; +import java.util.List; + +/** Simple wrapper for SampleRowKeys to wrap the request and response protobufs. */ +class SampleRowKeysCallableWithRequest + extends UnaryCallable> { + private final RequestContext requestContext; + private final UnaryCallable< + com.google.bigtable.v2.SampleRowKeysRequest, List> + inner; + + SampleRowKeysCallableWithRequest( + UnaryCallable> inner, + RequestContext requestContext) { + + this.requestContext = requestContext; + this.inner = inner; + } + + @Override + public ApiFuture> futureCall( + SampleRowKeysRequest request, ApiCallContext context) { + ApiFuture> rawResponse = + inner.futureCall(request.toProto(requestContext), context); + + return ApiFutures.transform( + rawResponse, + new ApiFunction, List>() { + @Override + public List apply(List rawResponse) { + return convert(rawResponse); + } + }, + MoreExecutors.directExecutor()); + } + + private static List convert(List rawResponse) { + ImmutableList.Builder results = ImmutableList.builder(); + + for (SampleRowKeysResponse element : rawResponse) { + results.add(KeyOffset.create(element.getRowKey(), element.getOffsetBytes())); + } + + return results.build(); + } +} diff --git a/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..b41acc4ac3 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamStateMachine.java @@ -0,0 +1,618 @@ +/* + * 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.Type; +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; +import org.threeten.bp.Instant; + +/** + * 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() == Type.GARBAGE_COLLECTION) { + validate( + dataChange.getSourceClusterId().isEmpty(), + "AWAITING_NEW_STREAM_RECORD: GC mutation shouldn't have source cluster id."); + builder.startGcMutation( + dataChange.getRowKey(), + Instant.ofEpochSecond( + dataChange.getCommitTimestamp().getSeconds(), + dataChange.getCommitTimestamp().getNanos()), + dataChange.getTiebreaker()); + } else if (dataChange.getType() == Type.USER) { + validate( + !dataChange.getSourceClusterId().isEmpty(), + "AWAITING_NEW_STREAM_RECORD: User initiated data change missing source cluster id."); + builder.startUserMutation( + dataChange.getRowKey(), + dataChange.getSourceClusterId(), + 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(), + 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..fda608eda5 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamResumptionStrategy.java @@ -0,0 +1,106 @@ +/* + * 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.ReadChangeStreamRequest.Builder; +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; + } + + 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/BigtableCloudMonitoringExporter.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporter.java new file mode 100644 index 0000000000..fd54313e8d --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporter.java @@ -0,0 +1,405 @@ +/* + * 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 static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.APPLICATION_BLOCKING_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ATTEMPT_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_BLOCKING_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CONNECTIVITY_ERROR_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.FIRST_RESPONSE_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METER_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.OPERATION_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.PER_CONNECTION_ERROR_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.RETRY_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.SERVER_LATENCIES_NAME; + +import com.google.api.MonitoredResource; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutureCallback; +import com.google.api.core.ApiFutures; +import com.google.api.core.InternalApi; +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.monitoring.v3.MetricServiceClient; +import com.google.cloud.monitoring.v3.MetricServiceSettings; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +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.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import org.threeten.bp.Duration; + +/** + * Bigtable Cloud Monitoring OpenTelemetry Exporter. + * + *

    The exporter will look for all bigtable owned metrics under bigtable.googleapis.com + * instrumentation scope and upload it via the Google Cloud Monitoring API. + */ +@InternalApi +public final 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"); + + private static final String APPLICATION_RESOURCE_PROJECT_ID = "project_id"; + + // 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 MetricServiceClient client; + + private final String bigtableProjectId; + private final String taskId; + + // The resource the client application is running on + private final MonitoredResource applicationResource; + + private final AtomicBoolean isShutdown = new AtomicBoolean(false); + + private CompletableResultCode lastExportCode; + + private final AtomicBoolean bigtableExportFailureLogged = new AtomicBoolean(false); + private final AtomicBoolean applicationExportFailureLogged = new AtomicBoolean(false); + + private static final ImmutableList BIGTABLE_TABLE_METRICS = + ImmutableSet.of( + OPERATION_LATENCIES_NAME, + ATTEMPT_LATENCIES_NAME, + SERVER_LATENCIES_NAME, + FIRST_RESPONSE_LATENCIES_NAME, + CLIENT_BLOCKING_LATENCIES_NAME, + APPLICATION_BLOCKING_LATENCIES_NAME, + RETRY_COUNT_NAME, + CONNECTIVITY_ERROR_COUNT_NAME) + .stream() + .map(m -> METER_NAME + m) + .collect(ImmutableList.toImmutableList()); + + private static final ImmutableList APPLICATION_METRICS = + ImmutableSet.of(PER_CONNECTION_ERROR_COUNT_NAME).stream() + .map(m -> METER_NAME + m) + .collect(ImmutableList.toImmutableList()); + + public static BigtableCloudMonitoringExporter create( + String projectId, @Nullable Credentials credentials, @Nullable String endpoint) + throws IOException { + MetricServiceSettings.Builder settingsBuilder = MetricServiceSettings.newBuilder(); + CredentialsProvider credentialsProvider = + Optional.ofNullable(credentials) + .map(FixedCredentialsProvider::create) + .orElse(NoCredentialsProvider.create()); + settingsBuilder.setCredentialsProvider(credentialsProvider); + 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); + } + + org.threeten.bp.Duration timeout = Duration.ofMinutes(1); + // TODO: createServiceTimeSeries needs special handling if the request failed. Leaving + // it as not retried for now. + settingsBuilder.createServiceTimeSeriesSettings().setSimpleTimeoutNoRetries(timeout); + + // Detect the resource that the client application is running on. For example, + // this could be a GCE instance or a GKE pod. Currently, we only support GCE instance and + // GKE pod. This method will return null for everything else. + MonitoredResource applicationResource = null; + try { + applicationResource = BigtableExporterUtils.detectResource(); + } catch (Exception e) { + logger.log( + Level.WARNING, + "Failed to detect resource, will skip exporting application level metrics ", + e); + } + + return new BigtableCloudMonitoringExporter( + projectId, + MetricServiceClient.create(settingsBuilder.build()), + applicationResource, + BigtableExporterUtils.getDefaultTaskValue()); + } + + @VisibleForTesting + BigtableCloudMonitoringExporter( + String projectId, + MetricServiceClient client, + @Nullable MonitoredResource applicationResource, + String taskId) { + this.client = client; + this.taskId = taskId; + this.applicationResource = applicationResource; + this.bigtableProjectId = projectId; + } + + @Override + public CompletableResultCode export(Collection collection) { + if (isShutdown.get()) { + logger.log(Level.WARNING, "Exporter is shutting down"); + return CompletableResultCode.ofFailure(); + } + + CompletableResultCode bigtableExportCode = exportBigtableResourceMetrics(collection); + CompletableResultCode applicationExportCode = exportApplicationResourceMetrics(collection); + + lastExportCode = + CompletableResultCode.ofAll(ImmutableList.of(applicationExportCode, bigtableExportCode)); + + return lastExportCode; + } + + /** Export metrics associated with a BigtableTable resource. */ + private CompletableResultCode exportBigtableResourceMetrics(Collection collection) { + // Filter bigtable table metrics + List bigtableMetricData = + collection.stream() + .filter(md -> BIGTABLE_TABLE_METRICS.contains(md.getName())) + .collect(Collectors.toList()); + + // Skips exporting if there's none + if (bigtableMetricData.isEmpty()) { + return CompletableResultCode.ofSuccess(); + } + + // Verifies metrics project id are the same as the bigtable project id set on this client + if (!bigtableMetricData.stream() + .flatMap(metricData -> metricData.getData().getPoints().stream()) + .allMatch(pd -> bigtableProjectId.equals(BigtableExporterUtils.getProjectId(pd)))) { + logger.log(Level.WARNING, "Metric data has different a projectId. Skip exporting."); + return CompletableResultCode.ofFailure(); + } + + List bigtableTimeSeries; + try { + bigtableTimeSeries = + BigtableExporterUtils.convertToBigtableTimeSeries(bigtableMetricData, taskId); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to convert bigtable table metric data to cloud monitoring timeseries.", + e); + return CompletableResultCode.ofFailure(); + } + + ProjectName projectName = ProjectName.of(bigtableProjectId); + ApiFuture> future = exportTimeSeries(projectName, bigtableTimeSeries); + + CompletableResultCode bigtableExportCode = new CompletableResultCode(); + ApiFutures.addCallback( + future, + new ApiFutureCallback>() { + @Override + public void onFailure(Throwable throwable) { + if (bigtableExportFailureLogged.compareAndSet(false, true)) { + String msg = "createServiceTimeSeries request failed for bigtable metrics."; + 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.", + projectName.getProject()); + } + logger.log(Level.WARNING, msg, throwable); + } + bigtableExportCode.fail(); + } + + @Override + public void onSuccess(List emptyList) { + // When an export succeeded reset the export failure flag to false so if there's a + // transient failure it'll be logged. + bigtableExportFailureLogged.set(false); + bigtableExportCode.succeed(); + } + }, + MoreExecutors.directExecutor()); + + return bigtableExportCode; + } + + /** Export metrics associated with the resource the Application is running on. */ + private CompletableResultCode exportApplicationResourceMetrics( + Collection collection) { + if (applicationResource == null) { + return CompletableResultCode.ofSuccess(); + } + + // Filter application level metrics + List metricData = + collection.stream() + .filter(md -> APPLICATION_METRICS.contains(md.getName())) + .collect(Collectors.toList()); + + // Skip exporting if there's none + if (metricData.isEmpty()) { + return CompletableResultCode.ofSuccess(); + } + + List timeSeries; + try { + timeSeries = + BigtableExporterUtils.convertToApplicationResourceTimeSeries( + metricData, taskId, applicationResource); + } catch (Throwable e) { + logger.log( + Level.WARNING, + "Failed to convert application metric data to cloud monitoring timeseries.", + e); + return CompletableResultCode.ofFailure(); + } + + // Construct the request. The project id will be the project id of the detected monitored + // resource. + ApiFuture> gceOrGkeFuture; + CompletableResultCode exportCode = new CompletableResultCode(); + try { + ProjectName projectName = + ProjectName.of(applicationResource.getLabelsOrThrow(APPLICATION_RESOURCE_PROJECT_ID)); + + gceOrGkeFuture = exportTimeSeries(projectName, timeSeries); + + ApiFutures.addCallback( + gceOrGkeFuture, + new ApiFutureCallback>() { + @Override + public void onFailure(Throwable throwable) { + if (applicationExportFailureLogged.compareAndSet(false, true)) { + String msg = "createServiceTimeSeries request failed for bigtable metrics."; + 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.", + projectName.getProject()); + } + logger.log(Level.WARNING, msg, throwable); + } + exportCode.fail(); + } + + @Override + public void onSuccess(List emptyList) { + // When an export succeeded reset the export failure flag to false so if there's a + // transient failure it'll be logged. + applicationExportFailureLogged.set(false); + exportCode.succeed(); + } + }, + MoreExecutors.directExecutor()); + + } catch (Exception e) { + logger.log( + Level.WARNING, + "Failed to get projectName for application resource " + applicationResource); + return CompletableResultCode.ofFailure(); + } + + return exportCode; + } + + private ApiFuture> exportTimeSeries( + ProjectName projectName, List 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 ApiFutures.allAsList(batchResults); + } + + @Override + public CompletableResultCode flush() { + if (lastExportCode != null) { + return lastExportCode; + } + return CompletableResultCode.ofSuccess(); + } + + @Override + public CompletableResultCode shutdown() { + if (!isShutdown.compareAndSet(false, true)) { + 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)); + } + + /** + * For Google Cloud Monitoring always return CUMULATIVE to keep track of the cumulative value of a + * metric over time. + */ + @Override + public AggregationTemporality getAggregationTemporality(InstrumentType instrumentType) { + return AggregationTemporality.CUMULATIVE; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableExporterUtils.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableExporterUtils.java new file mode 100644 index 0000000000..5bf6688e17 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableExporterUtils.java @@ -0,0 +1,367 @@ +/* + * 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 static com.google.api.Distribution.BucketOptions; +import static com.google.api.Distribution.BucketOptions.Explicit; +import static com.google.api.MetricDescriptor.MetricKind; +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; +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 static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.BIGTABLE_PROJECT_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_UID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLUSTER_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.INSTANCE_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METER_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.TABLE_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ZONE_ID_KEY; + +import com.google.api.Distribution; +import com.google.api.Metric; +import com.google.api.MonitoredResource; +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.MoreObjects; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import com.google.monitoring.v3.Point; +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.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +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.lang.management.ManagementFactory; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.Nullable; + +/** Utils to convert OpenTelemetry types to Google Cloud Monitoring types. */ +class BigtableExporterUtils { + + private static final Logger logger = Logger.getLogger(BigtableExporterUtils.class.getName()); + + private static final String BIGTABLE_RESOURCE_TYPE = "bigtable_client_raw"; + + // These metric labels will be promoted to the bigtable_table monitored resource fields + private static final Set> BIGTABLE_PROMOTED_RESOURCE_LABELS = + ImmutableSet.of( + BIGTABLE_PROJECT_ID_KEY, INSTANCE_ID_KEY, TABLE_ID_KEY, CLUSTER_ID_KEY, ZONE_ID_KEY); + + private BigtableExporterUtils() {} + + /** + * In most cases this should look like java-${UUID}@${hostname}. The hostname will be retrieved + * from the jvm name and fallback to the local hostname. + */ + static String getDefaultTaskValue() { + // Something like '@' + 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; + } + + static String getProjectId(PointData pointData) { + return pointData.getAttributes().get(BIGTABLE_PROJECT_ID_KEY); + } + + static List convertToBigtableTimeSeries(List collection, String taskId) { + List allTimeSeries = new ArrayList<>(); + + for (MetricData metricData : collection) { + if (!metricData.getInstrumentationScopeInfo().getName().equals(METER_NAME)) { + // Filter out metric data for instruments that are not part of the bigtable builtin metrics + continue; + } + metricData.getData().getPoints().stream() + .map(pointData -> convertPointToBigtableTimeSeries(metricData, pointData, taskId)) + .forEach(allTimeSeries::add); + } + + return allTimeSeries; + } + + static List convertToApplicationResourceTimeSeries( + Collection collection, String taskId, MonitoredResource applicationResource) { + Preconditions.checkNotNull( + applicationResource, + "convert application metrics is called when the supported resource is not detected"); + List allTimeSeries = new ArrayList<>(); + for (MetricData metricData : collection) { + if (!metricData.getInstrumentationScopeInfo().getName().equals(METER_NAME)) { + // Filter out metric data for instruments that are not part of the bigtable builtin metrics + continue; + } + metricData.getData().getPoints().stream() + .map( + pointData -> + convertPointToApplicationResourceTimeSeries( + metricData, pointData, taskId, applicationResource)) + .forEach(allTimeSeries::add); + } + return allTimeSeries; + } + + @Nullable + static MonitoredResource detectResource() { + GCPPlatformDetector detector = GCPPlatformDetector.DEFAULT_INSTANCE; + DetectedPlatform detectedPlatform = detector.detectPlatform(); + MonitoredResource monitoredResource = null; + try { + switch (detectedPlatform.getSupportedPlatform()) { + case GOOGLE_COMPUTE_ENGINE: + monitoredResource = + createGceMonitoredResource( + detectedPlatform.getProjectId(), detectedPlatform.getAttributes()); + break; + case GOOGLE_KUBERNETES_ENGINE: + monitoredResource = + createGkeMonitoredResource( + detectedPlatform.getProjectId(), detectedPlatform.getAttributes()); + break; + } + } catch (IllegalStateException e) { + logger.log( + Level.WARNING, + "Failed to create monitored resource for " + detectedPlatform.getSupportedPlatform(), + e); + } + return monitoredResource; + } + + private static MonitoredResource createGceMonitoredResource( + String projectId, Map attributes) { + return MonitoredResource.newBuilder() + .setType("gce_instance") + .putLabels("project_id", projectId) + .putLabels("instance_id", getAttribute(attributes, AttributeKeys.GCE_INSTANCE_ID)) + .putLabels("zone", getAttribute(attributes, AttributeKeys.GCE_AVAILABILITY_ZONE)) + .build(); + } + + private static MonitoredResource createGkeMonitoredResource( + String projectId, Map attributes) { + return MonitoredResource.newBuilder() + .setType("k8s_container") + .putLabels("project_id", projectId) + .putLabels("location", getAttribute(attributes, AttributeKeys.GKE_CLUSTER_LOCATION)) + .putLabels("cluster_name", getAttribute(attributes, AttributeKeys.GKE_CLUSTER_NAME)) + .putLabels("namespace_name", MoreObjects.firstNonNull(System.getenv("NAMESPACE"), "")) + .putLabels("pod_name", MoreObjects.firstNonNull(System.getenv("HOSTNAME"), "")) + .putLabels("container_name", MoreObjects.firstNonNull(System.getenv("CONTAINER_NAME"), "")) + .build(); + } + + private static String getAttribute(Map attributes, String key) { + String value = attributes.get(key); + if (value == null) { + throw new IllegalStateException( + "Required attribute " + key + " does not exist in the attributes map " + attributes); + } + return value; + } + + private static TimeSeries convertPointToBigtableTimeSeries( + MetricData metricData, PointData pointData, String taskId) { + TimeSeries.Builder builder = + TimeSeries.newBuilder() + .setMetricKind(convertMetricKind(metricData)) + .setValueType(convertValueType(metricData.getType())); + Metric.Builder metricBuilder = Metric.newBuilder().setType(metricData.getName()); + + Attributes attributes = pointData.getAttributes(); + MonitoredResource.Builder monitoredResourceBuilder = + MonitoredResource.newBuilder().setType(BIGTABLE_RESOURCE_TYPE); + + for (AttributeKey key : attributes.asMap().keySet()) { + if (BIGTABLE_PROMOTED_RESOURCE_LABELS.contains(key)) { + monitoredResourceBuilder.putLabels(key.getKey(), String.valueOf(attributes.get(key))); + } else { + metricBuilder.putLabels(key.getKey(), String.valueOf(attributes.get(key))); + } + } + + builder.setResource(monitoredResourceBuilder.build()); + + metricBuilder.putLabels(CLIENT_UID_KEY.getKey(), taskId); + builder.setMetric(metricBuilder.build()); + + TimeInterval timeInterval = + TimeInterval.newBuilder() + .setStartTime(Timestamps.fromNanos(pointData.getStartEpochNanos())) + .setEndTime(Timestamps.fromNanos(pointData.getEpochNanos())) + .build(); + + builder.addPoints(createPoint(metricData.getType(), pointData, timeInterval)); + + return builder.build(); + } + + private static TimeSeries convertPointToApplicationResourceTimeSeries( + MetricData metricData, + PointData pointData, + String taskId, + MonitoredResource applicationResource) { + TimeSeries.Builder builder = + TimeSeries.newBuilder() + .setMetricKind(convertMetricKind(metricData)) + .setValueType(convertValueType(metricData.getType())) + .setResource(applicationResource); + + Metric.Builder metricBuilder = Metric.newBuilder().setType(metricData.getName()); + + Attributes attributes = pointData.getAttributes(); + for (AttributeKey key : attributes.asMap().keySet()) { + metricBuilder.putLabels(key.getKey(), String.valueOf(attributes.get(key))); + } + + metricBuilder.putLabels(CLIENT_UID_KEY.getKey(), taskId); + builder.setMetric(metricBuilder.build()); + + TimeInterval timeInterval = + TimeInterval.newBuilder() + .setStartTime(Timestamps.fromNanos(pointData.getStartEpochNanos())) + .setEndTime(Timestamps.fromNanos(pointData.getEpochNanos())) + .build(); + + builder.addPoints(createPoint(metricData.getType(), pointData, timeInterval)); + return builder.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; + } + } + + private static Point createPoint( + MetricDataType type, PointData pointData, TimeInterval timeInterval) { + 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"); + 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(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableGrpcStreamTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableGrpcStreamTracer.java new file mode 100644 index 0000000000..3b2242385a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableGrpcStreamTracer.java @@ -0,0 +1,62 @@ +/* + * 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.common.base.Stopwatch; +import io.grpc.Attributes; +import io.grpc.ClientStreamTracer; +import io.grpc.Metadata; +import java.util.concurrent.TimeUnit; + +/** + * 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 Stopwatch stopwatch = Stopwatch.createUnstarted(); + private final BigtableTracer tracer; + + public BigtableGrpcStreamTracer(BigtableTracer tracer) { + this.tracer = tracer; + } + + @Override + public void streamCreated(Attributes transportAttrs, Metadata headers) { + stopwatch.start(); + } + + @Override + public void outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize) { + tracer.grpcChannelQueuedLatencies(stopwatch.elapsed(TimeUnit.NANOSECONDS)); + } + + 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/stub/metrics/BigtableTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracer.java index 3d7707cc4c..3445514f7b 100644 --- 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 @@ -25,7 +25,7 @@ * A Bigtable specific {@link ApiTracer} that includes additional contexts. This class is a base * implementation that does nothing. */ -@BetaApi("This surface is stable yet it might be removed in the future.") +@BetaApi("This surface is not stable yet it might be removed in the future.") public class BigtableTracer extends BaseApiTracer { private volatile int attempt = 0; @@ -35,6 +35,23 @@ 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 + } + /** * 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 @@ -57,4 +74,16 @@ public void recordGfeMetadata(@Nullable Long latency, @Nullable Throwable throwa public void batchRequestThrottled(long throttledTimeMs) { // noop } + + /** + * Set the Bigtable zone and cluster so metrics can be tagged with location information. This will + * be called in BuiltinMetricsTracer. + */ + public void setLocations(String zone, String cluster) { + // noop + } + + public void grpcChannelQueuedLatencies(long queuedTimeMs) { + // noop + } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerStreamingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerStreamingCallable.java new file mode 100644 index 0000000000..167cd0dc2e --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerStreamingCallable.java @@ -0,0 +1,144 @@ +/* + * 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.cloud.bigtable.data.v2.stub.SafeResponseObserver; +import com.google.common.base.Preconditions; +import com.google.common.base.Stopwatch; +import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; + +/** + * This callable will + *

  • -Inject a {@link GrpcResponseMetadata} to access the headers returned by gRPC methods upon + * completion. The {@link BigtableTracer} 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. + *
  • -This class will also access trailers from {@link GrpcResponseMetadata} to record zone and + * cluster ids. + *
  • -Call {@link BigtableTracer#onRequest(int)} to record the request events in a stream. + *
  • -This class will also inject a {@link BigtableGrpcStreamTracer} that'll record the time an + * RPC spent in a grpc channel queue. + *
  • 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) { + final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); + // tracer should always be an instance of bigtable tracer + if (context.getTracer() instanceof BigtableTracer) { + BigtableTracerResponseObserver innerObserver = + new BigtableTracerResponseObserver<>( + responseObserver, (BigtableTracer) context.getTracer(), responseMetadata); + innerCallable.call( + request, + innerObserver, + Util.injectBigtableStreamTracer( + context, responseMetadata, (BigtableTracer) context.getTracer())); + } else { + innerCallable.call(request, responseObserver, context); + } + } + + private class BigtableTracerResponseObserver extends SafeResponseObserver { + + private final BigtableTracer tracer; + private final ResponseObserver outerObserver; + private final GrpcResponseMetadata responseMetadata; + + BigtableTracerResponseObserver( + ResponseObserver observer, + BigtableTracer tracer, + GrpcResponseMetadata metadata) { + super(observer); + + this.tracer = tracer; + this.outerObserver = observer; + this.responseMetadata = metadata; + } + + @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) { + Util.recordMetricsFromMetadata(responseMetadata, tracer, t); + outerObserver.onError(t); + } + + @Override + protected void onCompleteImpl() { + Util.recordMetricsFromMetadata(responseMetadata, tracer, null); + outerObserver.onComplete(); + } + } + + private 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/stub/metrics/HeaderTracerUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerUnaryCallable.java similarity index 50% rename from google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerUnaryCallable.java rename to google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableTracerUnaryCallable.java index 6335b433ef..7dfca8b753 100644 --- 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/BigtableTracerUnaryCallable.java @@ -24,42 +24,45 @@ 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 BigtableTracer} 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. + * This callable will: + *

  • - Inject a {@link GrpcResponseMetadata} to access the headers returned by gRPC methods upon + * completion. The {@link BigtableTracer} 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. + *
  • -This class will also access trailers from {@link GrpcResponseMetadata} to record zone and + * cluster ids. + *
  • -This class will also inject a {@link BigtableGrpcStreamTracer} that'll record the time an + * RPC spent in a grpc channel queue. + *
  • This class is considered an internal implementation detail and not meant to be used by + * applications. */ @InternalApi -public class HeaderTracerUnaryCallable +public class BigtableTracerUnaryCallable extends UnaryCallable { private final UnaryCallable innerCallable; - public HeaderTracerUnaryCallable(@Nonnull 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) { + public ApiFuture futureCall(RequestT request, ApiCallContext context) { // tracer should always be an instance of BigtableTracer - if (RpcViews.isGfeMetricsRegistered() && context.getTracer() instanceof BigtableTracer) { + if (context.getTracer() instanceof BigtableTracer) { final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); - final ApiCallContext contextWithResponseMetadata = responseMetadata.addHandlers(context); - HeaderTracerUnaryCallback callback = - new HeaderTracerUnaryCallback((BigtableTracer) context.getTracer(), responseMetadata); - ApiFuture future = innerCallable.futureCall(request, contextWithResponseMetadata); + BigtableTracerUnaryCallback callback = + new BigtableTracerUnaryCallback( + (BigtableTracer) context.getTracer(), responseMetadata); + ApiFuture future = + innerCallable.futureCall( + request, + Util.injectBigtableStreamTracer( + context, responseMetadata, (BigtableTracer) context.getTracer())); ApiFutures.addCallback(future, callback, MoreExecutors.directExecutor()); return future; } else { @@ -67,28 +70,24 @@ public ApiFuture futureCall(RequestT request, ApiCallContext context) { } } - class HeaderTracerUnaryCallback implements ApiFutureCallback { + private class BigtableTracerUnaryCallback implements ApiFutureCallback { private final BigtableTracer tracer; private final GrpcResponseMetadata responseMetadata; - HeaderTracerUnaryCallback(BigtableTracer tracer, GrpcResponseMetadata responseMetadata) { + BigtableTracerUnaryCallback(BigtableTracer tracer, GrpcResponseMetadata responseMetadata) { this.tracer = tracer; this.responseMetadata = responseMetadata; } @Override public void onFailure(Throwable throwable) { - Metadata metadata = responseMetadata.getMetadata(); - Long latency = Util.getGfeLatency(metadata); - tracer.recordGfeMetadata(latency, throwable); + Util.recordMetricsFromMetadata(responseMetadata, tracer, throwable); } @Override public void onSuccess(ResponseT response) { - Metadata metadata = responseMetadata.getMetadata(); - Long latency = Util.getGfeLatency(metadata); - tracer.recordGfeMetadata(latency, null); + Util.recordMetricsFromMetadata(responseMetadata, tracer, null); } } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsConstants.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsConstants.java new file mode 100644 index 0000000000..d85300828b --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsConstants.java @@ -0,0 +1,220 @@ +/* + * 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.api.core.InternalApi; +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.sdk.metrics.Aggregation; +import io.opentelemetry.sdk.metrics.InstrumentSelector; +import io.opentelemetry.sdk.metrics.InstrumentType; +import io.opentelemetry.sdk.metrics.View; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** Defining Bigtable builit-in metrics scope, attributes, metric names and views. */ +@InternalApi +public class BuiltinMetricsConstants { + + // Metric attribute keys for monitored resource + 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"); + + // Metric attribute keys for labels + // We need to access APP_PROFILE_KEY in EnhancedBigtableStubSettings and STREAMING_KEY in + // IT tests, so they're public. + public static final AttributeKey APP_PROFILE_KEY = AttributeKey.stringKey("app_profile"); + public static final AttributeKey STREAMING_KEY = AttributeKey.booleanKey("streaming"); + public static final AttributeKey CLIENT_NAME_KEY = AttributeKey.stringKey("client_name"); + static final AttributeKey METHOD_KEY = AttributeKey.stringKey("method"); + static final AttributeKey STATUS_KEY = AttributeKey.stringKey("status"); + static final AttributeKey CLIENT_UID_KEY = AttributeKey.stringKey("client_uid"); + + // Metric names + public static final String OPERATION_LATENCIES_NAME = "operation_latencies"; + public static final String ATTEMPT_LATENCIES_NAME = "attempt_latencies"; + static final String RETRY_COUNT_NAME = "retry_count"; + static final String CONNECTIVITY_ERROR_COUNT_NAME = "connectivity_error_count"; + static final String SERVER_LATENCIES_NAME = "server_latencies"; + static final String FIRST_RESPONSE_LATENCIES_NAME = "first_response_latencies"; + static final String APPLICATION_BLOCKING_LATENCIES_NAME = "application_latencies"; + static final String CLIENT_BLOCKING_LATENCIES_NAME = "throttling_latencies"; + static final String PER_CONNECTION_ERROR_COUNT_NAME = "per_connection_error_count"; + + // Buckets under 100,000 are identical to buckets for server side metrics handler_latencies. + // Extending client side bucket to up to 3,200,000. + private static final Aggregation AGGREGATION_WITH_MILLIS_HISTOGRAM = + Aggregation.explicitBucketHistogram( + ImmutableList.of( + 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0, 13.0, 16.0, 20.0, 25.0, 30.0, 40.0, + 50.0, 65.0, 80.0, 100.0, 130.0, 160.0, 200.0, 250.0, 300.0, 400.0, 500.0, 650.0, + 800.0, 1000.0, 2000.0, 5000.0, 10000.0, 20000.0, 50000.0, 100000.0, 200000.0, + 400000.0, 800000.0, 1600000.0, 3200000.0)); // max is 53.3 minutes + + private static final Aggregation AGGREGATION_PER_CONNECTION_ERROR_COUNT_HISTOGRAM = + Aggregation.explicitBucketHistogram( + ImmutableList.of( + 1.0, + 2.0, + 4.0, + 8.0, + 16.0, + 32.0, + 64.0, + 125.0, + 250.0, + 500.0, + 1_000.0, + 2_000.0, + 4_000.0, + 8_000.0, + 16_000.0, + 32_000.0, + 64_000.0, + 128_000.0, + 250_000.0, + 500_000.0, + 1_000_000.0)); + + public static final String METER_NAME = "bigtable.googleapis.com/internal/client/"; + + static final Set COMMON_ATTRIBUTES = + ImmutableSet.of( + BIGTABLE_PROJECT_ID_KEY, + INSTANCE_ID_KEY, + TABLE_ID_KEY, + APP_PROFILE_KEY, + CLUSTER_ID_KEY, + ZONE_ID_KEY, + METHOD_KEY, + CLIENT_NAME_KEY); + + static void defineView( + ImmutableMap.Builder viewMap, + String id, + Aggregation aggregation, + InstrumentType type, + String unit, + Set attributes) { + InstrumentSelector selector = + InstrumentSelector.builder() + .setName(id) + .setMeterName(METER_NAME) + .setType(type) + .setUnit(unit) + .build(); + Set attributesFilter = + ImmutableSet.builder() + .addAll( + COMMON_ATTRIBUTES.stream().map(AttributeKey::getKey).collect(Collectors.toSet())) + .addAll(attributes.stream().map(AttributeKey::getKey).collect(Collectors.toSet())) + .build(); + View view = + View.builder() + .setName(METER_NAME + id) + .setAggregation(aggregation) + .setAttributeFilter(attributesFilter) + .build(); + + viewMap.put(selector, view); + } + + public static Map getAllViews() { + ImmutableMap.Builder views = ImmutableMap.builder(); + + defineView( + views, + OPERATION_LATENCIES_NAME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + InstrumentType.HISTOGRAM, + "ms", + ImmutableSet.builder() + .addAll(COMMON_ATTRIBUTES) + .add(STREAMING_KEY, STATUS_KEY) + .build()); + defineView( + views, + ATTEMPT_LATENCIES_NAME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + InstrumentType.HISTOGRAM, + "ms", + ImmutableSet.builder() + .addAll(COMMON_ATTRIBUTES) + .add(STREAMING_KEY, STATUS_KEY) + .build()); + defineView( + views, + SERVER_LATENCIES_NAME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + InstrumentType.HISTOGRAM, + "ms", + ImmutableSet.builder().addAll(COMMON_ATTRIBUTES).add(STATUS_KEY).build()); + defineView( + views, + FIRST_RESPONSE_LATENCIES_NAME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + InstrumentType.HISTOGRAM, + "ms", + ImmutableSet.builder().addAll(COMMON_ATTRIBUTES).add(STATUS_KEY).build()); + defineView( + views, + APPLICATION_BLOCKING_LATENCIES_NAME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + InstrumentType.HISTOGRAM, + "ms", + ImmutableSet.builder().addAll(COMMON_ATTRIBUTES).build()); + defineView( + views, + CLIENT_BLOCKING_LATENCIES_NAME, + AGGREGATION_WITH_MILLIS_HISTOGRAM, + InstrumentType.HISTOGRAM, + "ms", + ImmutableSet.builder().addAll(COMMON_ATTRIBUTES).build()); + defineView( + views, + RETRY_COUNT_NAME, + Aggregation.sum(), + InstrumentType.COUNTER, + "1", + ImmutableSet.builder().addAll(COMMON_ATTRIBUTES).add(STATUS_KEY).build()); + defineView( + views, + CONNECTIVITY_ERROR_COUNT_NAME, + Aggregation.sum(), + InstrumentType.COUNTER, + "1", + ImmutableSet.builder().addAll(COMMON_ATTRIBUTES).add(STATUS_KEY).build()); + + defineView( + views, + PER_CONNECTION_ERROR_COUNT_NAME, + AGGREGATION_PER_CONNECTION_ERROR_COUNT_HISTOGRAM, + InstrumentType.HISTOGRAM, + "1", + ImmutableSet.builder() + .add(BIGTABLE_PROJECT_ID_KEY, INSTANCE_ID_KEY, APP_PROFILE_KEY, CLIENT_NAME_KEY) + .build()); + + return views.build(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java new file mode 100644 index 0000000000..abd214d760 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracer.java @@ -0,0 +1,371 @@ +/* + * 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.metrics; + +import static com.google.api.gax.tracing.ApiTracerFactory.OperationType; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_NAME_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLUSTER_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METHOD_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.STATUS_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.STREAMING_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.TABLE_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ZONE_ID_KEY; + +import com.google.api.gax.retrying.ServerStreamingAttemptException; +import com.google.api.gax.tracing.SpanName; +import com.google.cloud.bigtable.Version; +import com.google.common.base.Stopwatch; +import com.google.common.math.IntMath; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.LongCounter; +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; +import org.threeten.bp.Duration; + +/** + * A {@link BigtableTracer} that records built-in metrics and publish under the + * bigtable.googleapis.com/client namespace + */ +class BuiltinMetricsTracer extends BigtableTracer { + + private static final String NAME = "java-bigtable/" + Version.VERSION; + private final OperationType operationType; + private final SpanName spanName; + + // Operation level metrics + private final AtomicBoolean opFinished = new AtomicBoolean(); + private final Stopwatch operationTimer = Stopwatch.createStarted(); + private final Stopwatch firstResponsePerOpTimer = Stopwatch.createStarted(); + + // Attempt level metrics + private int attemptCount = 0; + private Stopwatch attemptTimer; + private volatile int attempt = 0; + + // 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 boolean serverLatencyTimerIsRunning = false; + private final Object timerLock = new Object(); + + private boolean flowControlIsDisabled = false; + + private final AtomicInteger requestLeft = new AtomicInteger(0); + + // Monitored resource labels + private String tableId = "unspecified"; + private String zone = "global"; + private String cluster = "unspecified"; + + private final AtomicLong totalClientBlockingTime = new AtomicLong(0); + + private final Attributes baseAttributes; + + private Long serverLatencies = null; + + // OpenCensus (and server) histogram buckets use [start, end), however OpenTelemetry uses (start, + // end]. To work around this, we measure all the latencies in nanoseconds and convert them + // to milliseconds and use DoubleHistogram. This should minimize the chance of a data + // point fall on the bucket boundary that causes off by one errors. + private final DoubleHistogram operationLatenciesHistogram; + private final DoubleHistogram attemptLatenciesHistogram; + private final DoubleHistogram serverLatenciesHistogram; + private final DoubleHistogram firstResponseLatenciesHistogram; + private final DoubleHistogram clientBlockingLatenciesHistogram; + private final DoubleHistogram applicationBlockingLatenciesHistogram; + private final LongCounter connectivityErrorCounter; + private final LongCounter retryCounter; + + BuiltinMetricsTracer( + OperationType operationType, + SpanName spanName, + Attributes attributes, + DoubleHistogram operationLatenciesHistogram, + DoubleHistogram attemptLatenciesHistogram, + DoubleHistogram serverLatenciesHistogram, + DoubleHistogram firstResponseLatenciesHistogram, + DoubleHistogram clientBlockingLatenciesHistogram, + DoubleHistogram applicationBlockingLatenciesHistogram, + LongCounter connectivityErrorCounter, + LongCounter retryCounter) { + this.operationType = operationType; + this.spanName = spanName; + this.baseAttributes = attributes; + + this.operationLatenciesHistogram = operationLatenciesHistogram; + this.attemptLatenciesHistogram = attemptLatenciesHistogram; + this.serverLatenciesHistogram = serverLatenciesHistogram; + this.firstResponseLatenciesHistogram = firstResponseLatenciesHistogram; + this.clientBlockingLatenciesHistogram = clientBlockingLatenciesHistogram; + this.applicationBlockingLatenciesHistogram = applicationBlockingLatenciesHistogram; + this.connectivityErrorCounter = connectivityErrorCounter; + this.retryCounter = retryCounter; + } + + @Override + public Scope inScope() { + return new Scope() { + @Override + public void close() {} + }; + } + + @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 (request != null) { + this.tableId = Util.extractTableId(request); + } + if (!flowControlIsDisabled) { + synchronized (timerLock) { + if (!serverLatencyTimerIsRunning) { + serverLatencyTimer.start(); + serverLatencyTimerIsRunning = true; + } + } + } + } + + @Override + public void attemptSucceeded() { + recordAttemptCompletion(null); + } + + @Override + public void attemptCancelled() { + recordAttemptCompletion(new CancellationException()); + } + + @Override + public void attemptFailed(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 (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 (!serverLatencyTimerIsRunning) { + serverLatencyTimer.start(); + serverLatencyTimerIsRunning = true; + } + } + } + } + + @Override + public void responseReceived() { + // 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 (serverLatencyTimerIsRunning) { + totalServerLatencyNano.addAndGet(serverLatencyTimer.elapsed(TimeUnit.NANOSECONDS)); + serverLatencyTimer.reset(); + serverLatencyTimerIsRunning = false; + } + } + } + + @Override + public void afterResponse(long applicationLatency) { + if (!flowControlIsDisabled || requestLeft.decrementAndGet() > 0) { + // 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 (!serverLatencyTimerIsRunning) { + serverLatencyTimer.start(); + serverLatencyTimerIsRunning = true; + } + } + } + } + + @Override + public int getAttempt() { + return attempt; + } + + @Override + public void recordGfeMetadata(@Nullable Long latency, @Nullable Throwable throwable) { + if (latency != null) { + serverLatencies = latency; + } + } + + @Override + public void setLocations(String zone, String cluster) { + this.zone = zone; + this.cluster = cluster; + } + + @Override + public void batchRequestThrottled(long throttledTimeNanos) { + totalClientBlockingTime.addAndGet(Duration.ofNanos(throttledTimeNanos).toMillis()); + } + + @Override + public void grpcChannelQueuedLatencies(long queuedTimeNanos) { + totalClientBlockingTime.addAndGet(queuedTimeNanos); + } + + @Override + public void disableFlowControl() { + flowControlIsDisabled = true; + } + + private void recordOperationCompletion(@Nullable Throwable status) { + if (!opFinished.compareAndSet(false, true)) { + return; + } + operationTimer.stop(); + + boolean isStreaming = operationType == OperationType.ServerStreaming; + String statusStr = Util.extractStatus(status); + + // Publish metric data with all the attributes. The attributes get filtered in + // BuiltinMetricsConstants when we construct the views. + Attributes attributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, tableId) + .put(CLUSTER_ID_KEY, cluster) + .put(ZONE_ID_KEY, zone) + .put(METHOD_KEY, spanName.toString()) + .put(CLIENT_NAME_KEY, NAME) + .put(STREAMING_KEY, isStreaming) + .put(STATUS_KEY, statusStr) + .build(); + + long operationLatencyNano = operationTimer.elapsed(TimeUnit.NANOSECONDS); + + // Only record when retry count is greater than 0 so the retry + // graph will be less confusing + if (attemptCount > 1) { + retryCounter.add(attemptCount - 1, attributes); + } + + operationLatenciesHistogram.record(convertToMs(operationLatencyNano), attributes); + + // serverLatencyTimer should already be stopped in recordAttemptCompletion + long applicationLatencyNano = operationLatencyNano - totalServerLatencyNano.get(); + applicationBlockingLatenciesHistogram.record(convertToMs(applicationLatencyNano), attributes); + + if (operationType == OperationType.ServerStreaming + && spanName.getMethodName().equals("ReadRows")) { + firstResponseLatenciesHistogram.record( + convertToMs(firstResponsePerOpTimer.elapsed(TimeUnit.NANOSECONDS)), attributes); + } + } + + private void recordAttemptCompletion(@Nullable Throwable status) { + // If the attempt failed, the time spent in retry should be counted in application latency. + // Stop the stopwatch and decrement requestLeft. + synchronized (timerLock) { + if (serverLatencyTimerIsRunning) { + requestLeft.decrementAndGet(); + totalServerLatencyNano.addAndGet(serverLatencyTimer.elapsed(TimeUnit.NANOSECONDS)); + serverLatencyTimer.reset(); + serverLatencyTimerIsRunning = false; + } + } + + boolean isStreaming = operationType == OperationType.ServerStreaming; + + // Patch the status 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 (status instanceof ServerStreamingAttemptException) { + status = status.getCause(); + } + + String statusStr = Util.extractStatus(status); + + Attributes attributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, tableId) + .put(CLUSTER_ID_KEY, cluster) + .put(ZONE_ID_KEY, zone) + .put(METHOD_KEY, spanName.toString()) + .put(CLIENT_NAME_KEY, NAME) + .put(STREAMING_KEY, isStreaming) + .put(STATUS_KEY, statusStr) + .build(); + + clientBlockingLatenciesHistogram.record(convertToMs(totalClientBlockingTime.get()), attributes); + + attemptLatenciesHistogram.record( + convertToMs(attemptTimer.elapsed(TimeUnit.NANOSECONDS)), attributes); + + if (serverLatencies != null) { + serverLatenciesHistogram.record(serverLatencies, attributes); + connectivityErrorCounter.add(0, attributes); + } else { + connectivityErrorCounter.add(1, attributes); + } + } + + private static double convertToMs(long nanoSeconds) { + double toMs = 1e-6; + return nanoSeconds * toMs; + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerFactory.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerFactory.java new file mode 100644 index 0000000000..f0ac656978 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerFactory.java @@ -0,0 +1,141 @@ +/* + * 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.metrics; + +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.APPLICATION_BLOCKING_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ATTEMPT_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_BLOCKING_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CONNECTIVITY_ERROR_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.FIRST_RESPONSE_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METER_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.OPERATION_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.RETRY_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.SERVER_LATENCIES_NAME; + +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 io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.DoubleHistogram; +import io.opentelemetry.api.metrics.LongCounter; +import io.opentelemetry.api.metrics.Meter; +import java.io.IOException; + +/** + * {@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 Attributes attributes; + + private static final String MILLISECOND = "ms"; + private static final String COUNT = "1"; + + private final DoubleHistogram operationLatenciesHistogram; + private final DoubleHistogram attemptLatenciesHistogram; + private final DoubleHistogram serverLatenciesHistogram; + private final DoubleHistogram firstResponseLatenciesHistogram; + private final DoubleHistogram clientBlockingLatenciesHistogram; + private final DoubleHistogram applicationBlockingLatenciesHistogram; + private final LongCounter connectivityErrorCounter; + private final LongCounter retryCounter; + + public static BuiltinMetricsTracerFactory create( + OpenTelemetry openTelemetry, Attributes attributes) throws IOException { + return new BuiltinMetricsTracerFactory(openTelemetry, attributes); + } + + BuiltinMetricsTracerFactory(OpenTelemetry openTelemetry, Attributes attributes) { + this.attributes = attributes; + Meter meter = openTelemetry.getMeter(METER_NAME); + + operationLatenciesHistogram = + meter + .histogramBuilder(OPERATION_LATENCIES_NAME) + .setDescription( + "Total time until final operation success or failure, including retries and backoff.") + .setUnit(MILLISECOND) + .build(); + attemptLatenciesHistogram = + meter + .histogramBuilder(ATTEMPT_LATENCIES_NAME) + .setDescription("Client observed latency per RPC attempt.") + .setUnit(MILLISECOND) + .build(); + serverLatenciesHistogram = + meter + .histogramBuilder(SERVER_LATENCIES_NAME) + .setDescription( + "The latency measured from the moment that the RPC entered the Google data center until the RPC was completed.") + .setUnit(MILLISECOND) + .build(); + firstResponseLatenciesHistogram = + meter + .histogramBuilder(FIRST_RESPONSE_LATENCIES_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(MILLISECOND) + .build(); + clientBlockingLatenciesHistogram = + meter + .histogramBuilder(CLIENT_BLOCKING_LATENCIES_NAME) + .setDescription( + "The artificial latency introduced by the client to limit the number of outstanding requests. The publishing of the measurement will be delayed until the attempt trailers have been received.") + .setUnit(MILLISECOND) + .build(); + applicationBlockingLatenciesHistogram = + meter + .histogramBuilder(APPLICATION_BLOCKING_LATENCIES_NAME) + .setDescription( + "The latency of the client application consuming available response data.") + .setUnit(MILLISECOND) + .build(); + connectivityErrorCounter = + meter + .counterBuilder(CONNECTIVITY_ERROR_COUNT_NAME) + .setDescription( + "Number of requests that failed to reach the Google datacenter. (Requests without google response headers") + .setUnit(COUNT) + .build(); + retryCounter = + meter + .counterBuilder(RETRY_COUNT_NAME) + .setDescription("The number of additional RPCs sent after the initial attempt.") + .setUnit(COUNT) + .build(); + } + + @Override + public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { + return new BuiltinMetricsTracer( + operationType, + spanName, + attributes, + operationLatenciesHistogram, + attemptLatenciesHistogram, + serverLatenciesHistogram, + firstResponseLatenciesHistogram, + clientBlockingLatenciesHistogram, + applicationBlockingLatenciesHistogram, + connectivityErrorCounter, + retryCounter); + } +} 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..ca52581a92 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsView.java @@ -0,0 +1,76 @@ +/* + * 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 com.google.auth.oauth2.GoogleCredentials; +import io.opentelemetry.sdk.metrics.InstrumentSelector; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.View; +import io.opentelemetry.sdk.metrics.export.MetricExporter; +import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; +import java.io.IOException; +import java.util.Map; +import javax.annotation.Nullable; + +/** + * A util class to register built-in metrics on a custom OpenTelemetry instance. This is for + * advanced usage, and is only necessary when wanting to write built-in metrics to cloud monitoring + * and custom sinks. Please refer to {@link CustomOpenTelemetryMetricsProvider} for example usage. + */ +public class BuiltinMetricsView { + + private BuiltinMetricsView() {} + + /** + * Register built-in metrics on the {@link SdkMeterProviderBuilder} with application default + * credentials and default endpoint. + */ + public static void registerBuiltinMetrics(String projectId, SdkMeterProviderBuilder builder) + throws IOException { + BuiltinMetricsView.registerBuiltinMetrics( + projectId, GoogleCredentials.getApplicationDefault(), builder); + } + + /** + * Register built-in metrics on the {@link SdkMeterProviderBuilder} with custom credentials and + * default endpoint. + */ + public static void registerBuiltinMetrics( + String projectId, @Nullable Credentials credentials, SdkMeterProviderBuilder builder) + throws IOException { + BuiltinMetricsView.registerBuiltinMetrics(projectId, credentials, builder, null); + } + + /** + * Register built-in metrics on the {@link SdkMeterProviderBuilder} with custom credentials and + * endpoint. + */ + public static void registerBuiltinMetrics( + String projectId, + @Nullable Credentials credentials, + SdkMeterProviderBuilder builder, + @Nullable String endpoint) + throws IOException { + MetricExporter metricExporter = + BigtableCloudMonitoringExporter.create(projectId, credentials, endpoint); + for (Map.Entry entry : + BuiltinMetricsConstants.getAllViews().entrySet()) { + builder.registerView(entry.getKey(), entry.getValue()); + } + builder.registerMetricReader(PeriodicMetricReader.create(metricExporter)); + } +} 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 index 5f4580743b..774c6d9f22 100644 --- 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 @@ -92,9 +92,14 @@ public void connectionSelected(String 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(attemptNumber); + child.attemptStarted(request, attemptNumber); } } @@ -185,4 +190,39 @@ public void batchRequestThrottled(long throttledTimeMs) { tracer.batchRequestThrottled(throttledTimeMs); } } + + @Override + public void setLocations(String zone, String cluster) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.setLocations(zone, cluster); + } + } + + @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 grpcChannelQueuedLatencies(long queuedTimeMs) { + for (BigtableTracer tracer : bigtableTracers) { + tracer.grpcChannelQueuedLatencies(queuedTimeMs); + } + } } diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/ConnectionErrorCountInterceptor.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/ConnectionErrorCountInterceptor.java new file mode 100644 index 0000000000..17fcf9018e --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/ConnectionErrorCountInterceptor.java @@ -0,0 +1,89 @@ +/* + * 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 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.concurrent.atomic.LongAdder; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** An interceptor which counts the number of failed responses for a channel. */ +class ConnectionErrorCountInterceptor implements ClientInterceptor { + private static final Logger LOG = + Logger.getLogger(ConnectionErrorCountInterceptor.class.toString()); + private final LongAdder numOfErrors; + private final LongAdder numOfSuccesses; + + ConnectionErrorCountInterceptor() { + numOfErrors = new LongAdder(); + numOfSuccesses = new LongAdder(); + } + + @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) { + super.start( + new ForwardingClientCallListener.SimpleForwardingClientCallListener( + responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + // Connection accounting is non-critical, so we log the exception, but let normal + // processing proceed. + try { + handleOnCloseUnsafe(status); + } catch (Throwable t) { + if (t instanceof InterruptedException) { + Thread.currentThread().interrupt(); + } + LOG.log( + Level.WARNING, "Unexpected error while updating connection error stats", t); + } + super.onClose(status, trailers); + } + + private void handleOnCloseUnsafe(Status status) { + if (status.isOk()) { + numOfSuccesses.increment(); + } else { + numOfErrors.increment(); + } + } + }, + headers); + } + }; + } + + long getAndResetNumOfErrors() { + return numOfErrors.sumThenReset(); + } + + long getAndResetNumOfSuccesses() { + return numOfSuccesses.sumThenReset(); + } +} 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..8c1c5c1c90 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/CustomOpenTelemetryMetricsProvider.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.metrics; + +import com.google.common.base.MoreObjects; +import io.opentelemetry.api.OpenTelemetry; + +/** + * Set a custom OpenTelemetry instance. + * + *

    To register client side metrics on the custom OpenTelemetry: + * + *

    {@code
    + * SdkMeterProviderBuilder sdkMeterProvider = SdkMeterProvider.builder();
    + *
    + * // register Builtin metrics on your meter provider with default credentials
    + * BuiltinMetricsView.registerBuiltinMetrics("project-id", sdkMeterProvider);
    + *
    + * // register other metrics reader and views
    + * sdkMeterProvider.registerMetricReader(..);
    + * sdkMeterProvider.registerView(..);
    + *
    + * // create the OTEL instance
    + * OpenTelemetry openTelemetry = OpenTelemetrySdk
    + *     .builder()
    + *     .setMeterProvider(sdkMeterProvider.build())
    + *     .build();
    + *
    + * // 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; + } + + @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..c6b0a80c76 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/DefaultMetricsProvider.java @@ -0,0 +1,65 @@ +/* + * 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.InternalApi; +import com.google.auth.Credentials; +import com.google.common.base.MoreObjects; +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.IOException; +import javax.annotation.Nullable; + +/** + * Set {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder#setMetricsProvider(MetricsProvider)}, + * to {@link this#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 OpenTelemetry openTelemetry; + private String projectId; + + private DefaultMetricsProvider() {} + + @InternalApi + public OpenTelemetry getOpenTelemetry( + String projectId, String metricsEndpoint, @Nullable Credentials credentials) + throws IOException { + this.projectId = projectId; + if (openTelemetry == null) { + SdkMeterProviderBuilder meterProvider = SdkMeterProvider.builder(); + BuiltinMetricsView.registerBuiltinMetrics( + projectId, credentials, meterProvider, metricsEndpoint); + openTelemetry = OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + } + return openTelemetry; + } + + @Override + public String toString() { + return MoreObjects.toStringHelper(this) + .add("projectId", projectId) + .add("openTelemetry", openTelemetry) + .toString(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker.java new file mode 100644 index 0000000000..a891df9509 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionMetricTracker.java @@ -0,0 +1,92 @@ +/* + * 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.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METER_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.PER_CONNECTION_ERROR_COUNT_NAME; + +import com.google.api.core.InternalApi; +import io.grpc.ClientInterceptor; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.LongHistogram; +import io.opentelemetry.api.metrics.Meter; +import java.util.Collections; +import java.util.Set; +import java.util.WeakHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/* Background task that goes through all connections and updates the errors_per_connection metric. */ +@InternalApi("For internal use only") +public class ErrorCountPerConnectionMetricTracker implements Runnable { + + private static final Integer PER_CONNECTION_ERROR_COUNT_PERIOD_SECONDS = 60; + + private final LongHistogram perConnectionErrorCountHistogram; + private final Attributes attributes; + + private final Set connectionErrorCountInterceptors; + private final Object interceptorsLock = new Object(); + + public ErrorCountPerConnectionMetricTracker(OpenTelemetry openTelemetry, Attributes attributes) { + connectionErrorCountInterceptors = + Collections.synchronizedSet(Collections.newSetFromMap(new WeakHashMap<>())); + + Meter meter = openTelemetry.getMeter(METER_NAME); + + perConnectionErrorCountHistogram = + meter + .histogramBuilder(PER_CONNECTION_ERROR_COUNT_NAME) + .ofLongs() + .setDescription("Distribution of counts of channels per 'error count per minute'.") + .setUnit("1") + .build(); + + this.attributes = attributes; + } + + public void startConnectionErrorCountTracker(ScheduledExecutorService scheduler) { + scheduler.scheduleAtFixedRate( + this, 0, PER_CONNECTION_ERROR_COUNT_PERIOD_SECONDS, TimeUnit.SECONDS); + } + + public ClientInterceptor getInterceptor() { + ConnectionErrorCountInterceptor connectionErrorCountInterceptor = + new ConnectionErrorCountInterceptor(); + synchronized (interceptorsLock) { + connectionErrorCountInterceptors.add(connectionErrorCountInterceptor); + } + return connectionErrorCountInterceptor; + } + + @Override + public void run() { + synchronized (interceptorsLock) { + for (ConnectionErrorCountInterceptor interceptor : connectionErrorCountInterceptors) { + long errors = interceptor.getAndResetNumOfErrors(); + long successes = interceptor.getAndResetNumOfSuccesses(); + // We avoid keeping track of inactive connections (i.e., without any failed or successful + // requests). + if (errors > 0 || successes > 0) { + // TODO: add a metric to also keep track of the number of successful requests per each + // connection. + perConnectionErrorCountHistogram.record(errors, attributes); + } + } + } + } +} 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 31c5cf1960..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/HeaderTracerStreamingCallable.java +++ /dev/null @@ -1,111 +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 BigtableTracer} 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; - - public HeaderTracerStreamingCallable( - @Nonnull ServerStreamingCallable callable) { - this.innerCallable = Preconditions.checkNotNull(callable, "Inner callable must be set"); - } - - @Override - public void call( - RequestT request, ResponseObserver responseObserver, ApiCallContext context) { - final GrpcResponseMetadata responseMetadata = new GrpcResponseMetadata(); - // tracer should always be an instance of bigtable tracer - if (RpcViews.isGfeMetricsRegistered() && context.getTracer() instanceof BigtableTracer) { - HeaderTracerResponseObserver innerObserver = - new HeaderTracerResponseObserver<>( - responseObserver, (BigtableTracer) context.getTracer(), responseMetadata); - innerCallable.call(request, innerObserver, responseMetadata.addHandlers(context)); - } else { - innerCallable.call(request, responseObserver, context); - } - } - - private class HeaderTracerResponseObserver implements ResponseObserver { - - private final BigtableTracer tracer; - private final ResponseObserver outerObserver; - private final GrpcResponseMetadata responseMetadata; - - HeaderTracerResponseObserver( - ResponseObserver observer, - BigtableTracer tracer, - GrpcResponseMetadata metadata) { - this.tracer = tracer; - this.outerObserver = observer; - this.responseMetadata = metadata; - } - - @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(); - Long latency = Util.getGfeLatency(metadata); - tracer.recordGfeMetadata(latency, t); - outerObserver.onError(t); - } - - @Override - public void onComplete() { - Metadata metadata = responseMetadata.getMetadata(); - Long latency = Util.getGfeLatency(metadata); - tracer.recordGfeMetadata(latency, null); - outerObserver.onComplete(); - } - } -} 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/MetricsTracer.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/MetricsTracer.java index f28b07c0cb..0ffabe2606 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/stub/metrics/MetricsTracer.java @@ -15,6 +15,7 @@ */ package com.google.cloud.bigtable.data.v2.stub.metrics; +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.common.base.Stopwatch; @@ -58,6 +59,9 @@ class MetricsTracer extends BigtableTracer { private volatile int attempt = 0; + private volatile boolean reportBatchingLatency = false; + private volatile long batchThrottledLatency = 0; + MetricsTracer( OperationType operationType, Tagger tagger, @@ -118,16 +122,13 @@ 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))); 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 attemptNumber) { attempt = attemptNumber; @@ -169,23 +170,30 @@ private void recordAttemptCompletion(@Nullable Throwable throwable) { RpcMeasureConstants.BIGTABLE_ATTEMPT_LATENCY, attemptTimer.elapsed(TimeUnit.MILLISECONDS)); + if (reportBatchingLatency) { + measures.put(RpcMeasureConstants.BIGTABLE_BATCH_THROTTLED_TIME, batchThrottledLatency); + + // 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 = 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))); measures.record(tagCtx.build()); } - @Override - public void lroStartFailed(Throwable throwable) { - // noop - } - - @Override - public void lroStartSucceeded() { - // noop - } - @Override public void responseReceived() { if (firstResponsePerOpTimer.isRunning()) { @@ -195,16 +203,6 @@ public void responseReceived() { operationResponseCount++; } - @Override - public void requestSent() { - // noop: no operations are client streaming - } - - @Override - public void batchRequestSent(long elementCount, long requestSize) { - // noop - } - @Override public int getAttempt() { return attempt; @@ -222,17 +220,15 @@ public void recordGfeMetadata(@Nullable Long latency, @Nullable Throwable throwa } measures.record( newTagCtxBuilder() - .putLocal(RpcMeasureConstants.BIGTABLE_STATUS, Util.extractStatus(throwable)) + .putLocal( + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create(Util.extractStatus(throwable))) .build()); } @Override public void batchRequestThrottled(long totalThrottledMs) { - MeasureMap measures = - stats - .newMeasureMap() - .put(RpcMeasureConstants.BIGTABLE_BATCH_THROTTLED_TIME, totalThrottledMs); - measures.record(newTagCtxBuilder().build()); + reportBatchingLatency = true; + batchThrottledLatency += totalThrottledMs; } private TagContextBuilder newTagCtxBuilder() { 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..9a00ddb135 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/NoopMetricsProvider.java @@ -0,0 +1,36 @@ +/* + * 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.common.base.MoreObjects; + +/** + * Set {@link + * com.google.cloud.bigtable.data.v2.BigtableDataSettings.Builder#setMetricsProvider(MetricsProvider)}, + * to {@link this#INSTANCE} to disable collecting and export client side metrics + * https://cloud.google.com/bigtable/docs/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(); + } +} diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/TracedBatcherUnaryCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/TracedBatcherUnaryCallable.java index b7140f0156..ce73d75dc1 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/TracedBatcherUnaryCallable.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/TracedBatcherUnaryCallable.java @@ -21,6 +21,7 @@ import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.api.gax.tracing.ApiTracer; +import org.threeten.bp.Duration; /** * This callable will extract total throttled time from {@link ApiCallContext} and add it to {@link @@ -42,7 +43,8 @@ public ApiFuture futureCall(RequestT request, ApiCallContext context) // this should always be true if (tracer instanceof BigtableTracer) { ((BigtableTracer) tracer) - .batchRequestThrottled(context.getOption(Batcher.THROTTLED_TIME_KEY)); + .batchRequestThrottled( + 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/stub/metrics/Util.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/metrics/Util.java index 00995b717a..4c3fd7a42d 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,11 +15,25 @@ */ package com.google.cloud.bigtable.data.v2.stub.metrics; +import com.google.api.core.InternalApi; +import com.google.api.gax.grpc.GrpcCallContext; +import com.google.api.gax.grpc.GrpcResponseMetadata; import com.google.api.gax.rpc.ApiCallContext; import com.google.api.gax.rpc.ApiException; import com.google.api.gax.rpc.StatusCode; import com.google.api.gax.rpc.StatusCode.Code; +import com.google.bigtable.v2.AuthorizedViewName; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowsRequest; +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.collect.ImmutableMap; +import com.google.protobuf.InvalidProtocolBufferException; +import io.grpc.CallOptions; import io.grpc.Metadata; import io.grpc.Status; import io.grpc.StatusException; @@ -38,7 +52,8 @@ import javax.annotation.Nullable; /** Utilities to help integrating with OpenCensus. */ -class Util { +@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 = @@ -47,15 +62,15 @@ class Util { 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+)"); + static final Metadata.Key LOCATION_METADATA_KEY = + Metadata.Key.of("x-goog-ext-425905942-bin", Metadata.BINARY_BYTE_MARSHALLER); - 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) { + /** Convert an exception into a value that can be used to create an OpenCensus tag value. */ + static String extractStatus(@Nullable Throwable error) { final String statusString; if (error == null) { - return OK_STATUS; + return StatusCode.Code.OK.toString(); } else if (error instanceof CancellationException) { statusString = Status.Code.CANCELLED.toString(); } else if (error instanceof ApiException) { @@ -68,14 +83,14 @@ static TagValue extractStatus(@Nullable Throwable error) { statusString = Code.UNKNOWN.toString(); } - return TagValue.create(statusString); + return statusString; } /** * Await the result of the future and convert it into a value that can be used as an OpenCensus * tag value. */ - static TagValue extractStatus(Future future) { + static TagValue extractStatusFromFuture(Future future) { Throwable error = null; try { @@ -88,7 +103,38 @@ static TagValue extractStatus(Future future) { } catch (RuntimeException e) { error = e; } - return extractStatus(error); + return TagValue.create(extractStatus(error)); + } + + static String extractTableId(Object request) { + String tableName = null; + String authorizedViewName = null; + if (request instanceof ReadRowsRequest) { + tableName = ((ReadRowsRequest) request).getTableName(); + authorizedViewName = ((ReadRowsRequest) request).getAuthorizedViewName(); + } 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(); + } 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(); + } + if (tableName == null && authorizedViewName == null) return "undefined"; + if (tableName.isEmpty() && authorizedViewName.isEmpty()) return "undefined"; + if (!tableName.isEmpty()) { + return TableName.parse(tableName).getTable(); + } else { + return AuthorizedViewName.parse(authorizedViewName).getTable(); + } } /** @@ -108,16 +154,81 @@ static Map> createStatsHeaders(ApiCallContext apiCallContex return headers.build(); } - static Long getGfeLatency(Metadata metadata) { - if (metadata != null && metadata.get(SERVER_TIMING_HEADER_KEY) != null) { - String serverTiming = metadata.get(SERVER_TIMING_HEADER_KEY); - Matcher matcher = SERVER_TIMING_HEADER_PATTERN.matcher(serverTiming); - // this should always be true - if (matcher.find()) { - long latency = Long.valueOf(matcher.group("dur")); - return latency; + private static Long getGfeLatency(@Nullable Metadata metadata) { + if (metadata == null) { + return null; + } + 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()) { + long latency = Long.valueOf(matcher.group("dur")); + return latency; + } + return null; + } + + private static ResponseParams getResponseParams(@Nullable Metadata metadata) { + if (metadata == null) { + return null; + } + byte[] responseParams = metadata.get(Util.LOCATION_METADATA_KEY); + if (responseParams != null) { + try { + return ResponseParams.parseFrom(responseParams); + } catch (InvalidProtocolBufferException e) { } } return null; } + + static void recordMetricsFromMetadata( + GrpcResponseMetadata responseMetadata, BigtableTracer tracer, Throwable throwable) { + Metadata metadata = responseMetadata.getMetadata(); + + // Get the response params from the metadata. Check both headers and trailers + // because in different environments the metadata could be returned in headers or trailers + @Nullable ResponseParams responseParams = getResponseParams(responseMetadata.getMetadata()); + if (responseParams == null) { + responseParams = getResponseParams(responseMetadata.getTrailingMetadata()); + } + // Set tracer locations if response params is not null + if (responseParams != null) { + tracer.setLocations(responseParams.getZoneId(), responseParams.getClusterId()); + } + + // server-timing metric will be added through GrpcResponseMetadata#onHeaders(Metadata), + // so it's not checking trailing metadata here. + @Nullable Long latency = getGfeLatency(metadata); + // For direct path, we won't see GFE server-timing header. However, if we received the + // location info, we know that there isn't a connectivity issue. Set the latency to + // 0 so gfe missing header won't get incremented. + if (responseParams != null && latency == null) { + latency = 0L; + } + // Record gfe metrics + tracer.recordGfeMetadata(latency, throwable); + } + + /** + * This method bridges gRPC stream tracing to bigtable tracing by adding a {@link + * io.grpc.ClientStreamTracer} to the callContext. + */ + static GrpcCallContext injectBigtableStreamTracer( + ApiCallContext context, GrpcResponseMetadata responseMetadata, BigtableTracer tracer) { + if (context instanceof GrpcCallContext) { + GrpcCallContext callContext = (GrpcCallContext) context; + CallOptions callOptions = callContext.getCallOptions(); + return responseMetadata.addHandlers( + callContext.withCallOptions( + callOptions.withStreamTracerFactory(new BigtableGrpcStreamTracer.Factory(tracer)))); + } else { + // context should always be an instance of GrpcCallContext. If not throw an exception + // so we can see what class context is. + throw new RuntimeException("Unexpected context class: " + context.getClass().getName()); + } + } } 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 de2bf6224f..b07e67ba94 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,7 +19,9 @@ 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; @@ -35,6 +37,7 @@ 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; @@ -84,7 +87,7 @@ * *

    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 = @@ -109,19 +112,21 @@ public Object getTransportCode() { @Nullable private List originalIndexes; @Nonnull private final Set retryableCodes; @Nullable 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 +141,19 @@ 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; + this.attemptSettings = retryAlgorithm.createFirstAttempt(); permanentFailures = Lists.newArrayList(); } - public void setExternalFuture(RetryingFuture externalFuture) { + public void setExternalFuture(RetryingFuture externalFuture) { this.externalFuture = externalFuture; } @@ -158,7 +166,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,7 +177,8 @@ 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"); @@ -183,7 +192,7 @@ public Void call() { } // Handle concurrent cancellation - externalFuture.setAttemptFuture(new NonCancellableFuture()); + externalFuture.setAttemptFuture(new NonCancellableFuture<>()); if (externalFuture.isDone()) { return null; } @@ -199,13 +208,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; @@ -227,13 +236,15 @@ private void handleAttemptError(Throwable rpcError) { 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 @@ -246,7 +257,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); } /** @@ -254,17 +266,20 @@ 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(); List newOriginalIndexes = Lists.newArrayList(); + boolean[] seenIndices = new boolean[currentRequest.getEntriesCount()]; for (MutateRowsResponse response : responses) { for (Entry entry : response.getEntriesList()) { + seenIndices[Ints.checkedCast(entry.getIndex())] = true; + if (entry.getStatus().getCode() == Code.OK_VALUE) { continue; } @@ -287,13 +302,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(); } /** @@ -327,10 +363,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/ReadRowsConvertExceptionCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable.java deleted file mode 100644 index 0c58f66441..0000000000 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsConvertExceptionCallable.java +++ /dev/null @@ -1,88 +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 && t.getMessage() != null) { - String error = t.getMessage().toLowerCase(); - if (error.contains("rst_stream") || error.contains("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 index c2584e0c93..2ef26605b4 100644 --- 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 @@ -16,7 +16,12 @@ package com.google.cloud.bigtable.data.v2.stub.readrows; import com.google.api.core.ApiFuture; +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.ServerStreamingCallable; +import com.google.api.gax.rpc.StateCheckingResponseObserver; +import com.google.api.gax.rpc.StreamController; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.bigtable.data.v2.models.Query; @@ -24,15 +29,51 @@ * Enhancement for `readRowsCallable().first()` to gracefully limit the row count instead of * cancelling the RPC */ -class ReadRowsFirstCallable extends UnaryCallable { - private final UnaryCallable inner; +@InternalApi +public class ReadRowsFirstCallable extends UnaryCallable { - ReadRowsFirstCallable(UnaryCallable inner) { + private final ServerStreamingCallable inner; + + public ReadRowsFirstCallable(ServerStreamingCallable inner) { this.inner = inner; } @Override public ApiFuture futureCall(Query query, ApiCallContext context) { - return inner.futureCall(query.limit(1), context); + ReadRowsFirstResponseObserver observer = new ReadRowsFirstResponseObserver<>(); + this.inner.call(query.limit(1), observer, context); + return observer.getFuture(); + } + + private class ReadRowsFirstResponseObserver extends StateCheckingResponseObserver { + private StreamController innerController; + private RowT firstRow; + private SettableApiFuture settableFuture = SettableApiFuture.create(); + + @Override + protected void onStartImpl(StreamController streamController) { + this.innerController = streamController; + } + + @Override + protected void onResponseImpl(RowT response) { + if (firstRow == null) { + this.firstRow = response; + } + } + + @Override + protected void onErrorImpl(Throwable throwable) { + settableFuture.setException(throwable); + } + + @Override + protected void onCompleteImpl() { + settableFuture.set(firstRow); + } + + protected ApiFuture getFuture() { + return settableFuture; + } } } 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..2db46c0c29 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 @@ -85,7 +85,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 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 0b8ebfd90d..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 @@ -61,8 +61,8 @@ public class RowMerger implements Reframer { private final StateMachine stateMachine; private Queue mergedRows; - public RowMerger(RowBuilder rowBuilder) { - stateMachine = new StateMachine<>(rowBuilder); + public RowMerger(RowBuilder rowBuilder, boolean reversed) { + stateMachine = new StateMachine<>(rowBuilder, reversed); mergedRows = new ArrayDeque<>(); } 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..64ac3e29e2 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 */ - StateMachine(RowBuilder adapter) { + StateMachine(RowBuilder adapter, boolean reversed) { this.adapter = adapter; + this.reversed = reversed; reset(); } @@ -249,6 +255,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 +277,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(); @@ -459,9 +490,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..8d0e6b81d0 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallContext.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.InternalApi; +import com.google.api.core.SettableApiFuture; +import com.google.auto.value.AutoValue; +import com.google.bigtable.v2.ExecuteQueryRequest; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; + +/** + * POJO used to provide a future to the ExecuteQuery callable chain in order to return metadata to + * users outside of the stream of rows. + * + *

    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") +@AutoValue +public abstract class ExecuteQueryCallContext { + + @InternalApi("For internal use only") + public static ExecuteQueryCallContext create( + ExecuteQueryRequest request, SettableApiFuture metadataFuture) { + return new AutoValue_ExecuteQueryCallContext(request, metadataFuture); + } + + abstract ExecuteQueryRequest request(); + + abstract SettableApiFuture resultSetMetadataFuture(); +} 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..9563b6c6f9 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallable.java @@ -0,0 +1,66 @@ +/* + * 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.RequestContext; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.Statement; + +/** + * 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; + private final RequestContext requestContext; + + public ExecuteQueryCallable( + ServerStreamingCallable inner, + RequestContext requestContext) { + this.inner = inner; + this.requestContext = requestContext; + } + + public SqlServerStream call(Statement statement) { + ExecuteQueryRequest request = statement.toProto(requestContext); + SettableApiFuture metadataFuture = SettableApiFuture.create(); + ServerStream rowStream = + this.call(ExecuteQueryCallContext.create(request, 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/MetadataResolvingCallable.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataResolvingCallable.java new file mode 100644 index 0000000000..6b2f2b171f --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataResolvingCallable.java @@ -0,0 +1,118 @@ +/* + * 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.ServerStreamingCallable; +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.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.SafeResponseObserver; + +/** + * 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 MetadataResolvingCallable + extends ServerStreamingCallable { + private final ServerStreamingCallable inner; + + public MetadataResolvingCallable( + ServerStreamingCallable inner) { + this.inner = inner; + } + + @Override + public void call( + ExecuteQueryCallContext callContext, + ResponseObserver responseObserver, + ApiCallContext apiCallContext) { + MetadataObserver observer = + new MetadataObserver(responseObserver, callContext.resultSetMetadataFuture()); + inner.call(callContext.request(), observer, apiCallContext); + } + + static final class MetadataObserver extends SafeResponseObserver { + + private final SettableApiFuture metadataFuture; + 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 isFirstResponse; + + MetadataObserver( + ResponseObserver outerObserver, + SettableApiFuture metadataFuture) { + super(outerObserver); + this.outerObserver = outerObserver; + this.metadataFuture = metadataFuture; + this.isFirstResponse = true; + } + + @Override + protected void onStartImpl(StreamController streamController) { + outerObserver.onStart(streamController); + } + + @Override + protected void onResponseImpl(ExecuteQueryResponse response) { + if (isFirstResponse && !response.hasMetadata()) { + IllegalStateException e = + new IllegalStateException("First response must always contain metadata"); + metadataFuture.setException(e); + throw e; + } + isFirstResponse = false; + if (response.hasMetadata()) { + try { + ResultSetMetadata md = ProtoResultSetMetadata.fromProto(response.getMetadata()); + metadataFuture.set(md); + } catch (Throwable t) { + metadataFuture.setException(t); + throw t; + } + } + outerObserver.onResponse(response); + } + + @Override + protected void onErrorImpl(Throwable throwable) { + // When we support retries this will have to move after the retrying callable in a separate + // observer. + metadataFuture.setException(throwable); + outerObserver.onError(throwable); + } + + @Override + protected void onCompleteImpl() { + if (!metadataFuture.isDone()) { + IllegalStateException missingMetadataException = + new IllegalStateException("Unexpected Stream complete without receiving metadata"); + metadataFuture.setException(missingMetadataException); + throw missingMetadataException; + } + 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..deefda4cad --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachine.java @@ -0,0 +1,213 @@ +/* + * 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.protobuf.ByteString; +import com.google.protobuf.InvalidProtocolBufferException; +import java.util.Iterator; +import java.util.List; +import java.util.Queue; + +/** + * 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 + * #hasCompleteBatch()} 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 the first chunk of bytes for a new batch */ + AWAITING_NEW_BATCH, + /** Waiting for the next chunk of bytes, to combine with the bytes currently being buffered. */ + AWAITING_PARTIAL_BATCH, + /** Buffering a complete batch of rows, waiting for populateQueue to be called for the batch */ + AWAITING_BATCH_CONSUME, + } + + private final ResultSetMetadata metadata; + private State state; + private ByteString batchBuffer; + private ProtoRows completeBatch; + + ProtoRowsMergingStateMachine(ResultSetMetadata metadata) { + this.metadata = metadata; + state = State.AWAITING_NEW_BATCH; + batchBuffer = ByteString.empty(); + } + + /** + * 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 + */ + 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"); + // ByteString has an efficient concat which generally involves no copying + batchBuffer = batchBuffer.concat(results.getProtoRowsBatch().getBatchData()); + state = State.AWAITING_PARTIAL_BATCH; + if (results.getResumeToken().isEmpty()) { + return; + } + // A resume token means the batch is complete and safe to yield + // We can receive resume tokens with no new data. In this case we yield an empty batch. + if (batchBuffer.isEmpty()) { + completeBatch = ProtoRows.getDefaultInstance(); + } else { + try { + completeBatch = ProtoRows.parseFrom(batchBuffer); + } catch (InvalidProtocolBufferException e) { + throw new InternalError("Unexpected exception parsing response protobuf", e); + } + } + // Empty buffers can benefit from resetting because ByteString.concat builds a rope + batchBuffer = ByteString.empty(); + state = State.AWAITING_BATCH_CONSUME; + } + + /** Returns true if there is a complete batch buffered, false otherwise */ + boolean hasCompleteBatch() { + return state == State.AWAITING_BATCH_CONSUME; + } + + /** Returns true if there is a partial or complete batch buffered, false otherwise */ + boolean isBatchInProgress() { + return hasCompleteBatch() || state == State.AWAITING_PARTIAL_BATCH; + } + + /** + * Populates the given queue with the complete batch of rows + * + * @throws IllegalStateException if there is not a complete batch + */ + void populateQueue(Queue queue) { + Preconditions.checkState( + state == State.AWAITING_BATCH_CONSUME, + "Attempting to populate Queue from state machine without completed batch"); + Iterator valuesIterator = completeBatch.getValuesList().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())); + } + // reset the batch to be empty + completeBatch = ProtoRows.getDefaultInstance(); + state = State.AWAITING_NEW_BATCH; + } + + @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: + checkExpectedKind(value, Value.KindCase.BYTES_VALUE, type); + break; + case INT64: + 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; + 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..6178a1efcd --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMerger.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.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.ProtoResultSetMetadata; +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; + +/** + * Used to transform a stream of ExecuteQueryResponse objects into rows. This class is not thread + * safe. + */ +@InternalApi +public final class SqlRowMerger implements Reframer { + + enum State { + AWAITING_METADATA, + PROCESSING_DATA, + } + + private final Queue queue; + private ProtoRowsMergingStateMachine stateMachine; + private State currentState; + + public SqlRowMerger() { + queue = new ArrayDeque<>(); + currentState = State.AWAITING_METADATA; + } + + /** + * Used to add responses to the SqlRowMerger as they are received. + * + * @param response the next response in the stream of query responses + */ + // Suppress this because it won't be forced to be exhaustive once it is open-sourced, so we want a + // default. + @SuppressWarnings("UnnecessaryDefaultInEnumSwitch") + @Override + public void push(ExecuteQueryResponse response) { + switch (currentState) { + case AWAITING_METADATA: + Preconditions.checkState( + response.hasMetadata(), + "Expected metadata response, but received: %s", + response.getResponseCase().name()); + ResultSetMetadata responseMetadata = + ProtoResultSetMetadata.fromProto(response.getMetadata()); + stateMachine = new ProtoRowsMergingStateMachine(responseMetadata); + currentState = State.PROCESSING_DATA; + break; + case PROCESSING_DATA: + Preconditions.checkState( + response.hasResults(), + "Expected results response, but received: %s", + response.getResponseCase().name()); + PartialResultSet results = response.getResults(); + processProtoRows(results); + break; + default: + throw new IllegalStateException("Unknown State: " + currentState.name()); + } + } + + private void processProtoRows(PartialResultSet results) { + stateMachine.addPartialResultSet(results); + if (stateMachine.hasCompleteBatch()) { + 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() { + switch (currentState) { + case AWAITING_METADATA: + return false; + case PROCESSING_DATA: + return hasFullFrame() || stateMachine.isBatchInProgress(); + default: + throw new IllegalStateException("Unknown State: " + currentState.name()); + } + } + + /** 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..6d5d0ea4a4 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallable.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.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.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(); + 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/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..3599e1e4df --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/AttemptCallable.java @@ -0,0 +1,84 @@ +/* + * 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; +import org.threeten.bp.Duration; + +// 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. + Duration rpcTimeout = externalFuture.getAttemptSettings().getRpcTimeout(); + if (!rpcTimeout.isZero() && callContext.getTimeout() == null) { + callContext = callContext.withTimeout(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..a78e7643b0 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/Callables.java @@ -0,0 +1,76 @@ +/* + * 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()); + } +} 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..085b48bbb5 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryInfoRetryAlgorithm.java @@ -0,0 +1,102 @@ +/* + * 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 org.checkerframework.checker.nullness.qual.Nullable; +import org.threeten.bp.Duration; + +// 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) { + Duration retryDelay = extractRetryDelay(prevThrowable); + if (retryDelay != null) { + return prevSettings + .toBuilder() + .setRandomizedRetryDelay(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(); + } + + @Nullable + static 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 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..d78bf08322 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/RetryingCallable.java @@ -0,0 +1,58 @@ +/* + * 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 = (ApiCallContext) Preconditions.checkNotNull(callContextPrototype); + this.callable = (UnaryCallable) Preconditions.checkNotNull(callable); + this.executor = (RetryingExecutorWithContext) Preconditions.checkNotNull(executor); + } + + 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; + } + + 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..793cf2e91c --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/retrying/ServerStreamingAttemptCallable.java @@ -0,0 +1,366 @@ +/* + * 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.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 (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..5b9d183faa --- /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,4133 @@ +[ + { + "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.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.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.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.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.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.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.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.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.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.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$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$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$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$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.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.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$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$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$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$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..7114460ddb --- /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,3107 @@ +[ + { + "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.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.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.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.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.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$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$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$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$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.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$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$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$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$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/admin/v2/BaseBigtableInstanceAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java index 9224e041f8..4e5ab28356 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 2021 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. @@ -17,6 +17,7 @@ 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 com.google.api.gax.core.NoCredentialsProvider; import com.google.api.gax.grpc.GaxGrpcProperties; @@ -40,12 +41,15 @@ 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.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.LocationName; @@ -55,6 +59,7 @@ import com.google.bigtable.admin.v2.StorageType; import com.google.bigtable.admin.v2.UpdateAppProfileRequest; 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; @@ -132,6 +137,7 @@ public void createInstanceTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -191,6 +197,7 @@ public void createInstanceTest2() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -250,6 +257,7 @@ public void getInstanceTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -291,6 +299,7 @@ public void getInstanceTest2() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -412,6 +421,7 @@ public void updateInstanceTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -421,6 +431,7 @@ public void updateInstanceTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); Instance actualResponse = client.updateInstance(request); @@ -436,6 +447,7 @@ public void updateInstanceTest() throws Exception { 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.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -454,6 +466,7 @@ public void updateInstanceExceptionTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); client.updateInstance(request); Assert.fail("No exception raised"); @@ -470,6 +483,7 @@ public void partialUpdateInstanceTest() throws Exception { .setDisplayName("displayName1714148973") .putAllLabels(new HashMap()) .setCreateTime(Timestamp.newBuilder().build()) + .setSatisfiesPzs(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -897,6 +911,7 @@ 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()); @@ -1436,11 +1451,12 @@ public void getIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); Policy actualResponse = client.getIamPolicy(resource); Assert.assertEquals(expectedResponse, actualResponse); @@ -1462,7 +1478,7 @@ public void getIamPolicyExceptionTest() throws Exception { mockBigtableInstanceAdmin.addException(exception); try { - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); client.getIamPolicy(resource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1476,6 +1492,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -1516,11 +1533,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 = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); Policy policy = Policy.newBuilder().build(); Policy actualResponse = client.setIamPolicy(resource, policy); @@ -1544,7 +1562,7 @@ public void setIamPolicyExceptionTest() throws Exception { mockBigtableInstanceAdmin.addException(exception); try { - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); Policy policy = Policy.newBuilder().build(); client.setIamPolicy(resource, policy); Assert.fail("No exception raised"); @@ -1559,6 +1577,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -1602,7 +1621,7 @@ public void testIamPermissionsTest() throws Exception { TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); List permissions = new ArrayList<>(); TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); @@ -1626,7 +1645,7 @@ public void testIamPermissionsExceptionTest() throws Exception { mockBigtableInstanceAdmin.addException(exception); try { - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = InstanceName.of("[PROJECT]", "[INSTANCE]"); List permissions = new ArrayList<>(); client.testIamPermissions(resource, permissions); Assert.fail("No exception raised"); @@ -1673,4 +1692,92 @@ 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. + } + } } 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 56071484f4..95cd5022ff 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 2021 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. @@ -16,6 +16,7 @@ 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.ListSnapshotsPagedResponse; import static com.google.cloud.bigtable.admin.v2.BaseBigtableTableAdminClient.ListTablesPagedResponse; @@ -29,16 +30,21 @@ 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.AppProfileName; +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.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.DeleteSnapshotRequest; import com.google.bigtable.admin.v2.DeleteTableRequest; @@ -46,10 +52,13 @@ 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.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.ListSnapshotsRequest; @@ -64,8 +73,12 @@ 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.UndeleteTableRequest; +import com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest; import com.google.bigtable.admin.v2.UpdateBackupRequest; +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; @@ -141,6 +154,8 @@ public void createTableTest() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -188,6 +203,8 @@ public void createTableTest2() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -235,6 +252,8 @@ public void createTableFromSnapshotTest() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -294,6 +313,8 @@ public void createTableFromSnapshotTest2() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -351,6 +372,8 @@ public void createTableFromSnapshotTest3() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -410,6 +433,8 @@ public void createTableFromSnapshotTest4() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -555,6 +580,8 @@ public void getTableTest() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -596,6 +623,8 @@ public void getTableTest2() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -629,18 +658,589 @@ 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) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + Table table = Table.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Table actualResponse = client.updateTableAsync(table, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateTableRequest actualRequest = ((UpdateTableRequest) actualRequests.get(0)); + + Assert.assertEquals(table, actualRequest.getTable()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + Table table = Table.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateTableAsync(table, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void deleteTableTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockBigtableTableAdmin.addResponse(expectedResponse); - TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + client.deleteTable(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTableRequest actualRequest = ((DeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.deleteTable(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTableTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteTable(name); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTableRequest actualRequest = ((DeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.deleteTable(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void undeleteTableTest() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + Table actualResponse = client.undeleteTableAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteTableRequest actualRequest = ((UndeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteTableExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.undeleteTableAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void undeleteTableTest2() throws Exception { + Table expectedResponse = + Table.newBuilder() + .setName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .putAllClusterStates(new HashMap()) + .putAllColumnFamilies(new HashMap()) + .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("undeleteTableTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String name = "name3373707"; + + Table actualResponse = client.undeleteTableAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteTableRequest actualRequest = ((UndeleteTableRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteTableExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.undeleteTableAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + + AuthorizedView actualResponse = + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAuthorizedViewRequest actualRequest = + ((CreateAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(authorizedViewId, actualRequest.getAuthorizedViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createAuthorizedViewTest2() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createAuthorizedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + + AuthorizedView actualResponse = + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAuthorizedViewRequest actualRequest = + ((CreateAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(authorizedViewId, actualRequest.getAuthorizedViewId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAuthorizedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + String authorizedViewId = "authorizedViewId-2074136549"; + client.createAuthorizedViewAsync(parent, authorizedView, authorizedViewId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listAuthorizedViewsTest() throws Exception { + AuthorizedView responsesElement = AuthorizedView.newBuilder().build(); + ListAuthorizedViewsResponse expectedResponse = + ListAuthorizedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizedViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + + ListAuthorizedViewsPagedResponse pagedListResponse = client.listAuthorizedViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizedViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAuthorizedViewsRequest actualRequest = ((ListAuthorizedViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAuthorizedViewsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + TableName parent = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + client.listAuthorizedViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAuthorizedViewsTest2() throws Exception { + AuthorizedView responsesElement = AuthorizedView.newBuilder().build(); + ListAuthorizedViewsResponse expectedResponse = + ListAuthorizedViewsResponse.newBuilder() + .setNextPageToken("") + .addAllAuthorizedViews(Arrays.asList(responsesElement)) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAuthorizedViewsPagedResponse pagedListResponse = client.listAuthorizedViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAuthorizedViewsList().get(0), resources.get(0)); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAuthorizedViewsRequest actualRequest = ((ListAuthorizedViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAuthorizedViewsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + client.listAuthorizedViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + + AuthorizedView actualResponse = client.getAuthorizedView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAuthorizedViewRequest actualRequest = ((GetAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.getAuthorizedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getAuthorizedViewTest2() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + String name = "name3373707"; + + AuthorizedView actualResponse = client.getAuthorizedView(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAuthorizedViewRequest actualRequest = ((GetAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAuthorizedViewExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String name = "name3373707"; + client.getAuthorizedView(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateAuthorizedViewTest() throws Exception { + AuthorizedView expectedResponse = + AuthorizedView.newBuilder() + .setName( + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]") + .toString()) + .setEtag("etag3123477") + .setDeletionProtection(true) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateAuthorizedViewTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + AuthorizedView actualResponse = + client.updateAuthorizedViewAsync(authorizedView, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateAuthorizedViewRequest actualRequest = + ((UpdateAuthorizedViewRequest) actualRequests.get(0)); + + Assert.assertEquals(authorizedView, actualRequest.getAuthorizedView()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateAuthorizedViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + AuthorizedView authorizedView = AuthorizedView.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateAuthorizedViewAsync(authorizedView, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteAuthorizedViewTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockBigtableTableAdmin.addResponse(expectedResponse); + + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); - client.deleteTable(name); + client.deleteAuthorizedView(name); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteTableRequest actualRequest = ((DeleteTableRequest) actualRequests.get(0)); + DeleteAuthorizedViewRequest actualRequest = + ((DeleteAuthorizedViewRequest) actualRequests.get(0)); Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( @@ -650,13 +1250,14 @@ public void deleteTableTest() throws Exception { } @Test - public void deleteTableExceptionTest() throws Exception { + public void deleteAuthorizedViewExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { - TableName name = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); - client.deleteTable(name); + AuthorizedViewName name = + AuthorizedViewName.of("[PROJECT]", "[INSTANCE]", "[TABLE]", "[AUTHORIZED_VIEW]"); + client.deleteAuthorizedView(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -664,17 +1265,18 @@ public void deleteTableExceptionTest() throws Exception { } @Test - public void deleteTableTest2() throws Exception { + public void deleteAuthorizedViewTest2() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockBigtableTableAdmin.addResponse(expectedResponse); String name = "name3373707"; - client.deleteTable(name); + client.deleteAuthorizedView(name); List actualRequests = mockBigtableTableAdmin.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteTableRequest actualRequest = ((DeleteTableRequest) actualRequests.get(0)); + DeleteAuthorizedViewRequest actualRequest = + ((DeleteAuthorizedViewRequest) actualRequests.get(0)); Assert.assertEquals(name, actualRequest.getName()); Assert.assertTrue( @@ -684,13 +1286,13 @@ public void deleteTableTest2() throws Exception { } @Test - public void deleteTableExceptionTest2() throws Exception { + public void deleteAuthorizedViewExceptionTest2() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockBigtableTableAdmin.addException(exception); try { String name = "name3373707"; - client.deleteTable(name); + client.deleteAuthorizedView(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { // Expected exception. @@ -705,6 +1307,8 @@ public void modifyColumnFamiliesTest() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -750,6 +1354,8 @@ public void modifyColumnFamiliesTest2() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -1484,11 +2090,13 @@ public void createBackupTest() throws Exception { 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() @@ -1542,11 +2150,13 @@ public void createBackupTest2() throws Exception { 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() @@ -1600,11 +2210,13 @@ public void getBackupTest() throws Exception { 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); @@ -1644,11 +2256,13 @@ public void getBackupTest2() throws Exception { 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); @@ -1688,11 +2302,13 @@ public void updateBackupTest() throws Exception { 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); @@ -1893,6 +2509,8 @@ public void restoreTableTest() throws Exception { .putAllClusterStates(new HashMap()) .putAllColumnFamilies(new HashMap()) .setRestoreInfo(RestoreInfo.newBuilder().build()) + .setChangeStreamConfig(ChangeStreamConfig.newBuilder().build()) + .setDeletionProtection(true) .build(); Operation resultOperation = Operation.newBuilder() @@ -1944,17 +2562,274 @@ public void restoreTableExceptionTest() throws Exception { } } + @Test + public void copyBackupTest() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup.toString(), actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest2() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup, actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + ClusterName parent = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]"); + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest3() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup.toString(), actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + BackupName sourceBackup = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void copyBackupTest4() throws Exception { + Backup expectedResponse = + Backup.newBuilder() + .setName(BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]").toString()) + .setSourceTable("sourceTable-95372173") + .setSourceBackup("sourceBackup823134653") + .setExpireTime(Timestamp.newBuilder().build()) + .setStartTime(Timestamp.newBuilder().build()) + .setEndTime(Timestamp.newBuilder().build()) + .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) + .setHotToStandardTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyBackupTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockBigtableTableAdmin.addResponse(resultOperation); + + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + + Backup actualResponse = + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockBigtableTableAdmin.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyBackupRequest actualRequest = ((CopyBackupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(backupId, actualRequest.getBackupId()); + Assert.assertEquals(sourceBackup, actualRequest.getSourceBackup()); + Assert.assertEquals(expireTime, actualRequest.getExpireTime()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyBackupExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockBigtableTableAdmin.addException(exception); + + try { + String parent = "parent-995424086"; + String backupId = "backupId2121930365"; + String sourceBackup = "sourceBackup823134653"; + Timestamp expireTime = Timestamp.newBuilder().build(); + client.copyBackupAsync(parent, backupId, sourceBackup, expireTime).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + @Test public void getIamPolicyTest() throws Exception { Policy expectedResponse = Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); Policy actualResponse = client.getIamPolicy(resource); Assert.assertEquals(expectedResponse, actualResponse); @@ -1976,7 +2851,7 @@ public void getIamPolicyExceptionTest() throws Exception { mockBigtableTableAdmin.addException(exception); try { - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); client.getIamPolicy(resource); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { @@ -1990,6 +2865,7 @@ public void getIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -2030,11 +2906,12 @@ public void setIamPolicyTest() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); Policy policy = Policy.newBuilder().build(); Policy actualResponse = client.setIamPolicy(resource, policy); @@ -2058,7 +2935,7 @@ public void setIamPolicyExceptionTest() throws Exception { mockBigtableTableAdmin.addException(exception); try { - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); Policy policy = Policy.newBuilder().build(); client.setIamPolicy(resource, policy); Assert.fail("No exception raised"); @@ -2073,6 +2950,7 @@ public void setIamPolicyTest2() throws Exception { Policy.newBuilder() .setVersion(351608024) .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) .setEtag(ByteString.EMPTY) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -2116,7 +2994,7 @@ public void testIamPermissionsTest() throws Exception { TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); mockBigtableTableAdmin.addResponse(expectedResponse); - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); List permissions = new ArrayList<>(); TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); @@ -2140,7 +3018,7 @@ public void testIamPermissionsExceptionTest() throws Exception { mockBigtableTableAdmin.addException(exception); try { - ResourceName resource = AppProfileName.of("[PROJECT]", "[INSTANCE]", "[APP_PROFILE]"); + ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[BACKUP]"); List permissions = new ArrayList<>(); client.testIamPermissions(resource, permissions); Assert.fail("No exception raised"); 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/BigtableInstanceAdminClientTests.java similarity index 90% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTest.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClientTests.java index 8a21f95c1a..d8522db71a 100644 --- 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/BigtableInstanceAdminClientTests.java @@ -43,6 +43,8 @@ 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; @@ -81,7 +83,12 @@ import org.mockito.stubbing.Answer; @RunWith(JUnit4.class) -public class BigtableInstanceAdminClientTest { +/** + * 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). + */ +public class BigtableInstanceAdminClientTests { @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN); private static final String PROJECT_ID = "my-project"; @@ -108,7 +115,10 @@ public class BigtableInstanceAdminClientTest { .setMinServeNodes(2) .build()) .setAutoscalingTargets( - AutoscalingTargets.newBuilder().setCpuUtilizationPercent(22).build())) + AutoscalingTargets.newBuilder() + .setCpuUtilizationPercent(22) + .setStorageUtilizationGibPerNode(3000) + .build())) .build(); @Mock private BigtableInstanceAdminStub mockStub; @@ -570,7 +580,8 @@ public void testCreateClusterAutoscaling() { ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) .setMinNodes(2) .setMaxNodes(10) - .setCpuUtilizationTargetPercent(22)) + .setCpuUtilizationTargetPercent(22) + .setStorageUtilizationGibPerNode(3000)) .setStorageType(StorageType.SSD)); // Verify assertThat(actualResult).isEqualTo(Cluster.fromProto(expectedResponse)); @@ -754,6 +765,8 @@ public void testPartialUpdateCluster() { "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(); @@ -771,6 +784,7 @@ public void testPartialUpdateCluster() { ClusterAutoscalingConfig.of(INSTANCE_ID, CLUSTER_ID) .setMaxNodes(10) .setMinNodes(2) + .setStorageUtilizationGibPerNode(3000) .setCpuUtilizationTargetPercent(22)); // Verify @@ -971,6 +985,55 @@ public void testCreateAppProfileAddMultipleClusterIdsWithList() { 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 testGetAppProfile() { // Setup @@ -1089,6 +1152,47 @@ public void testUpdateAppProfile() { 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 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..7ac632f29b 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 @@ -144,7 +144,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) { 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/BigtableTableAdminClientTests.java similarity index 55% rename from google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java rename to google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java index 6e6b445758..3cf3ded747 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BigtableTableAdminClientTests.java @@ -27,9 +27,13 @@ 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.DeleteBackupRequest; import com.google.bigtable.admin.v2.DeleteTableRequest; @@ -45,22 +49,33 @@ 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.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.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.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.RestoreTableRequest; import com.google.cloud.bigtable.admin.v2.models.RestoredTableResult; +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.stub.EnhancedBigtableTableAdminStub; import com.google.common.collect.ImmutableList; @@ -68,7 +83,9 @@ import com.google.common.io.BaseEncoding; import com.google.longrunning.Operation; 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; @@ -91,7 +108,12 @@ import org.threeten.bp.Instant; @RunWith(JUnit4.class) -public class BigtableTableAdminClientTest { +/** + * 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). + */ +public class BigtableTableAdminClientTests { @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); private static final String PROJECT_ID = "my-project"; @@ -99,6 +121,7 @@ public class BigtableTableAdminClientTest { 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 INSTANCE_NAME = NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID); private static final String TABLE_NAME = @@ -112,6 +135,13 @@ public class BigtableTableAdminClientTest { 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, @@ -127,6 +157,8 @@ public class BigtableTableAdminClientTest { @Mock private UnaryCallable mockDropRowRangeCallable; @Mock private UnaryCallable mockAwaitReplicationCallable; + @Mock private UnaryCallable mockAwaitConsistencyCallable; + @Mock private OperationCallable< com.google.bigtable.admin.v2.CreateBackupRequest, @@ -157,6 +189,42 @@ public class BigtableTableAdminClientTest { 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 UnaryCallable mockGetIamPolicyCallable; @@ -184,6 +252,32 @@ public void testCreateTable() { 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 = @@ -193,12 +287,52 @@ public void testCreateTable() { .thenReturn(ApiFutures.immediateFuture(expectedResponse)); // Execute - Table result = adminClient.createTable(CreateTableRequest.of(TABLE_ID)); + 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 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)); + } + @Test public void testModifyFamilies() { // Setup @@ -211,6 +345,13 @@ public void testModifyFamilies() { 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 = @@ -218,6 +359,12 @@ public void testModifyFamilies() { .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)) @@ -225,7 +372,10 @@ public void testModifyFamilies() { // Execute Table actualResult = - adminClient.modifyFamilies(ModifyColumnFamiliesRequest.of(TABLE_ID).addFamily("cf")); + adminClient.modifyFamilies( + ModifyColumnFamiliesRequest.of(TABLE_ID) + .addFamily("cf") + .addFamily("cf2", Type.int64Sum())); // Verify assertThat(actualResult).isEqualTo(Table.fromProto(fakeResponse)); @@ -312,7 +462,7 @@ public void testGetEncryptionInfos() { Map> actualResult = adminClient.getEncryptionInfo(TABLE_ID); - // Verify that the encryption info is transfered from the proto to the model. + // Verify that the encryption info is transferred from the proto to the model. assertThat(actualResult) .containsExactly( "cluster1", ImmutableList.of(EncryptionInfo.fromProto(expectedEncryptionInfo))); @@ -419,6 +569,30 @@ public void testAwaitReplication() { 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 @@ -468,7 +642,9 @@ public void testCreateBackup() { Timestamp expireTime = Timestamp.newBuilder().setSeconds(789).build(); long sizeBytes = 123456789; CreateBackupRequest req = - CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID).setSourceTableId(TABLE_ID); + CreateBackupRequest.of(CLUSTER_ID, BACKUP_ID) + .setSourceTableId(TABLE_ID) + .setExpireTime(Instant.ofEpochMilli(Timestamps.toMillis(expireTime))); mockOperationResult( mockCreateBackupOperationCallable, req.toProto(PROJECT_ID, INSTANCE_ID), @@ -501,6 +677,61 @@ public void testCreateBackup() { 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 @@ -527,6 +758,7 @@ public void testGetBackup() { .setEndTime(endTime) .setSizeBytes(sizeBytes) .setState(state) + .setBackupType(com.google.bigtable.admin.v2.Backup.BackupType.STANDARD) .build())); // Execute @@ -543,6 +775,7 @@ public void testGetBackup() { .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 @@ -551,6 +784,7 @@ public void testUpdateBackup() { 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))) @@ -562,6 +796,7 @@ public void testUpdateBackup() { .setSourceTable(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) .setExpireTime(expireTime) .setSizeBytes(sizeBytes) + .setHotToStandardTime(hotToStandardTime) .build())); // Execute @@ -572,6 +807,8 @@ public void testUpdateBackup() { 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); } @@ -608,6 +845,54 @@ public void testRestoreTable() throws ExecutionException, InterruptedException { 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 @@ -678,6 +963,294 @@ public void testListBackups() { 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 testGetBackupIamPolicy() { // Setup 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..506f73700b 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,6 +24,9 @@ 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; @@ -130,6 +133,19 @@ public void testStubSettings() throws IOException { "deleteBackupSettings", "restoreTableSettings", "restoreTableOperationSettings", + "undeleteTableSettings", + "undeleteTableOperationSettings", + "updateTableSettings", + "updateTableOperationSettings", + "copyBackupSettings", + "copyBackupOperationSettings", + "createAuthorizedViewSettings", + "createAuthorizedViewOperationSettings", + "updateAuthorizedViewSettings", + "updateAuthorizedViewOperationSettings", + "deleteAuthorizedViewSettings", + "listAuthorizedViewsSettings", + "getAuthorizedViewSettings", }; @Test @@ -155,17 +171,17 @@ public void testToString() throws IOException { 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 +195,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/MockBigtableInstanceAdmin.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdmin.java index 066a7dd6aa..ffefe14a16 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 2021 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. 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 2cd36279e7..4a7e35e96a 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 2021 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. @@ -34,6 +34,8 @@ 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.PartialUpdateClusterRequest; @@ -499,4 +501,25 @@ public void testIamPermissions( 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()))); + } + } } 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 f0cdb09950..2b48974975 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 2021 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. 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 cb5d6947c7..98b5850479 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 2021 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. @@ -17,22 +17,29 @@ 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.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.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.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.ListSnapshotsRequest; @@ -44,7 +51,10 @@ 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.UpdateTableRequest; import com.google.iam.v1.GetIamPolicyRequest; import com.google.iam.v1.Policy; import com.google.iam.v1.SetIamPolicyRequest; @@ -174,6 +184,26 @@ public void getTable(GetTableRequest request, StreamObserver

    responseObse } } + @Override + public void updateTable(UpdateTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void deleteTable(DeleteTableRequest request, StreamObserver responseObserver) { Object response = responses.poll(); @@ -194,6 +224,133 @@ public void deleteTable(DeleteTableRequest request, StreamObserver respon } } + @Override + public void undeleteTable( + UndeleteTableRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UndeleteTable, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createAuthorizedView( + CreateAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateAuthorizedView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listAuthorizedViews( + ListAuthorizedViewsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListAuthorizedViewsResponse) { + requests.add(request); + responseObserver.onNext(((ListAuthorizedViewsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAuthorizedViews, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListAuthorizedViewsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getAuthorizedView( + GetAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AuthorizedView) { + requests.add(request); + responseObserver.onNext(((AuthorizedView) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAuthorizedView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + AuthorizedView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateAuthorizedView( + UpdateAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateAuthorizedView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteAuthorizedView( + DeleteAuthorizedViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAuthorizedView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + @Override public void modifyColumnFamilies( ModifyColumnFamiliesRequest request, StreamObserver
    responseObserver) { @@ -484,6 +641,26 @@ public void restoreTable( } } + @Override + public void copyBackup(CopyBackupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CopyBackup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + @Override public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { Object response = responses.poll(); 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..7622ce5dfa 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 @@ -17,6 +17,8 @@ import static com.google.common.truth.Truth.assertThat; +import com.google.cloud.bigtable.data.v2.models.AuthorizedViewId; +import com.google.cloud.bigtable.data.v2.models.TableId; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -45,4 +47,78 @@ 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 extractAuthorizedViewIdFromAuthorizedViewNameTest() { + String testAuthorizedViewName = + "projects/my-project/instances/my-instance/tables/my-table/authorizedViews/my-authorized-view"; + + assertThat(NameUtil.extractAuthorizedViewIdFromAuthorizedViewName(testAuthorizedViewName)) + .isEqualTo("my-authorized-view"); + + exception.expect(IllegalArgumentException.class); + NameUtil.extractAuthorizedViewIdFromAuthorizedViewName("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"); + + exception.expect(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"); + + exception.expect(IllegalArgumentException.class); + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTableNameFromAuthorizedViewName( + "bad-format"); + } + + @Test + public void testExtractTargetId() { + 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")); + + exception.expect(IllegalArgumentException.class); + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId("", ""); + + exception.expect(IllegalArgumentException.class); + com.google.cloud.bigtable.data.v2.internal.NameUtil.extractTargetId( + testTableName, testAuthorizedViewName); + } } 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..eb23e0325a --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/it/BigtableAuthorizedViewIT.java @@ -0,0 +1,275 @@ +/* + * 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.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.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 int[] 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 { + String tableId = + PrefixGenerator.newPrefix("BigtableAuthorizedViewIT#createAndPopulateTestTable"); + Table testTable = tableAdmin.createTable(CreateTableRequest.of(tableId).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++) { + 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 c9032b99b3..465bf2d467 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,15 +18,16 @@ 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.gax.batching.Batcher; -import com.google.api.gax.rpc.ApiException; +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; @@ -43,13 +44,13 @@ import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import com.google.common.base.Stopwatch; import com.google.protobuf.ByteString; -import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.List; import java.util.Random; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.logging.Level; import java.util.logging.Logger; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -71,14 +72,17 @@ public class BigtableBackupIT { private static final int[] BACKOFF_DURATION = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}; private static BigtableTableAdminClient tableAdmin; + private static BigtableTableAdminClient tableAdminHot; private static BigtableInstanceAdminClient instanceAdmin; private static BigtableDataClient dataClient; private static String targetCluster; + private static String targetClusterHot; private static Table testTable; + private static Table testTableHot; @BeforeClass - public static void setUpClass() throws InterruptedException { + public static void setUpClass() throws InterruptedException, IOException { assume() .withMessage("BigtableInstanceAdminClient is not supported on Emulator") .that(testEnvRule.env()) @@ -90,6 +94,26 @@ public static void setUpClass() throws InterruptedException { targetCluster = testEnvRule.env().getPrimaryClusterId(); testTable = createAndPopulateTestTable(tableAdmin, dataClient); + + String newInstanceId = PrefixGenerator.newPrefix("backupIT"); + targetClusterHot = newInstanceId + "-c1"; + + instanceAdmin.createInstance( + CreateInstanceRequest.of(newInstanceId) + .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 @@ -103,6 +127,20 @@ public static void tearDownClass() { } } + private static void deleteBackupIgnoreErrors( + BigtableTableAdminClient tableAdmin, String clusterId, String backupId) { + try { + tableAdmin.deleteBackup(clusterId, backupId); + } catch (DeadlineExceededException ex) { + LOGGER.log(Level.WARNING, "Error deleting backup", ex); + // Don't rethrow + } + } + + private void deleteBackupIgnoreErrors(String clusterId, String backupId) { + deleteBackupIgnoreErrors(tableAdmin, clusterId, backupId); + } + @Test public void createAndGetBackupTest() { String backupId = prefixGenerator.newPrefix(); @@ -145,7 +183,67 @@ public void createAndGetBackupTest() { .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); } } @@ -165,50 +263,45 @@ public void listBackupTest() { .that(response) .containsAtLeast(backupId1, backupId2); } finally { - tableAdmin.deleteBackup(targetCluster, backupId1); - tableAdmin.deleteBackup(targetCluster, backupId2); + deleteBackupIgnoreErrors(targetCluster, backupId1); + deleteBackupIgnoreErrors(targetCluster, backupId2); } } @Test public void updateBackupTest() { String backupId = prefixGenerator.newPrefix(); - tableAdmin.createBackup(createBackupRequest(backupId)); + 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 { + 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 @@ -239,7 +332,7 @@ public void restoreTableTest() throws InterruptedException, ExecutionException { .isEqualTo(restoredTableId); } } finally { - tableAdmin.deleteBackup(targetCluster, backupId); + deleteBackupIgnoreErrors(targetCluster, backupId); tableAdmin.deleteTable(restoredTableId); } } @@ -297,12 +390,110 @@ public void crossInstanceRestoreTest() destTableAdmin.awaitOptimizeRestoredTable(result.getOptimizeRestoredTableOperationToken()); destTableAdmin.getTable(restoredTableId); } finally { - tableAdmin.deleteBackup(targetCluster, backupId); + 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(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(); @@ -331,7 +522,7 @@ public void backupIamTest() { "bigtable.backups.restore"); assertThat(permissions).hasSize(4); } finally { - tableAdmin.deleteBackup(targetCluster, backupId); + deleteBackupIgnoreErrors(targetCluster, backupId); } } 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 fcb9c36b62..76413165bd 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 @@ -37,7 +37,6 @@ import com.google.cloud.bigtable.test_helpers.env.PrefixGenerator; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import java.util.List; -import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -192,6 +191,94 @@ public void appProfileTestMultiClusterWithIds() { } } + @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(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(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 iamUpdateTest() { Policy policy = client.getIamPolicy(instanceId); @@ -307,7 +394,8 @@ public void createClusterWithAutoscalingTest() { ClusterAutoscalingConfig.of(newInstanceId, clusterId) .setMaxNodes(4) .setMinNodes(1) - .setCpuUtilizationTargetPercent(20)); + .setCpuUtilizationTargetPercent(20) + .setStorageUtilizationGibPerNode(9200)); Cluster cluster = client.createCluster(createClusterRequest); assertThat(cluster.getId()).contains(clusterId); @@ -315,8 +403,7 @@ public void createClusterWithAutoscalingTest() { assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(1); assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(4); assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(20); - } catch (Exception e) { - Assert.fail("error in the test" + e.getMessage()); + assertThat(cluster.getStorageUtilizationGibPerNode()).isEqualTo(9200); } finally { client.deleteInstance(newInstanceId); } @@ -343,6 +430,7 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { ClusterAutoscalingConfig.of("ignored", clusterId) .setMaxNodes(4) .setMinNodes(1) + .setStorageUtilizationGibPerNode(2561) .setCpuUtilizationTargetPercent(20)); Cluster cluster = client.createCluster(createClusterRequest); @@ -351,6 +439,14 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { 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); Cluster updatedCluster = client.updateClusterAutoscalingConfig( @@ -358,6 +454,13 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { 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 = client.updateClusterAutoscalingConfig( @@ -365,6 +468,13 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { 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 = client.updateClusterAutoscalingConfig( @@ -373,6 +483,13 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { 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 = client.updateClusterAutoscalingConfig( @@ -382,8 +499,44 @@ public void createClusterWithAutoscalingAndPartialUpdateTest() { assertThat(updatedCluster.getAutoscalingMinServeNodes()).isEqualTo(2); assertThat(updatedCluster.getAutoscalingMaxServeNodes()).isEqualTo(5); assertThat(updatedCluster.getAutoscalingCpuPercentageTarget()).isEqualTo(45); - } catch (Exception e) { - Assert.fail("error in the test: " + e.getMessage()); + 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 = + client.updateClusterAutoscalingConfig( + 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 = + client.updateClusterAutoscalingConfig( + 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); } @@ -414,8 +567,7 @@ public void createClusterWithManualScalingTest() { assertThat(cluster.getAutoscalingMaxServeNodes()).isEqualTo(0); assertThat(cluster.getAutoscalingMinServeNodes()).isEqualTo(0); assertThat(cluster.getAutoscalingCpuPercentageTarget()).isEqualTo(0); - } catch (Exception e) { - Assert.fail("error in the test: " + e.getMessage()); + assertThat(cluster.getStorageUtilizationGibPerNode()).isEqualTo(0); } finally { client.deleteInstance(newInstanceId); } @@ -447,16 +599,19 @@ private void basicClusterOperationTestHelper(String targetInstanceId, String tar 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); } } 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 65035c1184..cfcc8d0b42 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,6 +36,7 @@ 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; @@ -44,6 +47,7 @@ import org.junit.After; import org.junit.Before; import org.junit.ClassRule; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -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 @@ -191,6 +229,23 @@ public void awaitReplication() { tableAdmin.awaitReplication(tableId); } + /** + * Note: Data Boost consistency is essentially a check that the data you are trying to read was + * written at least 35 minutes ago. The test thus takes ~35 minutes, and we should add a separate + * profile to run this concurrently with the other tests. + */ + @Test + @Ignore + public void awaitDataBoostConsistency() { + assume() + .withMessage("Data Boost consistency not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + tableAdmin.createTable(CreateTableRequest.of(tableId)); + ConsistencyRequest consistencyRequest = ConsistencyRequest.forDataBoost(tableId); + tableAdmin.awaitConsistency(consistencyRequest); + } + @Test public void iamUpdateTest() { assume() 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 64f334bb09..8215e5f8fc 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,9 @@ 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; @@ -89,6 +91,33 @@ public void testFromProtoWithMultiClusterWithIds() { .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; @@ -126,6 +155,11 @@ public void testEquals() { 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()); @@ -143,6 +177,11 @@ public void testEquals() { 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); @@ -161,6 +200,11 @@ public void testHashCode() { 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()); @@ -178,6 +222,11 @@ public void testHashCode() { 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); @@ -185,4 +234,61 @@ public void testHashCode() { 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)); + } } 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..6eace3ee97 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/AuthorizedViewTest.java @@ -0,0 +1,184 @@ +/* + * 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( + 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 fe73c5588c..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 @@ -48,33 +48,59 @@ 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 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..cc039d7d80 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/ConsistencyRequestTest.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.CheckConsistencyRequest; +import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; +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().equals(TABLE_ID)); + assertThat(checkConsistencyRequest.getConsistencyToken().equals(CONSISTENCY_TOKEN)); + assertThat( + checkConsistencyRequest + .getModeCase() + .equals(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().equals(TABLE_ID)); + assertThat(checkConsistencyRequest.getConsistencyToken().equals(CONSISTENCY_TOKEN)); + assertThat( + checkConsistencyRequest + .getModeCase() + .equals(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().equals(TABLE_ID)); + } +} 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..088dc2bcfe 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,31 @@ 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()); + } } 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/CreateTableRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/CreateTableRequestTest.java index b12b3f24b7..0f7a58c078 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,8 @@ public void testToProto() { .addFamily("family-id") .addFamily("another-family", GCRULES.maxAge(100, TimeUnit.HOURS)) .addSplit(splitKey) - .addSplit(secondSplitKey); + .addSplit(secondSplitKey) + .addChangeStreamRetention(Duration.ofHours(24)); com.google.bigtable.admin.v2.CreateTableRequest requestProto = com.google.bigtable.admin.v2.CreateTableRequest.newBuilder() @@ -63,6 +65,11 @@ public void testToProto() { com.google.protobuf.Duration.newBuilder() .setSeconds(100 * 60 * 60)) .build()) + .build()) + .setChangeStreamConfig( + ChangeStreamConfig.newBuilder() + .setRetentionPeriod( + com.google.protobuf.Duration.newBuilder().setSeconds(86400)) .build())) .setParent(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) .addInitialSplits( @@ -74,6 +81,53 @@ 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 = 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/RestoreTableRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/RestoreTableRequestTest.java index 232902f585..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 @@ -31,6 +31,7 @@ public class RestoreTableRequestTest { 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() { @@ -61,6 +62,23 @@ public void testToProtoCrossInstance() { 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 = @@ -88,6 +106,24 @@ public void testEqualityCrossInstance() { .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 = @@ -117,4 +153,24 @@ public void testHashCodeCrossInstance() { .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/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/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..04cf3f0813 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,70 @@ 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()); + } } 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..9551fd70c4 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 @@ -37,11 +37,14 @@ public class UpdateBackupRequestTest { 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 +53,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 +68,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/UpdateTableRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java new file mode 100644 index 0000000000..fabebdccbf --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/UpdateTableRequestTest.java @@ -0,0 +1,84 @@ +/* + * 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); + } +} 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 62% 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 ac9941b2fc..2628cdf224 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,7 +31,10 @@ 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; @@ -47,11 +50,16 @@ import org.threeten.bp.Duration; @RunWith(JUnit4.class) -public class AwaitReplicationCallableTest { +public class AwaitConsistencyCallableTest { @Rule public MockitoRule mockitoRule = MockitoJUnit.rule().strictness(Strictness.WARN); - private static final TableName TABLE_NAME = TableName.of("my-project", "my-instance", "my-table"); + 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 @@ -61,7 +69,9 @@ public class AwaitReplicationCallableTest { private UnaryCallable mockCheckConsistencyCallable; - private AwaitReplicationCallable callable; + private AwaitReplicationCallable awaitReplicationCallable; + + private AwaitConsistencyCallable awaitConsistencyCallable; @Before public void setUp() { @@ -81,12 +91,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 @@ -98,7 +110,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; @@ -125,6 +138,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); @@ -132,7 +146,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; @@ -160,6 +175,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(); @@ -167,7 +183,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); } @@ -187,6 +205,7 @@ public void testPolling() throws Exception { CheckConsistencyRequest.newBuilder() .setName(TABLE_NAME.toString()) .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) .build(); CheckConsistencyResponse expectedResponse2 = @@ -199,7 +218,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); } @@ -219,6 +240,7 @@ public void testPollingTimeout() throws Exception { CheckConsistencyRequest.newBuilder() .setName(TABLE_NAME.toString()) .setConsistencyToken("fake-token") + .setStandardReadRemoteWrites(StandardReadRemoteWrites.newBuilder().build()) .build(); CheckConsistencyResponse expectedResponse2 = @@ -227,7 +249,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 { @@ -238,4 +262,67 @@ 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); + } } 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 index dccbd34408..3eb867d199 100644 --- 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 @@ -19,6 +19,11 @@ 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; @@ -89,4 +94,23 @@ public void testToProto() { 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..770887a324 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/common/TypeTest.java @@ -0,0 +1,208 @@ +/* + * 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.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.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"); + } + + @Test + 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 + 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 + 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 + 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 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}}"); + } +} 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 fd75bed956..fea66e82bf 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 @@ -26,19 +26,25 @@ 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.InstanceName; 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.stub.metrics.NoopMetricsProvider; import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import com.google.protobuf.ByteString; +import com.google.common.io.BaseEncoding; import io.grpc.Attributes; -import io.grpc.BindableService; +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; @@ -68,7 +74,7 @@ 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; @@ -77,37 +83,44 @@ public class BigtableDataClientFactoryTest { 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<>(); @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( - ImmutableList.of(), - transportFilter, - ImmutableList.of(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); + return next.startCall(call, headers); + } + }) + .addTransportFilter( + new ServerTransportFilter() { + @Override + public Attributes transportReady(Attributes transportAttrs) { + setUpAttributes.add(transportAttrs); + return super.transportReady(transportAttrs); + } + + @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); @@ -152,15 +165,18 @@ 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) + .build()); BigtableDataClient ignored1 = factory.createForInstance("project1", "instance1"); BigtableDataClient ignored2 = factory.createForInstance("project2", "instance2"); BigtableDataClient ignored3 = factory.createForInstance("project3", "instance3")) { @@ -231,14 +247,12 @@ public void testCreateForInstanceWithAppProfileHasCorrectSettings() throws Excep @Test public void testCreateWithRefreshingChannel() throws Exception { - String[] tableIds = {"fake-table1", "fake-table2"}; int poolSize = 3; 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() @@ -256,7 +270,7 @@ 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 + // Make sure that only 1 instance is created by each provider Mockito.verify(credentialsProvider, Mockito.times(1)).getCredentials(); Mockito.verify(executorProvider, Mockito.times(1)).getExecutor(); Mockito.verify(watchdogProvider, Mockito.times(1)).getWatchdog(); @@ -265,26 +279,17 @@ public void testCreateWithRefreshingChannel() throws Exception { 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.pingAndWarmRequests).hasSize(poolSize); + List expectedRequests = new LinkedList<>(); + for (int i = 0; i < poolSize; i++) { + expectedRequests.add( + PingAndWarmRequest.newBuilder() + .setName(InstanceName.format(DEFAULT_PROJECT_ID, DEFAULT_INSTANCE_ID)) + .setAppProfileId(DEFAULT_APP_PROFILE_ID) + .build()); } - assertThat(service.readRowsRequests).containsExactly(expectedRequests.toArray()); + + assertThat(service.pingAndWarmRequests).containsExactly(expectedRequests.toArray()); // Wait for all the connections to close asynchronously factory.close(); @@ -294,10 +299,28 @@ public void testCreateWithRefreshingChannel() throws Exception { 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("some-table", "some-key").deleteRow()); + } + + Metadata metadata = requestMetadata.take(); + String encodedValue = + metadata.get(Metadata.Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + FeatureFlags featureFlags = + FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedValue)); + + assertThat(featureFlags.getReverseScans()).isTrue(); + } + @Test public void testBulkMutationFlowControllerConfigured() throws Exception { BigtableDataSettings settings = - BigtableDataSettings.newBuilder() + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId("my-project") .setInstanceId("my-instance") .setCredentialsProvider(credentialsProvider) @@ -323,6 +346,8 @@ private static class FakeBigtableService extends BigtableGrpc.BigtableImplBase { volatile MutateRowRequest lastRequest; BlockingQueue readRowsRequests = new LinkedBlockingDeque<>(); + BlockingQueue pingAndWarmRequests = new LinkedBlockingDeque<>(); + private ApiFunction readRowsCallback = new ApiFunction() { @Override @@ -331,6 +356,14 @@ public ReadRowsResponse apply(ReadRowsRequest readRowsRequest) { } }; + private ApiFunction pingAndWarmCallback = + new ApiFunction() { + @Override + public PingAndWarmResponse apply(PingAndWarmRequest pingAndWarmRequest) { + return PingAndWarmResponse.getDefaultInstance(); + } + }; + @Override public void readRows( ReadRowsRequest request, StreamObserver responseObserver) { @@ -350,6 +383,14 @@ public void mutateRow( responseObserver.onNext(MutateRowResponse.getDefaultInstance()); responseObserver.onCompleted(); } + + @Override + public void pingAndWarm( + PingAndWarmRequest request, StreamObserver responseObserver) { + pingAndWarmRequests.add(request); + responseObserver.onNext(pingAndWarmCallback.apply(request)); + responseObserver.onCompleted(); + } } private static class BuilderAnswer implements Answer { 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 940d632c12..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTest.java +++ /dev/null @@ -1,517 +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 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.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; - -@RunWith(JUnit4.class) -public class BigtableDataClientTest { - - @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 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); - } - - @Test - public void proxyCloseTest() { - bigtableDataClient.close(); - Mockito.verify(mockStub).close(); - } - - @Test - public void existsTest() { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - 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 { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - 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() { - Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); - assertThat(bigtableDataClient.readRowsCallable()).isSameInstanceAs(mockReadRowsCallable); - } - - @Test - public void proxyReadRowAsyncTest() { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - 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() { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - bigtableDataClient.readRowAsync("fake-table", "fake-row-key"); - Mockito.verify(mockReadRowCallable) - .futureCall(Query.create("fake-table").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)); - 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() { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - // 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() { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - 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() { - Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); - - 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() { - 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("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() { - 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("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() { - Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); - - Query query = Query.create("fake-table"); - bigtableDataClient.readRows(query); - - Mockito.verify(mockReadRowsCallable).call(query); - } - - @Test - public void proxyReadRowsAsyncTest() { - Mockito.when(mockStub.readRowsCallable()).thenReturn(mockReadRowsCallable); - - 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() { - Mockito.when(mockStub.sampleRowKeysCallable()).thenReturn(mockSampleRowKeysCallable); - - assertThat(bigtableDataClient.sampleRowKeysCallable()) - .isSameInstanceAs(mockSampleRowKeysCallable); - } - - @Test - public void proxySampleRowKeysTest() { - Mockito.when(mockStub.sampleRowKeysCallable()).thenReturn(mockSampleRowKeysCallable); - - bigtableDataClient.sampleRowKeysAsync("fake-table"); - Mockito.verify(mockSampleRowKeysCallable).futureCall("fake-table"); - } - - @Test - public void sampleRowKeysTest() { - Mockito.when(mockStub.sampleRowKeysCallable()).thenReturn(mockSampleRowKeysCallable); - - Mockito.when(mockSampleRowKeysCallable.futureCall(ArgumentMatchers.any(String.class))) - .thenReturn(ApiFutures.immediateFuture(Collections.emptyList())); - bigtableDataClient.sampleRowKeys("fake-table"); - Mockito.verify(mockSampleRowKeysCallable).futureCall("fake-table"); - } - - @Test - public void proxyMutateRowCallableTest() { - Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); - - assertThat(bigtableDataClient.mutateRowCallable()).isSameInstanceAs(mockMutateRowCallable); - } - - @Test - public void proxyMutateRowTest() { - Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); - - 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(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); - Mockito.when(mockMutateRowCallable.futureCall(ArgumentMatchers.any(RowMutation.class))) - .thenAnswer( - (Answer) invocationOnMock -> 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() { - Mockito.when(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); - - 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(mockStub.bulkMutateRowsCallable()).thenReturn(mockBulkMutateRowsCallable); - - Mockito.when(mockBulkMutateRowsCallable.futureCall(ArgumentMatchers.any(BulkMutation.class))) - .thenAnswer( - (Answer) invocationOnMock -> 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() { - Mockito.when(mockStub.newMutateRowsBatcher(Mockito.any(String.class), Mockito.any())) - .thenReturn(mockBulkMutationBatcher); - - 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), 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("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 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("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 proxyCheckAndMutateRowCallableTest() { - assertThat(bigtableDataClient.checkAndMutateRowCallable()) - .isSameInstanceAs(mockStub.checkAndMutateRowCallable()); - } - - @Test - public void proxyCheckAndMutateRowTest() { - Mockito.when(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); - - 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(mockStub.checkAndMutateRowCallable()).thenReturn(mockCheckAndMutateRowCallable); - - Mockito.when( - mockCheckAndMutateRowCallable.futureCall( - ArgumentMatchers.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() { - Mockito.when(mockStub.readModifyWriteRowCallable()).thenReturn(mockReadModifyWriteRowCallable); - - 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(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("fake-table", "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); - } -} 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..880744bc18 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/BigtableDataClientTests.java @@ -0,0 +1,1062 @@ +/* + * 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.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.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.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; + +@RunWith(JUnit4.class) +/** + * 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). + */ +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(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("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 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("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 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); + + bigtableDataClient.readRowAsync("fake-table", ByteString.copyFromUtf8("fake-row-key")); + Mockito.verify(mockReadRowCallable) + .futureCall(Query.create("fake-table").rowKey("fake-row-key")); + } + + @Test + public void proxyReadRowOnAuthorizedViewAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + 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); + + bigtableDataClient.readRowAsync("fake-table", "fake-row-key"); + Mockito.verify(mockReadRowCallable) + .futureCall(Query.create("fake-table").rowKey("fake-row-key")); + } + + @Test + public void proxyReadRowOnAuthorizedViewStrAsyncTest() { + Mockito.when(mockStub.readRowCallable()).thenReturn(mockReadRowCallable); + + 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)); + 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 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)); + 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)); + 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 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)); + 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("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 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("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 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("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 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("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 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("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("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); + } + + @Test + public void proxySampleRowKeysCallableTest() { + Mockito.when(mockStub.sampleRowKeysCallable()).thenReturn(mockSampleRowKeysCallable); + + assertThat(bigtableDataClient.sampleRowKeysCallable()) + .isSameInstanceAs(mockSampleRowKeysCallable); + } + + @Test + public void proxySampleRowKeysTest() { + Mockito.when(mockStub.sampleRowKeysCallableWithRequest()) + .thenReturn(mockSampleRowKeysCallableWithRequest); + + bigtableDataClient.sampleRowKeysAsync("fake-table"); + Mockito.verify(mockSampleRowKeysCallableWithRequest) + .futureCall(SampleRowKeysRequest.create(TableId.of("fake-table"))); + } + + @Test + public void proxySampleRowKeysOnAuthorizedViewTest() { + Mockito.when(mockStub.sampleRowKeysCallableWithRequest()) + .thenReturn(mockSampleRowKeysCallableWithRequest); + + bigtableDataClient.sampleRowKeysAsync( + AuthorizedViewId.of("fake-table", "fake-authorized-view")); + Mockito.verify(mockSampleRowKeysCallableWithRequest) + .futureCall( + SampleRowKeysRequest.create(AuthorizedViewId.of("fake-table", "fake-authorized-view"))); + } + + @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 + public void proxyMutateRowTest() { + Mockito.when(mockStub.mutateRowCallable()).thenReturn(mockMutateRowCallable); + + 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 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"); + + 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("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("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 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")); + + 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("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(String.class), Mockito.any())) + .thenReturn(mockBulkMutationBatcher); + + 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), 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("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("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("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 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")); + 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("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("fake-table", "some-key") + .append("fake-family", "fake-qualifier", "suffix"); + 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"); + 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("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); + } +} 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 2b95bf821f..6b8d3f9c51 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 @@ -33,6 +33,10 @@ public void testToString() { .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..5edcca2f07 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceBuilder.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; + +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)) { + 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 f0dd2f8809..0000000000 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/FakeServiceHelper.java +++ /dev/null @@ -1,75 +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 com.google.common.collect.ImmutableList; -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; -import java.util.List; - -/** 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(ImmutableList.of(), null, ImmutableList.copyOf(services)); - } - - public FakeServiceHelper(ServerInterceptor interceptor, BindableService... services) - throws IOException { - this(ImmutableList.of(interceptor), null, ImmutableList.copyOf(services)); - } - - public FakeServiceHelper( - List interceptors, - ServerTransportFilter transportFilter, - List services) - throws IOException { - try (ServerSocket ss = new ServerSocket(0)) { - port = ss.getLocalPort(); - } - ServerBuilder builder = ServerBuilder.forPort(port); - for (ServerInterceptor interceptor : interceptors) { - 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/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..1a74eb5aa8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/functional/ReadRowsTest.java @@ -0,0 +1,110 @@ +/* + * 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.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("fake-table"))) {} + }); + } + } + + static class FakeService extends BigtableGrpc.BigtableImplBase { + private 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..95955bab94 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/AbstractProtoStructReaderTest.java @@ -0,0 +1,719 @@ +/* + * 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.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.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.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.protobuf.ByteString; +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; +import org.threeten.bp.Instant; + +@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()))) + .getMetadata()), + 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())))))) + .getMetadata()), + 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()))).getMetadata()), + 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()))).getMetadata()), + 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); + } + } + + @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()))))), + Collections.singletonList( + arrayValue( + stringValue("test"), + int64Value(100), + arrayValue(stringValue("nested"), stringValue("nested2")))), + 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())))), + arrayValue( + stringValue("test"), + int64Value(100), + arrayValue(stringValue("nested"), stringValue("nested2"))) + .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()))); + } + }, + } + }); + } + + @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[] {})).getMetadata()), + 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[] {})).getMetadata()), + 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[] {})).getMetadata()), + 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[] {})).getMetadata()); + 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[] {})).getMetadata()); + List duplicatedValues = new ArrayList<>(values); + duplicatedValues.addAll(values); + TestProtoStruct row = TestProtoStruct.create(metadata, duplicatedValues); + + assertThat(expectedJavaValue).isEqualTo(getByIndex.apply(row, index)); + } + } +} 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..6fa71e7fff --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ProtoStructTest.java @@ -0,0 +1,298 @@ +/* + * 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.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.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.data.v2.models.sql.SqlType; +import com.google.protobuf.ByteString; +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; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class ProtoStructTest { + + 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())))), + 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")))) + .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"); + } + }); + } + + @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"); + } + }); + } + + @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())); + } + + @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())); + } + + @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); + } + + @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/ResultSetImplTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java new file mode 100644 index 0000000000..a5b823b205 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/ResultSetImplTest.java @@ -0,0 +1,346 @@ +/* + * 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.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.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.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.SqlServerStream; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStreamImpl; +import com.google.cloud.bigtable.gaxx.testing.FakeStreamingApi.ServerStreamingStashCallable; +import com.google.protobuf.ByteString; +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; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class ResultSetImplTest { + + private static ResultSet resultSetWithFakeStream(ResultSetMetadata metadata, SqlRow... rows) { + ServerStreamingStashCallable stream = + new ServerStreamingStashCallable<>(Arrays.asList(rows)); + SettableApiFuture future = SettableApiFuture.create(); + future.set(metadata); + ExecuteQueryCallContext fakeCallContext = + ExecuteQueryCallContext.create(ExecuteQueryRequest.newBuilder().build(), future); + return ResultSetImpl.create(SqlServerStreamImpl.create(future, stream.call(fakeCallContext))); + } + + @Test + public void testSingleRow() throws ExecutionException, InterruptedException { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + 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()))) + .getMetadata()); + ResultSet resultSet = + resultSetWithFakeStream( + metadata, + 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")))))); + 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(rows).isEqualTo(1); + assertThat(resultSet.next()).isFalse(); + assertThat(resultSet.getMetadata()).isEqualTo(metadata); + resultSet.close(); + } + + @Test + public void testIteration() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("string", stringType())).getMetadata()); + try (ResultSet resultSet = + resultSetWithFakeStream( + metadata, + 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() throws ExecutionException, InterruptedException { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("string", stringType())).getMetadata()); + try (ResultSet resultSet = resultSetWithFakeStream(metadata)) { + assertThat(resultSet.next()).isFalse(); + assertThat(resultSet.getMetadata()).isEqualTo(metadata); + } + } + + @Test + public void getCallsPrevented_afterNextReturnsFalse() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("string", stringType())).getMetadata()); + + ResultSet resultSet = + resultSetWithFakeStream( + metadata, + 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() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("string", stringType())).getMetadata()); + ResultSet resultSet = + resultSetWithFakeStream( + metadata, 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())).getMetadata()); + 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())).getMetadata()); + 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() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("string", stringType())).getMetadata()); + try (ResultSet resultSet = + resultSetWithFakeStream( + metadata, + ProtoSqlRow.create(metadata, Collections.singletonList(stringValue("foo"))))) { + assertThrows(IllegalStateException.class, () -> resultSet.getString(0)); + } + } + + @Test + public void getOnColumnWithDuplicateName_throwsException() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("name", stringType()), columnMetadata("name", stringType())) + .getMetadata()); + try (ResultSet resultSet = + resultSetWithFakeStream( + metadata, + 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()); + ExecuteQueryCallContext fakeCallContext = + ExecuteQueryCallContext.create(ExecuteQueryRequest.newBuilder().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()); + ExecuteQueryCallContext fakeCallContext = + ExecuteQueryCallContext.create(ExecuteQueryRequest.newBuilder().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..a734ea068a --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/RowMergerUtilTest.java @@ -0,0 +1,148 @@ +/* + * 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 junit.framework.TestCase; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RowMergerUtilTest extends TestCase { + + @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..39d3c62c22 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.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(); - - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("2-onSplit")) - .build(); + public void testSplitAllRight() { + RowSet input = parse("a1,c,(a-c],[a2-c],(a3-c),[a4-c)"); - 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(); - - SortedSet splitPoints = - ImmutableSortedSet.orderedBy(ByteStringComparator.INSTANCE) - .add(ByteString.copyFromUtf8("2-range-end")) - .build(); + public void testShardMultipleKeys() { + RowSet input = parse("1_beforeSplit,2_onSplit,3_afterSplit"); + SortedSet splitPoints = splitPoints("2_onSplit"); - 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(); + private static RowSet parse(String encodedRowSet) { + RowSet.Builder builder = RowSet.newBuilder(); - 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(); - - 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 : encodedRowSet.split(",")) { + 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 @@ -570,17 +332,8 @@ public void multipleRangeBoundTest() { } // Helpers - private static void verifySplit(RowSet input, SortedSet splits, RowSet... expected) { - List actualWithNull = RowSetUtil.split(input, splits, true); + private static void verifyShard(RowSet input, SortedSet splits, RowSet... expected) { + List actualWithNull = RowSetUtil.shard(input, splits); assertThat(actualWithNull).containsExactlyElementsIn(Arrays.asList(expected)).inOrder(); - - 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(); } } 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..6ed96ec517 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowMergerUtilTest.java @@ -0,0 +1,228 @@ +/* + * 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.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() { + try (SqlRowMergerUtil util = new SqlRowMergerUtil()) {} + + try (SqlRowMergerUtil util = new SqlRowMergerUtil()) { + // Metadata with no rows + List unused = + util.parseExecuteQueryResponses( + ImmutableList.of(metadata(columnMetadata("a", stringType())))); + } + } + + @Test + public void parseExecuteQueryResponses_failsWithoutMetadata_serializedProtoRows() { + try (SqlRowMergerUtil util = new SqlRowMergerUtil()) { + // users must pass metadata, as it should always be returned by the server. + assertThrows( + IllegalStateException.class, + () -> + util.parseExecuteQueryResponses( + ImmutableList.of(partialResultSetWithToken(stringValue("val"))))); + } + } + + @Test + public void parseExecuteQueryResponses_handlesSingleValue_serializedProtoRows() { + ExecuteQueryResponse metadata = metadata(columnMetadata("str", stringType())); + ImmutableList responses = + ImmutableList.of(metadata, partialResultSetWithToken(stringValue("val"))); + try (SqlRowMergerUtil util = new SqlRowMergerUtil()) { + List rows = util.parseExecuteQueryResponses(responses); + assertThat(rows) + .containsExactly( + ProtoSqlRow.create( + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("str", stringType())).getMetadata()), + ImmutableList.of(stringValue("val")))); + ; + } + } + + @Test + public void + parseExecuteQueryResponses_handlesMultipleValuesAccrossMultipleRows_serializedProtoRows() { + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("map", mapType(stringType(), bytesType())) + }; + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadata(columns).getMetadata()); + ImmutableList responses = + ImmutableList.of( + metadata(columns), + partialResultSetWithoutToken( + stringValue("str1"), + bytesValue("bytes1"), + arrayValue(stringValue("arr1")), + mapValue(mapElement(stringValue("key1"), bytesValue("val1"))), + stringValue("str2")), + partialResultSetWithoutToken( + bytesValue("bytes2"), + arrayValue(stringValue("arr2")), + mapValue(mapElement(stringValue("key2"), bytesValue("val2")))), + partialResultSetWithToken( + stringValue("str3"), + bytesValue("bytes3"), + arrayValue(stringValue("arr3")), + mapValue(mapElement(stringValue("key3"), bytesValue("val3"))))); + try (SqlRowMergerUtil util = new SqlRowMergerUtil()) { + 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() { + ImmutableList responses = + ImmutableList.of( + metadata(columnMetadata("str", stringType())), + partialResultSetWithoutToken(stringValue("str1"))); + + SqlRowMergerUtil util = new SqlRowMergerUtil(); + List unused = util.parseExecuteQueryResponses(responses); + assertThrows(IllegalStateException.class, util::close); + } + + @Test + public void + parseExecuteQueryResponses_throwsOnParseWithPartialRowsInCompleteBatch_serializedProtoRows() { + ImmutableList responses = + ImmutableList.of( + metadata(columnMetadata("str", stringType()), columnMetadata("bytes", bytesType())), + partialResultSetWithToken( + stringValue("str1"), bytesValue("bytes1"), stringValue("str2"))); + + SqlRowMergerUtil util = new SqlRowMergerUtil(); + 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())) + }; + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadata(columns).getMetadata()); + ImmutableList responses = + ImmutableList.of( + metadata(columns), + partialResultSetWithoutToken( + stringValue("str1"), + bytesValue("bytes1"), + arrayValue(stringValue("arr1")), + mapValue(mapElement(stringValue("key1"), bytesValue("val1"))), + stringValue("str2")), + partialResultSetWithoutToken( + bytesValue("bytes2"), + arrayValue(stringValue("arr2")), + mapValue(mapElement(stringValue("key2"), bytesValue("val2")))), + partialResultSetWithToken( + stringValue("str3"), + bytesValue("bytes3"), + arrayValue(stringValue("arr3")), + mapValue(mapElement(stringValue("key3"), bytesValue("val3"))))); + try (SqlRowMergerUtil util = new SqlRowMergerUtil()) { + 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))); + rows.addAll(util.parseExecuteQueryResponses(responses.subList(3, 4))); + + 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..4e64c75cac --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/SqlRowSubject.java @@ -0,0 +1,41 @@ +/* + * 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 final @Nullable SqlRow actual; + + private SqlRowSubject(FailureMetadata metadata, @Nullable SqlRow actual) { + super(metadata, actual); + this.actual = 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/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..4f8ff4e4c9 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/BuiltinMetricsIT.java @@ -0,0 +1,408 @@ +/* + * 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.BigtableInstanceAdminClient; +import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; +import com.google.cloud.bigtable.admin.v2.models.AppProfile; +import com.google.cloud.bigtable.admin.v2.models.CreateAppProfileRequest; +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.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.BuiltinMetricsConstants; +import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsView; +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.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.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.Rule; +import org.junit.Test; +import org.junit.rules.Timeout; +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 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 BigtableInstanceAdminClient instanceAdminClient; + private MetricServiceClient metricClient; + + private InMemoryMetricReader metricReader; + private String appProfileCustomOtel; + private String appProfileDefault; + + 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()) + .isNotInstanceOf(EmulatorEnv.class); + + // Create a cloud monitoring client + metricClient = MetricServiceClient.create(); + + tableAdminClient = testEnvRule.env().getTableAdminClient(); + instanceAdminClient = testEnvRule.env().getInstanceAdminClient(); + appProfileCustomOtel = PrefixGenerator.newPrefix("test1"); + appProfileDefault = PrefixGenerator.newPrefix("test2"); + instanceAdminClient.createAppProfile( + CreateAppProfileRequest.of(testEnvRule.env().getInstanceId(), appProfileCustomOtel) + .setRoutingPolicy( + AppProfile.SingleClusterRoutingPolicy.of(testEnvRule.env().getPrimaryClusterId())) + .setIsolationPolicy(AppProfile.StandardIsolationPolicy.of(AppProfile.Priority.LOW))); + instanceAdminClient.createAppProfile( + CreateAppProfileRequest.of(testEnvRule.env().getInstanceId(), appProfileDefault) + .setRoutingPolicy( + AppProfile.SingleClusterRoutingPolicy.of(testEnvRule.env().getPrimaryClusterId())) + .setIsolationPolicy(AppProfile.StandardIsolationPolicy.of(AppProfile.Priority.LOW))); + + // 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); + BuiltinMetricsView.registerBuiltinMetrics(testEnvRule.env().getProjectId(), meterProvider); + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + + BigtableDataSettings.Builder settings = testEnvRule.env().getDataClientSettings().toBuilder(); + + clientCustomOtel = + BigtableDataClient.create( + settings + .setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(openTelemetry)) + .setAppProfileId(appProfileCustomOtel) + .build()); + clientDefault = BigtableDataClient.create(settings.setAppProfileId(appProfileDefault).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 (instanceAdminClient != null) { + instanceAdminClient.deleteAppProfile( + testEnvRule.env().getInstanceId(), appProfileCustomOtel, true); + instanceAdminClient.deleteAppProfile( + testEnvRule.env().getInstanceId(), appProfileDefault, true); + } + 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(tableDefault.getId(), "a-new-key").setCell("cf", "q", "abc")); + ArrayList rows = + Lists.newArrayList(clientDefault.readRows(Query.create(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\" AND metric.labels.app_profile=\"%s\"", + view, testEnvRule.env().getInstanceId(), tableDefault.getId(), appProfileDefault); + 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\" AND metric.labels.app_profile=\"%s\"", + view, testEnvRule.env().getInstanceId(), tableDefault.getId(), appProfileDefault); + 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(tableCustomOtel.getId(), "a-new-key").setCell("cf", "q", "abc")); + ArrayList rows = + Lists.newArrayList( + clientCustomOtel.readRows(Query.create(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\" AND metric.labels.app_profile=\"%s\"", + view, + testEnvRule.env().getInstanceId(), + tableCustomOtel.getId(), + appProfileCustomOtel); + 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\" AND metric.labels.app_profile=\"%s\"", + view, + testEnvRule.env().getInstanceId(), + tableCustomOtel.getId(), + appProfileCustomOtel); + 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 = BuiltinMetricsConstants.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.size() > 0) { + long actualValue = (long) point.get(0).getValue().getDistributionValue().getMean(); + assertWithMessage( + "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 index 612cd7435a..a284f8b7cb 100644 --- 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 @@ -15,16 +15,26 @@ */ 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.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; @@ -33,6 +43,7 @@ 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 { @@ -83,4 +94,166 @@ public void test() throws IOException, InterruptedException { 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(); + + 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(), 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); + } + 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); + } + 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(), 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"); + 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(), 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..5b72328240 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,87 @@ 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(), 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..41def01ba6 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,23 @@ 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.test_helpers.env.EmulatorEnv; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import com.google.protobuf.ByteString; import java.util.UUID; @@ -71,4 +81,81 @@ 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); + + String 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(), testAuthorizedView.getId()); + } } 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..620d290338 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/ExecuteQueryIT.java @@ -0,0 +1,348 @@ +/* + * 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.cloud.Date; +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.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.Statement; +import com.google.cloud.bigtable.data.v2.models.sql.Struct; +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.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class ExecuteQueryIT { + + @ClassRule public static TestEnvRule testEnvRule = new TestEnvRule(); + private static BigtableDataClient dataClient; + private static String tableId; + private static String cf; + private static String uniquePrefix; + + @BeforeClass + public static void setUpAll() throws IOException { + assume() + .withMessage("ExecuteQuery is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + tableId = testEnvRule.env().getTableId(); + dataClient = testEnvRule.env().getDataClient(); + cf = testEnvRule.env().getFamilyId(); + uniquePrefix = UUID.randomUUID() + "-execute-query-it-"; + + dataClient.mutateRow( + RowMutation.create(TableId.of(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.of(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.of(tableId), uniquePrefix + "b") + .setCell(cf, ByteString.copyFromUtf8("qual"), 10000, ByteString.copyFromUtf8("bval")) + .setCell( + cf, ByteString.copyFromUtf8("qual2"), 10000, ByteString.copyFromUtf8("bval2"))); + } + + @Test + public void selectStar() { + try (ResultSet rs = + dataClient.executeQuery( + Statement.of( + "SELECT * FROM " + tableId + " WHERE _key LIKE '" + uniquePrefix + "%'"))) { + 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() { + try (ResultSet rs = + dataClient.executeQuery( + Statement.of( + "SELECT * FROM `" + + tableId + + "`(with_history => true) WHERE _key LIKE '" + + uniquePrefix + + "%'"))) { + + 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(); + } + } + + @Test + public void allTypes() { + try (ResultSet rs = + dataClient.executeQuery( + Statement.of( + "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 FROM `" + + tableId + + "` WHERE _key='" + + uniquePrefix + + "a' LIMIT 1"))) { + + 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.next()).isFalse(); + } + } + + @Test + public void allQueryParamsTypes() { + ResultSet rs = + dataClient.executeQuery( + Statement.newBuilder( + "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") + .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()); + + 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() { + try (ResultSet rs = + dataClient.executeQuery( + Statement.of( + "SELECT cf['qual'] AS neverNull, cf['qual3'] AS maybeNull FROM " + + tableId + + " WHERE _key LIKE '" + + uniquePrefix + + "%'"))) { + 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/MetricsITUtils.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/MetricsITUtils.java new file mode 100644 index 0000000000..56f6bfa476 --- /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.stub.metrics.BuiltinMetricsConstants; +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(BuiltinMetricsConstants.CLUSTER_ID_KEY).contains(s), + "contains attributes"); + + static final Correspondence POINT_DATA_ZONE_ID_CONTAINS = + Correspondence.from( + (pd, s) -> pd.getAttributes().get(BuiltinMetricsConstants.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..c99000be48 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,77 @@ 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(), 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..95ed16817e 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,23 @@ 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.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,6 +66,7 @@ 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; @@ -81,6 +102,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(); + String 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, testAuthorizedView.getId()); + } + @Test public void readEmpty() throws Throwable { String uniqueKey = prefix + "-readEmpty"; @@ -98,6 +168,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); + + String 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, testAuthorizedView.getId()); + } + @Test public void read() throws Throwable { int numRows = 5; @@ -153,6 +272,122 @@ 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"; + String 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, testAuthorizedView.getId()); + } + @Test public void rangeQueries() { BigtableDataClient client = testEnvRule.env().getDataClient(); @@ -224,6 +459,270 @@ public void rangeQueries() { .isEmpty(); } + @Test + public void rangeQueriesOnAuthorizedView() { + assume() + .withMessage("AuthorizedView is not supported on Emulator") + .that(testEnvRule.env()) + .isNotInstanceOf(EmulatorEnv.class); + + BigtableDataClient client = testEnvRule.env().getDataClient(); + String 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, 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(); + String 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(); + String 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); + + 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(); + ApiFunction oldConfigurator = + transport.getChannelConfigurator(); + + // Randomly camp the deadline to force a timeout to force a retry + transport.setChannelConfigurator( + (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 = 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..ef5cf83c75 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,19 @@ */ 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.test_helpers.env.EmulatorEnv; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import com.google.protobuf.ByteString; import java.util.UUID; @@ -58,4 +67,75 @@ 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); + + String 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(), 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..6b2eaf2047 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,23 @@ */ 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.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.test_helpers.env.EmulatorEnv; import com.google.cloud.bigtable.test_helpers.env.TestEnvRule; import com.google.common.collect.ImmutableList; import com.google.protobuf.ByteString; @@ -72,4 +80,64 @@ 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(); + String 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++) { + 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()))) { + 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(), 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..5e5567e3b1 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,23 @@ 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.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 +70,58 @@ 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()); + } + + private static AuthorizedView createPreSplitTableAndAuthorizedView() { + String tableId = UUID.randomUUID().toString(); + 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..84ab24f1c8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/StreamingMetricsMetadataIT.java @@ -0,0 +1,175 @@ +/* + * 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.models.Query; +import com.google.cloud.bigtable.data.v2.models.Row; +import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants; +import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsView; +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); + BuiltinMetricsView.registerBuiltinMetrics(testEnvRule.env().getProjectId(), meterProvider); + 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); + ArrayList rows = 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(BuiltinMetricsConstants.OPERATION_LATENCIES_NAME)) + .collect(Collectors.toList()); + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(BuiltinMetricsConstants.OPERATION_LATENCIES_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(BuiltinMetricsConstants.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(BuiltinMetricsConstants.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("non-exist-table"); + try { + Lists.newArrayList(client.readRows(query)); + } catch (NotFoundException e) { + } + + Collection allMetricData = metricReader.collectAllMetrics(); + List metrics = + metricReader.collectAllMetrics().stream() + .filter(m -> m.getName().contains(BuiltinMetricsConstants.OPERATION_LATENCIES_NAME)) + .collect(Collectors.toList()); + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(BuiltinMetricsConstants.OPERATION_LATENCIES_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(BuiltinMetricsConstants.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(BuiltinMetricsConstants.ZONE_ID_KEY)) + .collect(Collectors.toList()); + + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) + .contains("unspecified"); + assertThat(pointData).comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS).contains("global"); + assertThat(clusterAttributes).contains("unspecified"); + 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..42adb8ea6e --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/it/UnaryMetricsMetadataIT.java @@ -0,0 +1,199 @@ +/* + * 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.models.RowMutation; +import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants; +import com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsView; +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); + BuiltinMetricsView.registerBuiltinMetrics(testEnvRule.env().getProjectId(), meterProvider); + 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(BuiltinMetricsConstants.OPERATION_LATENCIES_NAME)) + .collect(Collectors.toList()); + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(BuiltinMetricsConstants.OPERATION_LATENCIES_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(BuiltinMetricsConstants.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(BuiltinMetricsConstants.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("non-exist-table", rowKey).setCell(familyId, "q", "myVal")); + + try { + future.get(1, TimeUnit.MINUTES); + } catch (ExecutionException e) { + if (e.getCause() instanceof NotFoundException) { + // ignore NotFoundException + } else { + throw e; + } + } + + Collection allMetricData = metricReader.collectAllMetrics(); + MetricData metricData = null; + for (MetricData md : allMetricData) { + if (md.getName() + .equals( + BuiltinMetricsConstants.METER_NAME + + BuiltinMetricsConstants.ATTEMPT_LATENCIES_NAME)) { + metricData = md; + break; + } + } + + assertThat(allMetricData) + .comparingElementsUsing(METRIC_DATA_NAME_CONTAINS) + .contains(BuiltinMetricsConstants.ATTEMPT_LATENCIES_NAME); + assertThat(metricData).isNotNull(); + + List pointData = new ArrayList<>(metricData.getData().getPoints()); + + assertThat(pointData) + .comparingElementsUsing(POINT_DATA_CLUSTER_ID_CONTAINS) + .contains("unspecified"); + assertThat(pointData).comparingElementsUsing(POINT_DATA_ZONE_ID_CONTAINS).contains("global"); + List clusterAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(BuiltinMetricsConstants.CLUSTER_ID_KEY)) + .collect(Collectors.toList()); + List zoneAttributes = + pointData.stream() + .map(pd -> pd.getAttributes().get(BuiltinMetricsConstants.ZONE_ID_KEY)) + .collect(Collectors.toList()); + + assertThat(clusterAttributes).contains("unspecified"); + 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..b20a99ec11 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/AuthorizedViewIdTest.java @@ -0,0 +1,69 @@ +/* + * 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")); + assertThat(authorizedViewId).isNotEqualTo(TableId.of(TABLE_ID)); + } + + @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..84108d4a78 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; @@ -37,12 +38,14 @@ 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 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( @@ -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, 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( @@ -170,6 +258,56 @@ 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 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, 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..61c028cdb6 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamMutationTest.java @@ -0,0 +1,325 @@ +/* + * 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.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 org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +@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); + + @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") + .setEstimatedLowWatermark(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.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP); + assertThat(changeStreamMutation.getTieBreaker()).isEqualTo(0); + assertThat(changeStreamMutation.getToken()).isEqualTo("fake-token"); + assertThat(changeStreamMutation.getEstimatedLowWatermark()).isEqualTo(FAKE_LOW_WATERMARK); + + // 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") + .setEstimatedLowWatermark(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.getCommitTimestamp()).isEqualTo(FAKE_COMMIT_TIMESTAMP); + assertThat(changeStreamMutation.getTieBreaker()).isEqualTo(0); + assertThat(changeStreamMutation.getToken()).isEqualTo("fake-token"); + assertThat(changeStreamMutation.getEstimatedLowWatermark()).isEqualTo(FAKE_LOW_WATERMARK); + + // 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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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..3f09d9b443 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ChangeStreamRecordTest.java @@ -0,0 +1,280 @@ +/* + * 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 org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; +import org.junit.function.ThrowingRunnable; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class ChangeStreamRecordTest { + + @Rule public ExpectedException expect = ExpectedException.none(); + + @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.getEstimatedLowWatermark()) + .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(expected = IllegalStateException.class) + 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, (ThrowingRunnable) CloseStream.fromProto(closeStreamProto)); + } + + // Tests that a non-OK CloseStream should have continuation tokens. + @Test(expected = IllegalStateException.class) + public void closeStreamErrorWithoutContinuationTokenShouldFail() { + Status status = Status.newBuilder().setCode(11).build(); + ReadChangeStreamResponse.CloseStream closeStreamProto = + ReadChangeStreamResponse.CloseStream.newBuilder().setStatus(status).build(); + Assert.assertThrows( + IllegalStateException.class, (ThrowingRunnable) CloseStream.fromProto(closeStreamProto)); + } + + // Tests that the number of continuation tokens should match the number of new partitions. + @Test(expected = IllegalStateException.class) + 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, (ThrowingRunnable) 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..0f4e11a162 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; @@ -37,6 +39,7 @@ 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 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); @@ -60,10 +65,28 @@ public void toProtoTest() { .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, AUTHORIZED_VIEW_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setRowKey(TEST_KEY) + .build()); } @Test public void conditionTest() { + // Test ConditionalRowMutation on a table. ConditionalRowMutation mutation = ConditionalRowMutation.create(TABLE_ID, TEST_KEY) .condition(Filters.FILTERS.key().regex("a.*")) @@ -71,6 +94,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 +113,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 +121,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 +159,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 +202,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 +235,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")) @@ -185,6 +277,29 @@ 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 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, 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..22270bc269 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/DefaultChangeStreamRecordAdapterTest.java @@ -0,0 +1,455 @@ +/* + * 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.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 org.junit.Assert; +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; +import org.threeten.bp.Instant; + +@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); + + @Rule public ExpectedException expect = ExpectedException.none(); + + @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") + .setEstimatedLowWatermark(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.getEpochSecond()) + .setNanos(FAKE_LOW_WATERMARK.getNano())) + .setContinuationToken( + StreamContinuationToken.newBuilder().setToken("heartbeat-token").build()) + .build()); + Assert.assertEquals(adapter.getTokenFromHeartbeat(heartbeatRecord), "heartbeat-token"); + } + + @Test(expected = IllegalArgumentException.class) + public void getTokenFromHeartbeatInvalidTypeTest() { + ChangeStreamRecord closeStreamRecord = + CloseStream.fromProto(ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + adapter.getTokenFromHeartbeat(closeStreamRecord); + expect.expectMessage("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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(FAKE_LOW_WATERMARK) + .build(); + Assert.assertEquals( + adapter.getTokenFromChangeStreamMutation(changeStreamMutationRecord), + "change-stream-mutation-token"); + } + + @Test(expected = IllegalArgumentException.class) + public void getTokenFromChangeStreamMutationInvalidTypeTest() { + ChangeStreamRecord closeStreamRecord = + CloseStream.fromProto(ReadChangeStreamResponse.CloseStream.getDefaultInstance()); + adapter.getTokenFromChangeStreamMutation(closeStreamRecord); + expect.expectMessage("record is not a ChangeStreamMutation."); + } + + @Test + public void heartbeatTest() { + ReadChangeStreamResponse.Heartbeat expectedHeartbeat = + ReadChangeStreamResponse.Heartbeat.newBuilder() + .setEstimatedLowWatermark( + Timestamp.newBuilder() + .setSeconds(FAKE_LOW_WATERMARK.getEpochSecond()) + .setNanos(FAKE_LOW_WATERMARK.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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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") + .setEstimatedLowWatermark(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..748df81af6 --- /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("fake-family").isEqualTo(deleteFamily.getFamilyName()); + } + + @Test + public void deleteCellsTest() { + Entry deleteCellEntry = + DeleteCells.create( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + Range.TimestampRange.create(1000L, 2000L)); + DeleteCells deleteCells = (DeleteCells) deleteCellEntry; + assertThat("fake-family").isEqualTo(deleteCells.getFamilyName()); + assertThat(ByteString.copyFromUtf8("fake-qualifier")).isEqualTo(deleteCells.getQualifier()); + assertThat(Range.TimestampRange.create(1000L, 2000L)) + .isEqualTo(deleteCells.getTimestampRange()); + } + + @Test + public void setSellTest() { + Entry setCellEntry = + SetCell.create( + "fake-family", + ByteString.copyFromUtf8("fake-qualifier"), + 1000, + ByteString.copyFromUtf8("fake-value")); + SetCell setCell = (SetCell) setCellEntry; + assertThat("fake-family").isEqualTo(setCell.getFamilyName()); + assertThat(ByteString.copyFromUtf8("fake-qualifier")).isEqualTo(setCell.getQualifier()); + assertThat(1000).isEqualTo(setCell.getTimestamp()); + assertThat(ByteString.copyFromUtf8("fake-value")).isEqualTo(setCell.getValue()); + } +} 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 8d89670a1c..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; @@ -179,6 +181,36 @@ public void deleteRowTest() { .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 a6204890b4..6ba80ed767 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 @@ -49,6 +49,7 @@ 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 String AUTHORIZED_VIEW_ID = "fake-authorized-view"; private static final String APP_PROFILE_ID = "fake-profile-id"; private RequestContext requestContext; @@ -61,20 +62,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(AuthorizedViewId.of(TABLE_ID, 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 +89,33 @@ public void rowKeysTest() { ReadRowsRequest actualProto = query.toProto(requestContext); assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = + Query.create(AuthorizedViewId.of(TABLE_ID, 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(); + Builder expectedProto = expectedReadFromTableProtoBuilder(); expectedProto .getRowsBuilder() .addRowRanges( @@ -110,10 +133,37 @@ public void rowRangeTest() { ReadRowsRequest actualProto = query.toProto(requestContext); assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = + Query.create(AuthorizedViewId.of(TABLE_ID, 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); @@ -132,32 +182,73 @@ public void filterTestWithExceptions() { actualException = ex; } assertThat(actualException).hasMessageThat().contains("filter size can't be more than 20KB"); + + // AuthorizedView query test. + actualException = null; + try { + Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).filter(null); + } catch (Exception ex) { + actualException = ex; + } + assertThat(actualException).isInstanceOf(NullPointerException.class); + + actualException = null; + try { + Query.create(AuthorizedViewId.of(TABLE_ID, 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() + expectedReadFromTableProtoBuilder() .setFilter(RowFilter.newBuilder().setRowKeyRegexFilter(ByteString.copyFromUtf8(".*"))); ReadRowsRequest actualProto = query.toProto(requestContext); assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = + Query.create(AuthorizedViewId.of(TABLE_ID, 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); + Builder expectedProto = expectedReadFromTableProtoBuilder().setRowsLimit(10); ReadRowsRequest actualProto = query.toProto(requestContext); assertThat(actualProto).isEqualTo(expectedProto.build()); + + // AuthorizedView query test. + query = Query.create(AuthorizedViewId.of(TABLE_ID, 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 +260,25 @@ 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(AuthorizedViewId.of(TABLE_ID, 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 +299,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 +310,49 @@ 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(AuthorizedViewId.of(TABLE_ID, 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, TABLE_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, TABLE_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 +373,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 +384,63 @@ 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(AuthorizedViewId.of(TABLE_ID, 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, TABLE_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, TABLE_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, TABLE_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 +457,76 @@ 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, TABLE_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()); + public void testFromProtoWithInvalidTableId() { + Query.fromProto( + ReadRowsRequest.getDefaultInstance().toBuilder().setTableName("invalid-name").build()); expect.expect(IllegalArgumentException.class); expect.expectMessage("Invalid table name:"); } + @Test(expected = IllegalArgumentException.class) + public void testFromProtoWithInvalidAuthorizedViewId() { + Query.fromProto( + ReadRowsRequest.getDefaultInstance() + .toBuilder() + .setAuthorizedViewName("invalid-name") + .build()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage("Invalid authorized view name:"); + } + + @Test(expected = IllegalArgumentException.class) + public void testFromProtoWithEmptyTableAndAuthorizedViewId() { + Query.fromProto(ReadRowsRequest.getDefaultInstance()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage("Either table name or authorized view name must be specified"); + } + + @Test(expected = IllegalArgumentException.class) + public void testFromProtoWithBothTableAndAuthorizedViewId() { + Query.fromProto( + ReadRowsRequest.getDefaultInstance() + .toBuilder() + .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_ID, AUTHORIZED_VIEW_ID)) + .build()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage( + "Table name and authorized view name cannot be specified at the same time"); + } + @Test public void testEquality() { + // Table query test. Query request = Query.create(TABLE_ID) .rowKey("row-key") @@ -307,10 +551,47 @@ 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(AuthorizedViewId.of(TABLE_ID, 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(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .rowKey("row-key") + .range("a", "z") + .limit(3) + .filter(FILTERS.family().exactMatch("test"))); + + assertThat(Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).rowKey("row-key")) + .isNotEqualTo( + Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).rowKey("row-key-1")); + assertThat(Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).range("a", "z")) + .isNotEqualTo( + Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).range("a", "s")); + assertThat( + Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .filter(FILTERS.family().regex("test"))) + .isNotEqualTo( + Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .filter(FILTERS.family().exactMatch("test-one"))); + assertThat(Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).limit(4)) + .isNotEqualTo(Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)).limit(5)); + + assertThat(Query.create(AuthorizedViewId.of(TABLE_ID, 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 +607,381 @@ public void testClone() { Query clonedReq = query.clone(); assertThat(clonedReq).isEqualTo(query); assertThat(clonedReq.toProto(requestContext)).isEqualTo(request); + + // AuthorizedView query test. + query = + Query.create(AuthorizedViewId.of(TABLE_ID, AUTHORIZED_VIEW_ID)) + .filter(FILTERS.key().regex("temp")) + .limit(10); + request = + ReadRowsRequest.newBuilder() + .setAuthorizedViewName( + NameUtil.formatAuthorizedViewName( + PROJECT_ID, INSTANCE_ID, TABLE_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(); + + 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(AuthorizedViewId.of(TABLE_ID, 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(); + + 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(AuthorizedViewId.of(TABLE_ID, 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(); + + 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(AuthorizedViewId.of(TABLE_ID, 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(AuthorizedViewId.of(TABLE_ID, 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(AuthorizedViewId.of(TABLE_ID, 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..6f1061f8dc 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(expected).isEqualTo(deserialized); + } } 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..699f60a8d1 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/ReadChangeStreamQueryTest.java @@ -0,0 +1,378 @@ +/* + * 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.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamRequest.Builder; +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.util.Collections; +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; +import org.threeten.bp.Instant; + +@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); + + @Rule public ExpectedException expect = ExpectedException.none(); + + @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); + 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); + 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); + 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); + + 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); + + 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(org.threeten.bp.Duration.ofSeconds(5)); + + 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)); + + Builder expectedProto = + expectedProtoBuilder() + .setContinuationTokens( + StreamContinuationTokens.newBuilder().addTokens(tokenProto).build()); + + ReadChangeStreamRequest actualProto = query.toProto(requestContext); + assertThat(actualProto).isEqualTo(expectedProto.build()); + } + + @Test(expected = IllegalStateException.class) + 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); + ReadChangeStreamQuery query = + ReadChangeStreamQuery.create(TABLE_ID) + .startTime(FAKE_START_TIME) + .continuationTokens(Collections.singletonList(token)); + expect.expect(IllegalArgumentException.class); + expect.expectMessage("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(org.threeten.bp.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(expected = IllegalArgumentException.class) + public void testFromProtoWithEmptyTableId() { + ReadChangeStreamQuery.fromProto(ReadChangeStreamRequest.getDefaultInstance()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage("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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.Duration.ofSeconds(5))) + .isNotEqualTo( + ReadChangeStreamQuery.create(TABLE_ID) + .heartbeatDuration(org.threeten.bp.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(org.threeten.bp.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..90a8c6c1de 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 @@ -36,12 +36,14 @@ 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 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 testAppend() { + // Test ReadModifyWriteRow on a table. ReadModifyWriteRow mutation = ReadModifyWriteRow.create(TABLE_ID, "fake-key") .append( @@ -69,10 +71,42 @@ public void testAppend() { .setAppendValue(ByteString.copyFromUtf8("fake-value-str"))) .build(); assertThat(actualProto).isEqualTo(expected); + + // Test ReadModifyWriteRow on an authorized view. + mutation = + ReadModifyWriteRow.create(AuthorizedViewId.of(TABLE_ID, 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, TABLE_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,39 @@ public void testIncrement() { .setColumnQualifier(ByteString.copyFromUtf8("fake-qualifier-str")) .setIncrementAmount(2)) .build()); + + // Test ReadModifyWriteRow on an authorized view. + mutation = + ReadModifyWriteRow.create(AuthorizedViewId.of(TABLE_ID, 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, TABLE_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 +178,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(AuthorizedViewId.of(TABLE_ID, 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 +218,28 @@ 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(AuthorizedViewId.of(TABLE_ID, 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, TABLE_ID, 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..2e59c56336 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 @@ -38,16 +38,19 @@ 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 String AUTHORIZED_VIEW_ID = "fake-authorized-view"; private static final String APP_PROFILE_ID = "fake-profile"; private static final RequestContext REQUEST_CONTEXT = RequestContext.create(PROJECT_ID, INSTANCE_ID, APP_PROFILE_ID); + private static final ByteString TEST_KEY = ByteString.copyFromUtf8("fake-key"); @Test public void toProtoTest() { 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 +58,29 @@ 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(AuthorizedViewId.of(TABLE_ID, 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, TABLE_ID, AUTHORIZED_VIEW_ID)); assertThat(actualRowMutation.getAppProfileId()).isEqualTo(APP_PROFILE_ID); assertThat(actualRowMutation.getMutationsList()).hasSize(1); assertThat(actualRowMutation.getMutations(0).getSetCell().getValue()) @@ -68,8 +93,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 +105,31 @@ 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(AuthorizedViewId.of(TABLE_ID, 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, TABLE_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 +143,27 @@ 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(AuthorizedViewId.of(TABLE_ID, 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 +175,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(AuthorizedViewId.of(TABLE_ID, 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 +207,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(AuthorizedViewId.of(TABLE_ID, 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 +241,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 +261,28 @@ 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(AuthorizedViewId.of(TABLE_ID, 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, TABLE_ID, 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..4aa8a2b809 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/SampleRowKeysRequestTest.java @@ -0,0 +1,178 @@ +/* + * 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.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +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); + @Rule public ExpectedException expect = ExpectedException.none(); + + @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(expected = IllegalArgumentException.class) + public void testFromProtoWithInvalidTableId() { + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance() + .toBuilder() + .setTableName("invalid-name") + .build()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage("Invalid table name:"); + } + + @Test(expected = IllegalArgumentException.class) + public void testFromProtoWithInvalidAuthorizedViewId() { + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance() + .toBuilder() + .setAuthorizedViewName("invalid-name") + .build()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage("Invalid authorized view name:"); + } + + @Test(expected = IllegalArgumentException.class) + public void testFromProtoWithEmptyTableAndAuthorizedViewId() { + SampleRowKeysRequest.fromProto( + com.google.bigtable.v2.SampleRowKeysRequest.getDefaultInstance()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage("Either table name or authorized view name must be specified"); + } + + @Test(expected = IllegalArgumentException.class) + public void testFromProtoWithBothTableAndAuthorizedViewId() { + 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()); + + expect.expect(IllegalArgumentException.class); + expect.expectMessage( + "Table name and authorized view name cannot 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/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..8fef0f6c03 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/SqlTypeTest.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.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.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.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.StructWithSchema; +import com.google.cloud.bigtable.data.v2.models.sql.SqlType.Code; +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())); + } + + @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 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/models/sql/StatementTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/StatementTest.java new file mode 100644 index 0000000000..cb19a7fde9 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/models/sql/StatementTest.java @@ -0,0 +1,738 @@ +/* + * 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.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.nullValue; +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.ExecuteQueryRequest; +import com.google.bigtable.v2.Value; +import com.google.cloud.Date; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.protobuf.ByteString; +import java.util.Arrays; +import java.util.Collections; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import org.threeten.bp.Instant; + +@RunWith(JUnit4.class) +public class StatementTest { + + 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"; + + @Test + public void statementWithoutParameters() { + Statement s = Statement.of("SELECT * FROM table"); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table") + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithBytesParam() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE _key=@key") + .setBytesParam("key", ByteString.copyFromUtf8("test")) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE _key=@key") + .putParams( + "key", + Value.newBuilder() + .setType(bytesType()) + .setBytesValue(ByteString.copyFromUtf8("test")) + .build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullBytesParam() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE _key=@key") + .setBytesParam("key", null) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE _key=@key") + .putParams("key", Value.newBuilder().setType(bytesType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithStringParam() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE _key=@key") + .setStringParam("key", "test") + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE _key=@key") + .putParams( + "key", Value.newBuilder().setType(stringType()).setStringValue("test").build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullStringParam() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE _key=@key") + .setStringParam("key", null) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE _key=@key") + .putParams("key", Value.newBuilder().setType(stringType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithInt64Param() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE 1=@number") + .setLongParam("number", 1L) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE 1=@number") + .putParams("number", Value.newBuilder().setType(int64Type()).setIntValue(1).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullInt64Param() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE 1=@number") + .setLongParam("number", null) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE 1=@number") + .putParams("number", Value.newBuilder().setType(int64Type()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithBoolParam() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE @bool") + .setBooleanParam("bool", true) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE @bool") + .putParams( + "bool", Value.newBuilder().setType(boolType()).setBoolValue(true).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithNullBoolParam() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE @bool") + .setBooleanParam("bool", null) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE @bool") + .putParams("bool", Value.newBuilder().setType(boolType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithTimestampParam() { + Statement s = + Statement.newBuilder( + "SELECT * FROM table WHERE PARSE_TIMESTAMP(\"%Y/%m/%dT%H:%M:%S\", CAST(cf[\"ts\"] AS STRING)) < @timeParam") + .setTimestampParam("timeParam", Instant.ofEpochSecond(1000, 100)) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT * FROM table WHERE PARSE_TIMESTAMP(\"%Y/%m/%dT%H:%M:%S\", CAST(cf[\"ts\"] AS STRING)) < @timeParam") + .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() { + Statement s = + Statement.newBuilder( + "SELECT * FROM table WHERE PARSE_TIMESTAMP(\"%Y/%m/%dT%H:%M:%S\", CAST(cf[\"ts\"] AS STRING)) < @timeParam") + .setTimestampParam("timeParam", null) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT * FROM table WHERE PARSE_TIMESTAMP(\"%Y/%m/%dT%H:%M:%S\", CAST(cf[\"ts\"] AS STRING)) < @timeParam") + .putParams("timeParam", Value.newBuilder().setType(timestampType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithDateParam() { + Statement s = + Statement.newBuilder( + "SELECT * FROM table WHERE PARSE_DATE(\"%Y%m%d\", CAST(cf[\"date\"] AS STRING)) < @dateParam") + .setDateParam("dateParam", Date.fromYearMonthDay(2024, 6, 11)) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT * FROM table WHERE PARSE_DATE(\"%Y%m%d\", CAST(cf[\"date\"] AS STRING)) < @dateParam") + .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() { + Statement s = + Statement.newBuilder( + "SELECT * FROM table WHERE PARSE_DATE(\"%Y%m%d\", CAST(cf[\"date\"] AS STRING)) < @dateParam") + .setDateParam("dateParam", null) + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT * FROM table WHERE PARSE_DATE(\"%Y%m%d\", CAST(cf[\"date\"] AS STRING)) < @dateParam") + .putParams("dateParam", Value.newBuilder().setType(dateType()).build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void statementWithBytesListParam() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement s = + Statement.newBuilder( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery( + "SELECT cf, @listParam, @listWithNullElem, @emptyList, @nullList FROM table") + .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() { + Statement.Builder statement = Statement.newBuilder("SELECT @param"); + + 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() { + Statement s = + Statement.newBuilder("SELECT * FROM table WHERE _key=@key") + .setStringParam("key", "test1") + .setStringParam("key", "test2") + .setStringParam("key", "test3") + .setStringParam("key", "test4") + .build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table WHERE _key=@key") + .putParams( + "key", Value.newBuilder().setType(stringType()).setStringValue("test4").build()) + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } + + @Test + public void builderWorksWithNoParams() { + Statement s = Statement.newBuilder("SELECT * FROM table").build(); + + assertThat(s.toProto(REQUEST_CONTEXT)) + .isEqualTo( + ExecuteQueryRequest.newBuilder() + .setQuery("SELECT * FROM table") + .setInstanceName(EXPECTED_INSTANCE_NAME) + .setAppProfileId(EXPECTED_APP_PROFILE) + .build()); + } +} 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 488805f60c..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 @@ -96,6 +96,14 @@ public void testBuilder() { 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 @@ -108,7 +116,8 @@ public void testBuilderFromSettings() { .setBatchingSettings(BATCHING_SETTINGS) .setRetryableCodes(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED) .setRetrySettings(retrySettings) - .enableLatencyBasedThrottling(10L); + .enableLatencyBasedThrottling(10L) + .setServerInitiatedFlowControl(true); BigtableBatchingCallSettings settings = builder.build(); BigtableBatchingCallSettings.Builder newBuilder = settings.toBuilder(); @@ -122,6 +131,7 @@ public void testBuilderFromSettings() { assertThat(newBuilder.getDynamicFlowControlSettings()).isNotNull(); verifyFlowControlSettingWhenLatencyBasedThrottlingEnabled( newBuilder.getDynamicFlowControlSettings()); + assertThat(newBuilder.isServerInitiatedFlowControlEnabled()).isTrue(); } @Test @@ -166,8 +176,8 @@ public void testFlowControlMandatorySettings() { BatchingSettings.newBuilder() .setFlowControlSettings( FlowControlSettings.newBuilder() - .setMaxOutstandingElementCount(10L) - .setMaxOutstandingRequestBytes(10L) + .setMaxOutstandingElementCount(11L) + .setMaxOutstandingRequestBytes(11L) .build()) .setElementCountThreshold(10L) .setRequestByteThreshold(10L) 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..e1f22bebbd 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 @@ -21,15 +21,13 @@ 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 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; @@ -60,27 +58,24 @@ 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")); + "fake-app-profile"); 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 +84,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 +100,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"); } } @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,7 +146,7 @@ public void testErrorsAreLoggedForBasic() { assertThat(logHandler.logs).hasSize(1); for (LogRecord log : logHandler.logs) { - assertThat(log.getMessage()).contains("Unexpected"); + assertThat(log.getMessage()).contains("UnsupportedOperationException"); } } @@ -188,20 +165,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/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..95a807bf76 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/CookiesHolderTest.java @@ -0,0 +1,806 @@ +/* + * 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.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.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.ReadChangeStreamQuery; +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 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.util.ArrayList; +import java.util.Collections; +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 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() { + client.readRows(Query.create("fake-table")).iterator().hasNext(); + + 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("fake-table", "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("fake-table") + .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", "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("fake-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(), + "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 record : + 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() { + client.generateInitialChangeStreamPartitions("table").iterator().hasNext(); + + 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 testNoCookieSucceedReadRows() { + fakeService.returnCookie = false; + + client.readRows(Query.create("fake-table")).iterator().hasNext(); + + 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("fake-table", "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("fake-table") + .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("fake-table", "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("fake-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 testNoCookieSucceedReadChangeStream() { + fakeService.returnCookie = false; + + for (ChangeStreamRecord record : + 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; + + client.generateInitialChangeStreamPartitions("table").iterator().hasNext(); + + 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())) { + + client.readRows(Query.create("table")).iterator().hasNext(); + + 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. + client.readRows(Query.create("fake-table")).iterator().hasNext(); + + fakeService.count.set(0); + client.mutateRow(RowMutation.create("fake-table", "key").setCell("cf", "q", "v")); + + fakeService.count.set(0); + client.bulkMutateRows( + BulkMutation.create("fake-table") + .add(RowMutationEntry.create("key").setCell("cf", "q", "v"))); + + fakeService.count.set(0); + client.sampleRowKeys("fake-table"); + + fakeService.count.set(0); + client.checkAndMutateRow( + ConditionalRowMutation.create("fake-table", "key") + .then(Mutation.create().setCell("cf", "q", "v"))); + + fakeService.count.set(0); + client.readModifyWriteRow( + ReadModifyWriteRow.create("fake-table", "key").append("cf", "q", "v")); + + fakeService.count.set(0); + client.generateInitialChangeStreamPartitions("fake-table").iterator().hasNext(); + + fakeService.count.set(0); + for (ChangeStreamRecord record : + client.readChangeStream(ReadChangeStreamQuery.create("fake-table"))) {} + + 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"); + + 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"); + + client1.readRows(Query.create("fake-table")).iterator().hasNext(); + + 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(); + + client2.readRows(Query.create("fake-table")).iterator().hasNext(); + + 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(); + } + } + + @Test + public void testDisableRoutingCookie() throws IOException { + // This test disables routing cookie in the client settings and ensures that none of the routing + // cookie + // is added. + settings.stubSettings().setEnableRoutingCookie(false); + try (BigtableDataClient client = BigtableDataClient.create(settings.build())) { + client.readRows(Query.create("fake-table")).iterator().hasNext(); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + client.mutateRow(RowMutation.create("fake-table", "key").setCell("cf", "q", "v")); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + client.bulkMutateRows( + BulkMutation.create("fake-table") + .add(RowMutationEntry.create("key").setCell("cf", "q", "v"))); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + client.sampleRowKeys("fake-table"); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + client.checkAndMutateRow( + ConditionalRowMutation.create("fake-table", "key") + .then(Mutation.create().setCell("cf", "q", "v"))); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + client.readModifyWriteRow( + ReadModifyWriteRow.create("fake-table", "key").append("cf", "q", "v")); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + client.generateInitialChangeStreamPartitions("fake-table").iterator().hasNext(); + assertThat(fakeService.count.get()).isEqualTo(2); + fakeService.count.set(0); + + for (ChangeStreamRecord record : + client.readChangeStream(ReadChangeStreamQuery.create("fake-table"))) {} + + assertThat(fakeService.count.get()).isEqualTo(2); + + assertThat(methods).isEmpty(); + } + } + + 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(); + } + + 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 index 4db1f5a31f..0083d94d12 100644 --- 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 @@ -20,7 +20,6 @@ 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.FlowControlEventStats; import com.google.api.gax.batching.FlowController; import com.google.api.gax.batching.FlowController.LimitExceededBehavior; import com.google.api.gax.grpc.GrpcCallContext; @@ -37,9 +36,10 @@ 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 java.util.concurrent.atomic.AtomicBoolean; +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -60,7 +60,6 @@ public class DynamicFlowControlCallableTest { private static final int DEADLINE_EXCEEDED_LATENCY = 501; private FlowController flowController; - private FlowControlEventStats flowControlEvents; private DynamicFlowControlStats stats; private UnaryCallable innerCallable; private ApiCallContext context; @@ -81,7 +80,6 @@ public void setup() { .setMinOutstandingRequestBytes(15L) .setLimitExceededBehavior(LimitExceededBehavior.Block) .build()); - flowControlEvents = flowController.getFlowControlEventStats(); stats = new DynamicFlowControlStats(); context = GrpcCallContext.createDefault(); innerCallable = new MockInnerCallable(); @@ -94,8 +92,18 @@ public void setup() { 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 { + DynamicFlowControlStats stats = new DynamicFlowControlStats(); + DynamicFlowControlCallable callableToTest = + new DynamicFlowControlCallable( + innerCallable, flowController, stats, TARGET_LATENCY_MS, ADJUSTING_INTERVAL_MS); Map> extraHeaders = new HashMap<>(); extraHeaders.put(LATENCY_HEADER, Arrays.asList("5")); ApiCallContext newContext = context.withExtraHeaders(extraHeaders); @@ -256,6 +264,10 @@ public ApiFuture> futureCall( 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( @@ -269,32 +281,30 @@ public ApiFuture> futureCall( private void createFlowControlEvent(final FlowController flowController) throws Exception { flowController.reserve(INITIAL_ELEMENT, 0); - final AtomicBoolean threadStarted = new AtomicBoolean(false); + CompletableFuture threadStarted = new CompletableFuture<>(); + CompletableFuture threadReservedOne = new CompletableFuture<>(); Thread t = new Thread( new Runnable() { @Override public void run() { + threadStarted.complete(null); try { - threadStarted.set(true); flowController.reserve(1, 0); + threadReservedOne.complete(null); } catch (Exception e) { + threadReservedOne.completeExceptionally(e); } } }); t.start(); - // Wait 5 seconds for the thread to start, and 50 milliseconds after it's started to make sure + // 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. - for (int i = 0; i < 1000; i++) { - if (threadStarted.get()) { - break; - } - Thread.sleep(5); - } + threadStarted.get(); Thread.sleep(50); flowController.release(INITIAL_ELEMENT, 0); - t.join(); + 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/EnhancedBigtableStubCloseRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubCloseRetryTest.java index 159879911a..66254fada7 100644 --- 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 @@ -23,9 +23,10 @@ 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.FakeServiceHelper; +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 io.grpc.Server; import io.grpc.Status; import io.grpc.stub.StreamObserver; import java.util.List; @@ -54,7 +55,7 @@ public class EnhancedBigtableStubCloseRetryTest { private BlockingQueue requests; private AtomicInteger numRequests; - private FakeServiceHelper serviceHelper; + private Server server; private EnhancedBigtableStub stub; @Before @@ -63,11 +64,10 @@ public void setUp() throws Exception { requests = new ArrayBlockingQueue<>(10); numRequests = new AtomicInteger(); - serviceHelper = new FakeServiceHelper(new FakeBigtable()); - serviceHelper.start(); + server = FakeServiceBuilder.create(new FakeBigtable()).start(); BigtableDataSettings.Builder settingBuilder = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setCredentialsProvider(NoCredentialsProvider.create()) @@ -80,7 +80,7 @@ public void setUp() throws Exception { public void tearDown() throws Exception { testExecutor.shutdown(); stub.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test 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 index 6819739d47..e918378691 100644 --- 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 @@ -24,10 +24,11 @@ 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.FakeServiceHelper; +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.common.util.concurrent.SettableFuture; +import io.grpc.Server; import io.grpc.stub.StreamObserver; import java.util.List; import java.util.concurrent.ExecutorService; @@ -48,7 +49,7 @@ public class EnhancedBigtableStubCloseTest { private SettableFuture requestReceivedBarrier = SettableFuture.create(); private SettableFuture clientClosedBarrier = SettableFuture.create(); - private FakeServiceHelper serviceHelper; + private Server server; private EnhancedBigtableStub stub; @Before @@ -57,15 +58,13 @@ public void setUp() throws Exception { requestReceivedBarrier = SettableFuture.create(); clientClosedBarrier = SettableFuture.create(); - serviceHelper = new FakeServiceHelper(new FakeBigtable()); - serviceHelper.start(); + server = FakeServiceBuilder.create(new FakeBigtable()).start(); EnhancedBigtableStubSettings stubSettings = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setCredentialsProvider(NoCredentialsProvider.create()) - .setRefreshingChannel(false) .build() .getStubSettings(); @@ -76,7 +75,7 @@ public void setUp() throws Exception { public void tearDown() throws Exception { testExecutor.shutdown(); stub.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test 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 c4e5ea2e40..5280abe1fd 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 @@ -20,7 +20,6 @@ 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; @@ -28,11 +27,14 @@ 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.SqlRow; import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; import com.google.cloud.bigtable.data.v2.models.KeyOffset; import com.google.cloud.bigtable.data.v2.models.Query; import com.google.cloud.bigtable.data.v2.models.Row; import com.google.cloud.bigtable.data.v2.models.RowMutation; +import com.google.cloud.bigtable.data.v2.models.sql.Statement; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Range; @@ -41,6 +43,7 @@ import java.lang.reflect.Modifier; import java.net.URI; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; @@ -76,6 +79,9 @@ public void settingsAreNotLostTest() { CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); WatchdogProvider watchdogProvider = Mockito.mock(WatchdogProvider.class); Duration watchdogInterval = Duration.ofSeconds(12); + boolean enableRoutingCookie = false; + boolean enableRetryInfo = false; + String metricsEndpoint = "test-endpoint:443"; EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() @@ -86,7 +92,10 @@ public void settingsAreNotLostTest() { .setEndpoint(endpoint) .setCredentialsProvider(credentialsProvider) .setStreamWatchdogProvider(watchdogProvider) - .setStreamWatchdogCheckInterval(watchdogInterval); + .setStreamWatchdogCheckInterval(watchdogInterval) + .setEnableRoutingCookie(enableRoutingCookie) + .setEnableRetryInfo(enableRetryInfo) + .setMetricsEndpoint(metricsEndpoint); verifyBuilder( builder, @@ -97,7 +106,10 @@ public void settingsAreNotLostTest() { endpoint, credentialsProvider, watchdogProvider, - watchdogInterval); + watchdogInterval, + enableRoutingCookie, + enableRetryInfo, + metricsEndpoint); verifySettings( builder.build(), projectId, @@ -107,7 +119,10 @@ public void settingsAreNotLostTest() { endpoint, credentialsProvider, watchdogProvider, - watchdogInterval); + watchdogInterval, + enableRoutingCookie, + enableRetryInfo, + metricsEndpoint); verifyBuilder( builder.build().toBuilder(), projectId, @@ -117,7 +132,10 @@ public void settingsAreNotLostTest() { endpoint, credentialsProvider, watchdogProvider, - watchdogInterval); + watchdogInterval, + enableRoutingCookie, + enableRetryInfo, + metricsEndpoint); } private void verifyBuilder( @@ -129,7 +147,10 @@ private void verifyBuilder( String endpoint, CredentialsProvider credentialsProvider, WatchdogProvider watchdogProvider, - Duration watchdogInterval) { + Duration watchdogInterval, + boolean enableRoutingCookie, + boolean enableRetryInfo, + String metricsEndpoint) { assertThat(builder.getProjectId()).isEqualTo(projectId); assertThat(builder.getInstanceId()).isEqualTo(instanceId); assertThat(builder.getAppProfileId()).isEqualTo(appProfileId); @@ -138,6 +159,9 @@ private void verifyBuilder( assertThat(builder.getCredentialsProvider()).isEqualTo(credentialsProvider); assertThat(builder.getStreamWatchdogProvider()).isSameInstanceAs(watchdogProvider); assertThat(builder.getStreamWatchdogCheckInterval()).isEqualTo(watchdogInterval); + assertThat(builder.getEnableRoutingCookie()).isEqualTo(enableRoutingCookie); + assertThat(builder.getEnableRetryInfo()).isEqualTo(enableRetryInfo); + assertThat(builder.getMetricsEndpoint()).isEqualTo(metricsEndpoint); } private void verifySettings( @@ -149,7 +173,10 @@ private void verifySettings( String endpoint, CredentialsProvider credentialsProvider, WatchdogProvider watchdogProvider, - Duration watchdogInterval) { + Duration watchdogInterval, + boolean enableRoutingCookie, + boolean enableRetryInfo, + String metricsEndpoint) { assertThat(settings.getProjectId()).isEqualTo(projectId); assertThat(settings.getInstanceId()).isEqualTo(instanceId); assertThat(settings.getAppProfileId()).isEqualTo(appProfileId); @@ -158,6 +185,9 @@ private void verifySettings( assertThat(settings.getCredentialsProvider()).isEqualTo(credentialsProvider); assertThat(settings.getStreamWatchdogProvider()).isSameInstanceAs(watchdogProvider); assertThat(settings.getStreamWatchdogCheckInterval()).isEqualTo(watchdogInterval); + assertThat(settings.getEnableRoutingCookie()).isEqualTo(enableRoutingCookie); + assertThat(settings.getEnableRetryInfo()).isEqualTo(enableRetryInfo); + assertThat(settings.getMetricsEndpoint()).isEqualTo(metricsEndpoint); } @Test @@ -184,7 +214,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() @@ -242,7 +275,8 @@ public void readRowIsNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId("my-project") - .setInstanceId("my-instance"); + .setInstanceId("my-instance") + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -294,7 +328,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); @@ -328,7 +363,8 @@ public void sampleRowKeysSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -375,7 +411,8 @@ public void mutateRowSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -422,7 +459,8 @@ public void bulkMutateRowsSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); assertThat(builder.bulkMutateRowsSettings().isLatencyBasedThrottlingEnabled()).isFalse(); @@ -535,7 +573,8 @@ public void bulkReadRowsSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder() @@ -610,7 +649,8 @@ public void checkAndMutateRowSettingsAreNotLostTest() { EnhancedBigtableStubSettings.Builder builder = EnhancedBigtableStubSettings.newBuilder() .setProjectId(dummyProjectId) - .setInstanceId(dummyInstanceId); + .setInstanceId(dummyInstanceId) + .setRefreshingChannel(false); RetrySettings retrySettings = RetrySettings.newBuilder().build(); builder @@ -634,6 +674,83 @@ 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 = @@ -645,6 +762,90 @@ 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)) + .setJittered(true) + .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()).containsExactlyElementsIn(Collections.emptySet()); + assertThat(builder.getRetrySettings().getInitialRpcTimeout()).isEqualTo(Duration.ofSeconds(30)); + assertThat(builder.getRetrySettings().getMaxRpcTimeout()).isEqualTo(Duration.ofSeconds(30)); + assertThat(builder.getRetrySettings().getMaxAttempts()).isEqualTo(1); + } + + @Test + public void executeQueryRetriesAreDisabled() { + ServerStreamingCallSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder().executeQuerySettings(); + + assertThat(builder.getRetrySettings().getMaxAttempts()).isAtMost(1); + assertThat(builder.getRetrySettings().getInitialRpcTimeout()).isAtMost(Duration.ofSeconds(30)); + } + private void verifyRetrySettingAreSane(Set retryCodes, RetrySettings retrySettings) { assertThat(retryCodes).containsAtLeast(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); @@ -667,9 +868,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 @@ -686,6 +885,73 @@ public void isRefreshingChannelFalseValueTest() { assertThat(builder.build().toBuilder().isRefreshingChannel()).isFalse(); } + @Test + public void routingCookieIsEnabled() throws IOException { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + Mockito.when(credentialsProvider.getCredentials()).thenReturn(new FakeCredentials()); + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setCredentialsProvider(credentialsProvider); + + assertThat(builder.getEnableRoutingCookie()).isTrue(); + assertThat(builder.build().getEnableRoutingCookie()).isTrue(); + assertThat(builder.build().toBuilder().getEnableRoutingCookie()).isTrue(); + } + + @Test + public void enableRetryInfoDefaultValueTest() throws IOException { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + Mockito.when(credentialsProvider.getCredentials()).thenReturn(new FakeCredentials()); + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setCredentialsProvider(credentialsProvider); + assertThat(builder.getEnableRetryInfo()).isTrue(); + assertThat(builder.build().getEnableRetryInfo()).isTrue(); + assertThat(builder.build().toBuilder().getEnableRetryInfo()).isTrue(); + } + + @Test + public void routingCookieFalseValueSet() throws IOException { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + Mockito.when(credentialsProvider.getCredentials()).thenReturn(new FakeCredentials()); + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setEnableRoutingCookie(false) + .setCredentialsProvider(credentialsProvider); + assertThat(builder.getEnableRoutingCookie()).isFalse(); + assertThat(builder.build().getEnableRoutingCookie()).isFalse(); + assertThat(builder.build().toBuilder().getEnableRoutingCookie()).isFalse(); + } + + @Test + public void enableRetryInfoFalseValueTest() throws IOException { + String dummyProjectId = "my-project"; + String dummyInstanceId = "my-instance"; + CredentialsProvider credentialsProvider = Mockito.mock(CredentialsProvider.class); + Mockito.when(credentialsProvider.getCredentials()).thenReturn(new FakeCredentials()); + EnhancedBigtableStubSettings.Builder builder = + EnhancedBigtableStubSettings.newBuilder() + .setProjectId(dummyProjectId) + .setInstanceId(dummyInstanceId) + .setEnableRetryInfo(false) + .setCredentialsProvider(credentialsProvider); + assertThat(builder.getEnableRetryInfo()).isFalse(); + assertThat(builder.build().getEnableRetryInfo()).isFalse(); + assertThat(builder.build().toBuilder().getEnableRetryInfo()).isFalse(); + } + static final String[] SETTINGS_LIST = { "projectId", "instanceId", @@ -693,6 +959,8 @@ public void isRefreshingChannelFalseValueTest() { "isRefreshingChannel", "primedTableIds", "jwtAudienceMapping", + "enableRoutingCookie", + "enableRetryInfo", "readRowsSettings", "readRowSettings", "sampleRowKeysSettings", @@ -701,6 +969,12 @@ public void isRefreshingChannelFalseValueTest() { "bulkReadRowsSettings", "checkAndMutateRowSettings", "readModifyWriteRowSettings", + "generateInitialChangeStreamPartitionsSettings", + "readChangeStreamSettings", + "pingAndWarmSettings", + "executeQuerySettings", + "metricsProvider", + "metricsEndpoint", }; @Test @@ -710,6 +984,7 @@ public void testToString() { .setProjectId("our-project-85") .setInstanceId("our-instance-06") .setAppProfileId("our-appProfile-06") + .setRefreshingChannel(false) .build(); checkToString(defaultSettings); @@ -732,8 +1007,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) { @@ -773,16 +1048,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 ae045123f1..50d086b711 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,12 +15,20 @@ */ 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.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; @@ -30,36 +38,50 @@ import com.google.api.gax.grpc.GrpcCallContext; import com.google.api.gax.grpc.GrpcTransportChannel; 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.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.bigtable.v2.FeatureFlags; 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.ReadChangeStreamRequest; +import com.google.bigtable.v2.ReadChangeStreamResponse; 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.RequestContext; -import com.google.cloud.bigtable.data.v2.models.DefaultRowAdapter; -import com.google.cloud.bigtable.data.v2.models.Query; -import com.google.cloud.bigtable.data.v2.models.Row; -import com.google.cloud.bigtable.data.v2.models.RowMutationEntry; -import com.google.common.collect.ImmutableList; +import com.google.cloud.bigtable.data.v2.internal.SqlRow; +import com.google.cloud.bigtable.data.v2.models.*; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.Statement; +import com.google.cloud.bigtable.data.v2.stub.sql.ExecuteQueryCallable; +import com.google.cloud.bigtable.data.v2.stub.sql.SqlServerStream; import com.google.common.collect.ImmutableMap; 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 io.grpc.BindableService; +import com.google.rpc.Code; +import com.google.rpc.Status; import io.grpc.Context; import io.grpc.Deadline; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; import io.grpc.Metadata; import io.grpc.Metadata.Key; +import io.grpc.Server; import io.grpc.ServerCall; import io.grpc.ServerCall.Listener; import io.grpc.ServerCallHandler; @@ -76,7 +98,9 @@ import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; +import java.util.Base64; import java.util.Collection; +import java.util.Iterator; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutionException; @@ -86,6 +110,7 @@ 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) @@ -96,8 +121,11 @@ public class EnhancedBigtableStubTest { private static final String TABLE_NAME = NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, "fake-table"); private static final String APP_PROFILE_ID = "app-profile-id"; + private static final String WAIT_TIME_TABLE_ID = "test-wait-timeout"; + private static final String WAIT_TIME_QUERY = "test-wait-timeout"; + private static final Duration WATCHDOG_CHECK_DURATION = Duration.ofMillis(100); - FakeServiceHelper serviceHelper; + private Server server; private MetadataInterceptor metadataInterceptor; private ContextInterceptor contextInterceptor; private FakeDataService fakeDataService; @@ -108,17 +136,16 @@ public class EnhancedBigtableStubTest { public void setUp() throws IOException, IllegalAccessException, InstantiationException { metadataInterceptor = new MetadataInterceptor(); contextInterceptor = new ContextInterceptor(); - fakeDataService = new FakeDataService(); + fakeDataService = Mockito.spy(new FakeDataService()); - serviceHelper = - new FakeServiceHelper( - ImmutableList.of(contextInterceptor, metadataInterceptor), - null, - ImmutableList.of(fakeDataService)); - serviceHelper.start(); + 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) @@ -132,7 +159,7 @@ public void setUp() throws IOException, IllegalAccessException, InstantiationExc @After public void tearDown() { enhancedBigtableStub.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test @@ -162,7 +189,6 @@ public void testJwtAudience() .setCredentialsProvider(FixedCredentialsProvider.create(jwtCreds)) .build(); enhancedBigtableStub = EnhancedBigtableStub.create(settings); - // Send rpc and grab the credentials sent enhancedBigtableStub.readRowCallable().futureCall(Query.create("fake-table")).get(); Metadata metadata = metadataInterceptor.headers.take(); @@ -195,9 +221,7 @@ public void testBatchJwtAudience() // Create a fixed channel that will ignore the default endpoint and connect to the emulator ManagedChannel emulatorChannel = - ManagedChannelBuilder.forAddress("localhost", serviceHelper.getPort()) - .usePlaintext() - .build(); + ManagedChannelBuilder.forAddress("localhost", server.getPort()).usePlaintext().build(); Metadata metadata; try { @@ -210,6 +234,9 @@ public void testBatchJwtAudience() .setTransportChannelProvider( FixedTransportChannelProvider.create( GrpcTransportChannel.create(emulatorChannel))) + // Channel refreshing doesn't work with FixedTransportChannelProvider. Disable it for + // the test + .setRefreshingChannel(false) .build(); enhancedBigtableStub = EnhancedBigtableStub.create(settings); // Send rpc and grab the credentials sent @@ -227,6 +254,21 @@ public void testBatchJwtAudience() assertThat(parsed.getPayload().getAudience()).isEqualTo("https://bigtable.googleapis.com/"); } + @Test + public void testFeatureFlags() throws InterruptedException, IOException, ExecutionException { + + enhancedBigtableStub.readRowCallable().futureCall(Query.create("fake-table")).get(); + Metadata metadata = metadataInterceptor.headers.take(); + + String encodedFeatureFlags = + metadata.get(Key.of("bigtable-features", Metadata.ASCII_STRING_MARSHALLER)); + FeatureFlags featureFlags = + FeatureFlags.parseFrom(BaseEncoding.base64Url().decode(encodedFeatureFlags)); + + assertThat(featureFlags.getReverseScans()).isTrue(); + assertThat(featureFlags.getLastScannedRowResponses()).isTrue(); + } + @Test public void testCreateReadRowsCallable() throws InterruptedException { ServerStreamingCallable streamingCallable = @@ -265,15 +307,10 @@ public void testCreateReadRowsRawCallable() throws InterruptedException { @Test public void testChannelPrimerConfigured() throws IOException { EnhancedBigtableStubSettings settings = - defaultSettings - .toBuilder() - .setRefreshingChannel(true) - .setPrimedTableIds("table1", "table2") - .build(); + defaultSettings.toBuilder().setRefreshingChannel(true).build(); try (EnhancedBigtableStub ignored = EnhancedBigtableStub.create(settings)) { - // priming will issue a request per table on startup - assertThat(fakeDataService.requests).hasSize(2); + assertThat(fakeDataService.pingRequests).hasSize(1); } } @@ -349,7 +386,7 @@ public void export(Collection collection) { @Test public void testBulkMutationFlowControllerConfigured() throws Exception { BigtableDataSettings.Builder settings = - BigtableDataSettings.newBuilder() + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId("my-project") .setInstanceId("my-instance") .setCredentialsProvider(defaultSettings.getCredentialsProvider()) @@ -491,6 +528,197 @@ public void testCallContextPropagatedInReadBatcher() } } + @Test + public void testBulkMutationFlowControlFeatureFlagIsSet() throws Exception { + BulkMutation bulkMutation = + BulkMutation.create("my-table") + .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("my-table") + .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)); + 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("table1", GrpcCallContext.createDefault()); + + batcher.add(RowMutationEntry.create("key0").deleteRow()); + 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(StreamObserver.class)); + 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("table1", 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(StreamObserver.class)); + + 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(); + + SqlServerStream sqlServerStream = streamingCallable.call(Statement.of("SELECT * FROM table")); + ExecuteQueryRequest expectedRequest = + ExecuteQueryRequest.newBuilder() + .setInstanceName(NameUtil.formatInstanceName(PROJECT_ID, INSTANCE_ID)) + .setAppProfileId(APP_PROFILE_ID) + .setQuery("SELECT * FROM table") + .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)); + + EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build()); + Iterator iterator = + stub.executeQueryCallable().call(Statement.of(WAIT_TIME_QUERY)).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, InterruptedException { + 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)); + + EnhancedBigtableStub stub = EnhancedBigtableStub.create(settings.build()); + ApiFuture future = + stub.executeQueryCallable().call(Statement.of(WAIT_TIME_QUERY)).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(); @@ -519,12 +747,20 @@ public Listener interceptCall( 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(); @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 mutateRows( MutateRowsRequest request, StreamObserver responseObserver) { @@ -539,6 +775,13 @@ public void mutateRows( @Override public void readRows( ReadRowsRequest request, StreamObserver responseObserver) { + if (request.getTableName().contains(WAIT_TIME_TABLE_ID)) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception e) { + + } + } requests.add(request); // Dummy row for stream responseObserver.onNext( @@ -553,5 +796,45 @@ public void readRows( .build()); responseObserver.onCompleted(); } + + @Override + public void readChangeStream( + ReadChangeStreamRequest request, + StreamObserver responseObserver) { + if (request.getTableName().contains(WAIT_TIME_TABLE_ID)) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception e) { + + } + } + 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.getQuery().contains(WAIT_TIME_QUERY)) { + try { + Thread.sleep(WATCHDOG_CHECK_DURATION.toMillis() * 2); + } catch (Exception e) { + + } + } + executeQueryRequests.add(request); + responseObserver.onNext(metadata(columnMetadata("foo", stringType()))); + responseObserver.onNext(partialResultSetWithToken(stringValue("test"))); + } } } 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..16e886f9b7 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 @@ -35,12 +35,17 @@ 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.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.sql.Statement; 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; @@ -58,8 +63,10 @@ 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 String INSTANCE_NAME = + "projects%2F" + PROJECT_ID + "%2Finstances%2F" + INSTANCE_ID; + private static final String TABLE_NAME = INSTANCE_NAME + "%2Ftables%2F" + TABLE_ID; private static final String APP_PROFILE_ID = "fake-profile"; private static final String TEST_FIXED_HEADER_STRING = "test_fixed_header"; @@ -70,18 +77,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 Server server; private 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); @@ -109,7 +118,7 @@ public void setUp() throws Exception { @After public void tearDown() throws Exception { client.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test @@ -154,7 +163,17 @@ public void readModifyWriteTest() { verifyHeaderSent(); } + @Test + public void executeQueryTest() { + client.executeQuery(Statement.of("SELECT * FROM table")); + verifyHeaderSent(true); + } + private void verifyHeaderSent() { + verifyHeaderSent(false); + } + + private void verifyHeaderSent(boolean useInstance) { Metadata metadata; try { metadata = sentMetadata.take(); @@ -163,7 +182,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 +249,7 @@ public void checkAndMutateRow( CheckAndMutateRowRequest request, StreamObserver responseObserver) { responseObserver.onNext(CheckAndMutateRowResponse.getDefaultInstance()); + responseObserver.onCompleted(); } @Override 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 index b66ab8f9b4..4792b66890 100644 --- 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 @@ -21,7 +21,9 @@ 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.primitives.Longs; import com.google.common.truth.Truth; +import com.google.protobuf.ByteString; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -53,7 +55,10 @@ 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"); + .setCell("fake-family", "fake-qualifier", 1_000, "fake-value") + .addToCell("family-2", "qualifier", 1_000, 1234) + .mergeToCell( + "family-2", "qualifier2", 1_000, ByteString.copyFrom(Longs.toByteArray(1234L))); innerResult.set(MutateRowResponse.getDefaultInstance()); callable.call(outerRequest); 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..f2fe77725d --- /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 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.Instant; + +@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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.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(org.threeten.bp.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/RetryInfoTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java new file mode 100644 index 0000000000..c1299f82c9 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/RetryInfoTest.java @@ -0,0 +1,806 @@ +/* + * 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.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.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.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.ReadChangeStreamQuery; +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.TableId; +import com.google.common.base.Stopwatch; +import com.google.common.collect.ImmutableList; +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.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 final Set methods = new HashSet<>(); + + private FakeBigtableService service; + private Server server; + private BigtableDataClient client; + private BigtableDataSettings.Builder settings; + + private 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(); + + 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(TableId.of("table"), "row"), true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> client.readRows(Query.create(TableId.of("table"))).iterator().hasNext(), true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> + client.bulkMutateRows( + BulkMutation.create(TableId.of("fake-table")) + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> + client.mutateRow( + RowMutation.create(TableId.of("fake-table"), "key").setCell("cf", "q", "v")), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed(() -> client.sampleRowKeys(TableId.of("table")), true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> + client.checkAndMutateRow( + ConditionalRowMutation.create("table", "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", "row").append("cf", "q", "v")), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> client.readChangeStream(ReadChangeStreamQuery.create("table")).iterator().hasNext(), + true); + + attemptCounter.set(0); + verifyRetryInfoIsUsed( + () -> client.generateInitialChangeStreamPartitions("table").iterator().hasNext(), 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"); + + assertThat(methods).containsExactlyElementsIn(expected); + } + + @Test + public void testReadRowNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed(() -> client.readRow("table", "row"), false); + } + + @Test + public void testReadRowDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyRetryInfoCanBeDisabled(() -> newClient.readRow("table", "row")); + } + } + + @Test + public void testReadRowServerNotReturningRetryInfo() { + verifyNoRetryInfo(() -> client.readRow("table", "row"), true); + } + + @Test + public void testReadRowServerNotReturningRetryInfoClientDisabledHandling() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo(() -> newClient.readRow("table", "row"), true); + } + } + + @Test + public void testReadRowsNonRetraybleErrorWithRetryInfo() { + verifyRetryInfoIsUsed(() -> client.readRows(Query.create("table")).iterator().hasNext(), false); + } + + @Test + public void testReadRowsDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyRetryInfoCanBeDisabled( + () -> newClient.readRows(Query.create("table")).iterator().hasNext()); + } + } + + @Test + public void testReadRowsServerNotReturningRetryInfo() { + verifyNoRetryInfo(() -> client.readRows(Query.create("table")).iterator().hasNext(), true); + } + + @Test + public void testReadRowsServerNotReturningRetryInfoClientDisabledHandling() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo(() -> newClient.readRows(Query.create("table")).iterator().hasNext(), true); + } + } + + @Test + public void testMutateRowsNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> + client.bulkMutateRows( + BulkMutation.create("fake-table") + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + false); + } + + @Test + public void testMutateRowsDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyRetryInfoCanBeDisabled( + () -> + newClient.bulkMutateRows( + BulkMutation.create("fake-table") + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v")))); + } + } + + @Test + public void testMutateRowsServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> + client.bulkMutateRows( + BulkMutation.create("fake-table") + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + true); + } + + @Test + public void testMutateRowsServerNotReturningRetryInfoClientDisabledHandling() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo( + () -> + newClient.bulkMutateRows( + BulkMutation.create("fake-table") + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))), + true); + } + } + + @Test + public void testMutateRowNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> client.mutateRow(RowMutation.create("table", "key").setCell("cf", "q", "v")), false); + } + + @Test + public void testMutateRowDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + + verifyRetryInfoCanBeDisabled( + () -> newClient.mutateRow(RowMutation.create("table", "key").setCell("cf", "q", "v"))); + } + } + + @Test + public void testMutateRowServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> client.mutateRow(RowMutation.create("table", "key").setCell("cf", "q", "v")), true); + } + + @Test + public void testMutateRowServerNotReturningRetryInfoClientDisabledHandling() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo( + () -> newClient.mutateRow(RowMutation.create("table", "key").setCell("cf", "q", "v")), + true); + } + } + + @Test + public void testSampleRowKeysNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed(() -> client.sampleRowKeys("table"), false); + } + + @Test + public void testSampleRowKeysDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyRetryInfoCanBeDisabled(() -> newClient.sampleRowKeys("table")); + } + } + + @Test + public void testSampleRowKeysServerNotReturningRetryInfo() { + verifyNoRetryInfo(() -> client.sampleRowKeys("table"), true); + } + + @Test + public void testSampleRowKeysServerNotReturningRetryInfoClientDisabledHandling() + throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo(() -> newClient.sampleRowKeys("table"), true); + } + } + + @Test + public void testCheckAndMutateDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient client = BigtableDataClient.create(settings.build())) { + ApiException exception = enqueueNonRetryableExceptionWithDelay(defaultDelay); + try { + client.checkAndMutateRow( + ConditionalRowMutation.create("table", "key") + .condition(Filters.FILTERS.value().regex("old-value")) + .then(Mutation.create().setCell("cf", "q", "v"))); + } catch (ApiException e) { + assertThat(e.getStatusCode()).isEqualTo(exception.getStatusCode()); + } + assertThat(attemptCounter.get()).isEqualTo(1); + } + } + + @Test + public void testCheckAndMutateServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> + client.checkAndMutateRow( + ConditionalRowMutation.create("table", "key") + .condition(Filters.FILTERS.value().regex("old-value")) + .then(Mutation.create().setCell("cf", "q", "v"))), + false); + } + + @Test + public void testCheckAndMutateServerNotReturningRetryInfoClientDisabledHandling() + throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo( + () -> + newClient.checkAndMutateRow( + ConditionalRowMutation.create("table", "key") + .condition(Filters.FILTERS.value().regex("old-value")) + .then(Mutation.create().setCell("cf", "q", "v"))), + false); + } + } + + @Test + public void testReadModifyWriteDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient client = BigtableDataClient.create(settings.build())) { + ApiException exception = enqueueNonRetryableExceptionWithDelay(defaultDelay); + try { + client.readModifyWriteRow(ReadModifyWriteRow.create("table", "row").append("cf", "q", "v")); + } catch (ApiException e) { + assertThat(e.getStatusCode()).isEqualTo(exception.getStatusCode()); + } + assertThat(attemptCounter.get()).isEqualTo(1); + } + } + + @Test + public void testReadModifyWriteServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> + client.readModifyWriteRow( + ReadModifyWriteRow.create("table", "row").append("cf", "q", "v")), + false); + } + + @Test + public void testReadModifyWriteNotReturningRetryInfoClientDisabledHandling() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo( + () -> + newClient.readModifyWriteRow( + ReadModifyWriteRow.create("table", "row").append("cf", "q", "v")), + false); + } + } + + @Test + public void testReadChangeStreamNonRetryableErrorWithRetryInfo() { + verifyRetryInfoIsUsed( + () -> client.readChangeStream(ReadChangeStreamQuery.create("table")).iterator().hasNext(), + false); + } + + @Test + public void testReadChangeStreamDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyRetryInfoCanBeDisabled( + () -> + newClient + .readChangeStream(ReadChangeStreamQuery.create("table")) + .iterator() + .hasNext()); + } + } + + @Test + public void testReadChangeStreamServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> client.readChangeStream(ReadChangeStreamQuery.create("table")).iterator().hasNext(), + true); + } + + @Test + public void testReadChangeStreamNotReturningRetryInfoClientDisabledHandling() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo( + () -> + newClient + .readChangeStream(ReadChangeStreamQuery.create("table")) + .iterator() + .hasNext(), + true, + com.google.protobuf.Duration.newBuilder().setSeconds(5).setNanos(0).build()); + } + } + + @Test + public void testGenerateInitialChangeStreamPartitionNonRetryableError() { + verifyRetryInfoIsUsed( + () -> client.generateInitialChangeStreamPartitions("table").iterator().hasNext(), false); + } + + @Test + public void testGenerateInitialChangeStreamPartitionDisableRetryInfo() throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyRetryInfoCanBeDisabled( + () -> newClient.generateInitialChangeStreamPartitions("table").iterator().hasNext()); + } + } + + @Test + public void testGenerateInitialChangeStreamServerNotReturningRetryInfo() { + verifyNoRetryInfo( + () -> client.generateInitialChangeStreamPartitions("table").iterator().hasNext(), true); + } + + @Test + public void testGenerateInitialChangeStreamServerNotReturningRetryInfoClientDisabledHandling() + throws IOException { + settings.stubSettings().setEnableRetryInfo(false); + + try (BigtableDataClient newClient = BigtableDataClient.create(settings.build())) { + verifyNoRetryInfo( + () -> newClient.generateInitialChangeStreamPartitions("table").iterator().hasNext(), + 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 { + 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 returns retry info but client disabled handling of retry info + private void verifyRetryInfoCanBeDisabled(Runnable runnable) { + enqueueRetryableExceptionWithDelay(defaultDelay); + Stopwatch stopwatch = Stopwatch.createStarted(); + runnable.run(); + stopwatch.stop(); + + assertThat(attemptCounter.get()).isEqualTo(2); + assertThat(stopwatch.elapsed()).isLessThan(Duration.ofSeconds(defaultDelay.getSeconds())); + + attemptCounter.set(0); + ApiException expectedApiException = enqueueNonRetryableExceptionWithDelay(defaultDelay); + ApiException actualException = + assertThrows("non retryable operations should fail", ApiException.class, runnable::run); + if (actualException instanceof MutateRowsException) { + assertThat( + ((MutateRowsException) actualException) + .getFailedMutations() + .get(0) + .getError() + .getStatusCode()) + .isEqualTo(expectedApiException.getStatusCode()); + } else { + assertThat(actualException.getStatusCode()).isEqualTo(expectedApiException.getStatusCode()); + } + assertThat(attemptCounter.get()).isEqualTo(1); + } + + // 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); + } + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java new file mode 100644 index 0000000000..f974076ceb --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/SampleRowKeysCallableWithRequestTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.bigtable.data.v2.stub; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.core.ApiFuture; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.NotFoundException; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.cloud.bigtable.data.v2.internal.NameUtil; +import com.google.cloud.bigtable.data.v2.internal.RequestContext; +import com.google.cloud.bigtable.data.v2.models.KeyOffset; +import com.google.cloud.bigtable.data.v2.models.SampleRowKeysRequest; +import com.google.cloud.bigtable.data.v2.models.TableId; +import com.google.common.collect.ImmutableList; +import com.google.protobuf.ByteString; +import io.grpc.Status.Code; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SampleRowKeysCallableWithRequestTest { + + private final RequestContext requestContext = + RequestContext.create("my-project", "my-instance", "my-profile"); + private FakeCallable inner; + private SampleRowKeysCallableWithRequest callable; + + @Before + public void setUp() { + inner = new FakeCallable(); + callable = new SampleRowKeysCallableWithRequest(inner, requestContext); + } + + @Test + public void requestIsCorrect() { + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); + + assertThat(inner.request) + .isEqualTo( + com.google.bigtable.v2.SampleRowKeysRequest.newBuilder() + .setTableName( + NameUtil.formatTableName( + requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) + .setAppProfileId(requestContext.getAppProfileId()) + .build()); + } + + @Test + public void responseCorrectlyTransformed() throws Exception { + ApiFuture> result = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); + + inner.response.set( + ImmutableList.of( + SampleRowKeysResponse.newBuilder() + .setRowKey(ByteString.copyFromUtf8("key1")) + .setOffsetBytes(100) + .build(), + SampleRowKeysResponse.newBuilder() + .setRowKey(ByteString.copyFromUtf8("")) + .setOffsetBytes(1000) + .build())); + + assertThat(result.get(1, TimeUnit.SECONDS)) + .isEqualTo( + ImmutableList.of( + KeyOffset.create(ByteString.copyFromUtf8("key1"), 100), + KeyOffset.create(ByteString.EMPTY, 1000))); + } + + @Test + public void errorIsPropagated() throws Exception { + ApiFuture> result = + callable.futureCall(SampleRowKeysRequest.create(TableId.of("my-table"))); + + Throwable expectedError = + new NotFoundException("fake error", null, GrpcStatusCode.of(Code.NOT_FOUND), false); + inner.response.setException(expectedError); + + Throwable actualError = null; + try { + result.get(1, TimeUnit.SECONDS); + } catch (ExecutionException e) { + actualError = e.getCause(); + } + + assertThat(actualError).isEqualTo(expectedError); + } + + static class FakeCallable + extends UnaryCallable< + com.google.bigtable.v2.SampleRowKeysRequest, List> { + com.google.bigtable.v2.SampleRowKeysRequest request; + ApiCallContext callContext; + SettableApiFuture> response = SettableApiFuture.create(); + + @Override + public ApiFuture> futureCall( + com.google.bigtable.v2.SampleRowKeysRequest request, ApiCallContext context) { + this.request = request; + this.callContext = context; + + return response; + } + } +} diff --git a/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..f0939fb0cf --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ChangeStreamRecordMergingCallableTest.java @@ -0,0 +1,135 @@ +/* + * 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())); + } + + @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..b51194f969 --- /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 instanceof ChangeStreamMutation); + } +} 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..7c3243ecfe --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamMergingAcceptanceTest.java @@ -0,0 +1,304 @@ +/* + * 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.Type; +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.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); + 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()); + Type type = Type.UNRECOGNIZED; + if (changeStreamMutation.getType() == ChangeStreamMutation.MutationType.USER) { + type = Type.USER; + } else if (changeStreamMutation.getType() + == ChangeStreamMutation.MutationType.GARBAGE_COLLECTION) { + type = 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 != null && !results.isEmpty() && results.get(results.size() - 1).getError(); + } + + private static List getNonExceptionResults( + ReadChangeStreamTest testCase) { + List results = testCase.getResultsList(); + List response = new ArrayList<>(); + if (results != null) { + 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..48a62bfee8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/changestream/ReadChangeStreamRetryTest.java @@ -0,0 +1,497 @@ +/* + * 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.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.newBuilderForEmulator(serverRule.getServer().getPort()) + .setProjectId(PROJECT_ID) + .setInstanceId(INSTANCE_ID) + .setCredentialsProvider(NoCredentialsProvider.create()); + + 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/BigtableCloudMonitoringExporterTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporterTest.java new file mode 100644 index 0000000000..81629e2d9d --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BigtableCloudMonitoringExporterTest.java @@ -0,0 +1,386 @@ +/* + * 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 static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.APP_PROFILE_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.BIGTABLE_PROJECT_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_NAME_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_UID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLUSTER_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.INSTANCE_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.TABLE_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ZONE_ID_KEY; +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.google.api.Distribution; +import com.google.api.MonitoredResource; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.monitoring.v3.MetricServiceClient; +import com.google.cloud.monitoring.v3.stub.MetricServiceStub; +import com.google.common.collect.ImmutableList; +import com.google.monitoring.v3.CreateTimeSeriesRequest; +import com.google.monitoring.v3.TimeSeries; +import com.google.protobuf.Empty; +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 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; + + @Before + public void setUp() { + fakeMetricServiceClient = new FakeMetricServiceClient(mockMetricServiceStub); + + exporter = + new BigtableCloudMonitoringExporter( + projectId, fakeMetricServiceClient, /* applicationResource= */ null, taskId); + + attributes = + Attributes.builder() + .put(BIGTABLE_PROJECT_ID_KEY, projectId) + .put(INSTANCE_ID_KEY, instanceId) + .put(TABLE_ID_KEY, tableId) + .put(CLUSTER_ID_KEY, cluster) + .put(ZONE_ID_KEY, zone) + .put(APP_PROFILE_KEY, appProfileId) + .build(); + + resource = Resource.create(Attributes.empty()); + + scope = InstrumentationScopeInfo.create(BuiltinMetricsConstants.METER_NAME); + } + + @After + public void tearDown() {} + + @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( + BIGTABLE_PROJECT_ID_KEY.getKey(), projectId, + INSTANCE_ID_KEY.getKey(), instanceId, + TABLE_ID_KEY.getKey(), tableId, + CLUSTER_ID_KEY.getKey(), cluster, + ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast(APP_PROFILE_KEY.getKey(), appProfileId, CLIENT_UID_KEY.getKey(), taskId); + assertThat(timeSeries.getPoints(0).getValue().getInt64Value()).isEqualTo(fakeValue); + assertThat(timeSeries.getPoints(0).getInterval().getStartTime().getNanos()) + .isEqualTo(startEpoch); + assertThat(timeSeries.getPoints(0).getInterval().getEndTime().getNanos()).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( + BIGTABLE_PROJECT_ID_KEY.getKey(), projectId, + INSTANCE_ID_KEY.getKey(), instanceId, + TABLE_ID_KEY.getKey(), tableId, + CLUSTER_ID_KEY.getKey(), cluster, + ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast(APP_PROFILE_KEY.getKey(), appProfileId, CLIENT_UID_KEY.getKey(), taskId); + Distribution distribution = timeSeries.getPoints(0).getValue().getDistributionValue(); + assertThat(distribution.getCount()).isEqualTo(3); + assertThat(timeSeries.getPoints(0).getInterval().getStartTime().getNanos()) + .isEqualTo(startEpoch); + assertThat(timeSeries.getPoints(0).getInterval().getEndTime().getNanos()).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(BIGTABLE_PROJECT_ID_KEY, projectId) + .put(INSTANCE_ID_KEY, instanceId) + .put(TABLE_ID_KEY, tableId + i) + .put(CLUSTER_ID_KEY, cluster) + .put(ZONE_ID_KEY, zone) + .put(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( + BIGTABLE_PROJECT_ID_KEY.getKey(), projectId, + INSTANCE_ID_KEY.getKey(), instanceId, + TABLE_ID_KEY.getKey(), tableId + i, + CLUSTER_ID_KEY.getKey(), cluster, + ZONE_ID_KEY.getKey(), zone); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(2); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast(APP_PROFILE_KEY.getKey(), appProfileId, CLIENT_UID_KEY.getKey(), taskId); + assertThat(timeSeries.getPoints(0).getValue().getInt64Value()).isEqualTo(i); + assertThat(timeSeries.getPoints(0).getInterval().getStartTime().getNanos()) + .isEqualTo(startEpoch); + assertThat(timeSeries.getPoints(0).getInterval().getEndTime().getNanos()).isEqualTo(endEpoch); + } + } + + @Test + public void testTimeSeriesForMetricWithGceOrGkeResource() { + String gceProjectId = "fake-gce-project"; + BigtableCloudMonitoringExporter exporter = + new BigtableCloudMonitoringExporter( + projectId, + fakeMetricServiceClient, + MonitoredResource.newBuilder() + .setType("gce-instance") + .putLabels("some-gce-key", "some-gce-value") + .putLabels("project_id", gceProjectId) + .build(), + taskId); + 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( + BIGTABLE_PROJECT_ID_KEY, + projectId, + INSTANCE_ID_KEY, + instanceId, + APP_PROFILE_KEY, + appProfileId, + CLIENT_NAME_KEY, + 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/" + gceProjectId); + assertThat(request.getTimeSeriesList()).hasSize(1); + + com.google.monitoring.v3.TimeSeries timeSeries = request.getTimeSeriesList().get(0); + + assertThat(timeSeries.getResource().getLabelsMap()) + .containsExactly("some-gce-key", "some-gce-value", "project_id", gceProjectId); + + assertThat(timeSeries.getMetric().getLabelsMap()).hasSize(5); + assertThat(timeSeries.getMetric().getLabelsMap()) + .containsAtLeast( + BIGTABLE_PROJECT_ID_KEY.getKey(), + projectId, + INSTANCE_ID_KEY.getKey(), + instanceId, + APP_PROFILE_KEY.getKey(), + appProfileId, + CLIENT_NAME_KEY.getKey(), + clientName, + CLIENT_UID_KEY.getKey(), + taskId); + } + + 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/stub/metrics/BigtableTracerCallableTest.java similarity index 77% 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/stub/metrics/BigtableTracerCallableTest.java index 03aad7f822..a12dd3cfbd 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/stub/metrics/BigtableTracerCallableTest.java @@ -19,6 +19,7 @@ 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 +32,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 +42,20 @@ 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.EnhancedBigtableStub; -import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; 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 +68,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 StatsComponent localStats = new StatsComponentImpl(); + private final StatsComponent localStats = new SimpleStatsComponent(); private EnhancedBigtableStub stub; private EnhancedBigtableStub noHeaderStub; private int attempts; @@ -95,73 +95,91 @@ public void setUp() throws Exception { // 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) .build(); - EnhancedBigtableStubSettings stubSettings = - EnhancedBigtableStub.finalizeSettings( - settings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder()); - attempts = stubSettings.readRowsSettings().getRetrySettings().getMaxAttempts(); - stub = new EnhancedBigtableStub(stubSettings, ClientContext.create(stubSettings)); + + ClientContext clientContext = + EnhancedBigtableStub.createClientContext(settings.getStubSettings()); + clientContext = + clientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + settings.getStubSettings(), + Tags.getTagger(), + localStats.getStatsRecorder(), + null)) + .build(); + attempts = settings.getStubSettings().readRowsSettings().getRetrySettings().getMaxAttempts(); + stub = new EnhancedBigtableStub(settings.getStubSettings(), clientContext); // 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) .build(); - EnhancedBigtableStubSettings noHeaderStubSettings = - EnhancedBigtableStub.finalizeSettings( - noHeaderSettings.getStubSettings(), Tags.getTagger(), localStats.getStatsRecorder()); + + ClientContext noHeaderClientContext = + EnhancedBigtableStub.createClientContext(noHeaderSettings.getStubSettings()); + noHeaderClientContext = + noHeaderClientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + noHeaderSettings.getStubSettings(), + Tags.getTagger(), + localStats.getStatsRecorder(), + null)) + .build(); noHeaderStub = - new EnhancedBigtableStub(noHeaderStubSettings, ClientContext.create(noHeaderStubSettings)); + new EnhancedBigtableStub(noHeaderSettings.getStubSettings(), noHeaderClientContext); } @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( @@ -238,6 +256,24 @@ public void testGFELatencySampleRowKeys() throws InterruptedException { assertThat(latency).isEqualTo(fakeServerTiming.get()); } + @Test + public void testGFELatencySampleRowKeysWithRequest() throws InterruptedException { + stub.sampleRowKeysCallableWithRequest().call(SampleRowKeysRequest.create(TableId.of(TABLE_ID))); + + Thread.sleep(WAIT_FOR_METRICS_TIME_MS); + long latency = + StatsTestUtils.getAggregationValueAsLong( + localStats, + RpcViewConstants.BIGTABLE_GFE_LATENCY_VIEW, + ImmutableMap.of( + RpcMeasureConstants.BIGTABLE_OP, TagValue.create("Bigtable.SampleRowKeys"), + RpcMeasureConstants.BIGTABLE_STATUS, TagValue.create("OK")), + PROJECT_ID, + INSTANCE_ID, + APP_PROFILE_ID); + assertThat(latency).isEqualTo(fakeServerTiming.get()); + } + @Test public void testGFELatencyCheckAndMutateRow() throws InterruptedException { ConditionalRowMutation mutation = @@ -383,24 +419,6 @@ public void testMetricsWithErrorResponse() throws InterruptedException { 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 final String defaultTableName = NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID); @@ -423,13 +441,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/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..2ea4f99bdc --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTestUtils.java @@ -0,0 +1,140 @@ +/* + * 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.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import org.junit.Assert; + +@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 = BuiltinMetricsConstants.METER_NAME + 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) { + 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 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) { + switch (metricData.getType()) { + case HISTOGRAM: + List hd = + metricData.getHistogramData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()); + assertThat(hd).isNotEmpty(); + break; + case LONG_SUM: + List ld = + metricData.getLongSumData().getPoints().stream() + .filter(pd -> pd.getAttributes().equals(attributes)) + .collect(Collectors.toList()); + assertThat(ld).isNotEmpty(); + break; + default: + Assert.fail("Unexpected type"); + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java new file mode 100644 index 0000000000..d37a2562bf --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java @@ -0,0 +1,841 @@ +/* + * 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.metrics; + +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.APPLICATION_BLOCKING_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ATTEMPT_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_BLOCKING_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLIENT_NAME_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CLUSTER_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.CONNECTIVITY_ERROR_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.METHOD_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.OPERATION_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.RETRY_COUNT_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.SERVER_LATENCIES_NAME; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.STATUS_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.STREAMING_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.TABLE_ID_KEY; +import static com.google.cloud.bigtable.data.v2.stub.metrics.BuiltinMetricsConstants.ZONE_ID_KEY; +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 com.google.api.client.util.Lists; +import com.google.api.core.ApiFunction; +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.ClientContext; +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.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.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.ForwardingServerCall; +import io.grpc.ManagedChannelBuilder; +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.ServerCallStreamObserver; +import io.grpc.stub.StreamObserver; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.InstrumentSelector; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.View; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +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.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@RunWith(JUnit4.class) +public class BuiltinMetricsTracerTest { + 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 = "fake-table"; + + private static final String BAD_TABLE_ID = "non-exist-table"; + 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 long CHANNEL_BLOCKING_LATENCY = 75; + + @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); + + private final FakeService fakeService = new FakeService(); + private Server server; + + private EnhancedBigtableStub stub; + + private int batchElementCount = 2; + + private Attributes baseAttributes; + + private InMemoryMetricReader metricReader; + + @Before + public void setUp() throws Exception { + metricReader = InMemoryMetricReader.create(); + + baseAttributes = + Attributes.builder() + .put(BuiltinMetricsConstants.BIGTABLE_PROJECT_ID_KEY, PROJECT_ID) + .put(BuiltinMetricsConstants.INSTANCE_ID_KEY, INSTANCE_ID) + .put(BuiltinMetricsConstants.APP_PROFILE_KEY, APP_PROFILE_ID) + .build(); + + SdkMeterProviderBuilder meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader); + + for (Map.Entry entry : + BuiltinMetricsConstants.getAllViews().entrySet()) { + meterProvider.registerView(entry.getKey(), entry.getValue()); + } + + OpenTelemetrySdk otel = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + BuiltinMetricsTracerFactory facotry = BuiltinMetricsTracerFactory.create(otel, baseAttributes); + + // 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(Util.LOCATION_METADATA_KEY, byteArray); + + super.sendHeaders(headers); + } + }, + metadata); + } + }; + + ClientInterceptor clientInterceptor = + new ClientInterceptor() { + @Override + public ClientCall interceptCall( + MethodDescriptor methodDescriptor, + CallOptions callOptions, + Channel channel) { + return new ForwardingClientCall.SimpleForwardingClientCall( + channel.newCall(methodDescriptor, callOptions)) { + @Override + public void sendMessage(ReqT message) { + try { + Thread.sleep(CHANNEL_BLOCKING_LATENCY); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + super.sendMessage(message); + } + }; + } + }; + + 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 + .bulkMutateRowsSettings() + .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(); + + channelProvider.setChannelConfigurator( + (builder) -> { + if (oldConfigurator != null) { + builder = oldConfigurator.apply(builder); + } + return builder.intercept(clientInterceptor); + }); + stubSettingsBuilder.setTransportChannelProvider(channelProvider.build()); + + EnhancedBigtableStubSettings stubSettings = stubSettingsBuilder.build(); + stub = new EnhancedBigtableStub(stubSettings, ClientContext.create(stubSettings)); + } + + @After + public void tearDown() { + stub.close(); + server.shutdown(); + } + + @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 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(STREAMING_KEY, true) + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .build(); + + MetricData metricData = getMetricData(metricReader, OPERATION_LATENCIES_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 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(STREAMING_KEY, true) + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .build(); + + MetricData metricData = getMetricData(metricReader, OPERATION_LATENCIES_NAME); + long value = getAggregatedValue(metricData, expectedAttributes); + assertThat(value).isIn(Range.closed(SERVER_LATENCY, elapsed)); + } + + @Test + public void testGfeMetrics() { + Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE))); + + Attributes expectedAttributes = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(METHOD_KEY, "Bigtable.ReadRows") + .build(); + + MetricData serverLatenciesMetricData = getMetricData(metricReader, SERVER_LATENCIES_NAME); + + long serverLatencies = getAggregatedValue(serverLatenciesMetricData, expectedAttributes); + assertThat(serverLatencies).isEqualTo(FAKE_SERVER_TIMING); + + MetricData connectivityErrorCountMetricData = + getMetricData(metricReader, CONNECTIVITY_ERROR_COUNT_NAME); + Attributes expected1 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "UNAVAILABLE") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, "global") + .put(CLUSTER_ID_KEY, "unspecified") + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .build(); + Attributes expected2 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(CLIENT_NAME_KEY, 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) { + try { + counter.getAndIncrement(); + Thread.sleep(APPLICATION_LATENCY); + } catch (InterruptedException e) { + } + } + + @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, APPLICATION_BLOCKING_LATENCIES_NAME); + + Attributes expectedAttributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(METHOD_KEY, "Bigtable.ReadRows") + .build(); + long value = getAggregatedValue(applicationLatency, expectedAttributes); + + assertThat(value).isAtLeast((APPLICATION_LATENCY - SLEEP_VARIABILITY) * counter.get()); + + MetricData operationLatency = getMetricData(metricReader, OPERATION_LATENCIES_NAME); + long operationLatencyValue = + getAggregatedValue( + operationLatency, + expectedAttributes.toBuilder().put(STATUS_KEY, "OK").put(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, APPLICATION_BLOCKING_LATENCIES_NAME); + + Attributes expectedAttributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(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, OPERATION_LATENCIES_NAME); + long operationLatencyValue = + getAggregatedValue( + operationLatency, + expectedAttributes.toBuilder().put(STATUS_KEY, "OK").put(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, RETRY_COUNT_NAME); + Attributes expectedAttributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(METHOD_KEY, "Bigtable.MutateRow") + .put(STATUS_KEY, "OK") + .build(); + + long value = getAggregatedValue(metricData, expectedAttributes); + assertThat(value).isEqualTo(fakeService.getAttemptCounter().get() - 1); + } + + @Test + public void testMutateRowAttemptsTagValues() { + stub.mutateRowCallable() + .call(RowMutation.create(TABLE, "random-row").setCell("cf", "q", "value")); + + MetricData metricData = getMetricData(metricReader, ATTEMPT_LATENCIES_NAME); + + Attributes expected1 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "UNAVAILABLE") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, "global") + .put(CLUSTER_ID_KEY, "unspecified") + .put(METHOD_KEY, "Bigtable.MutateRow") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(STREAMING_KEY, false) + .build(); + + Attributes expected2 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.MutateRow") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(STREAMING_KEY, false) + .build(); + + verifyAttributes(metricData, expected1); + verifyAttributes(metricData, expected2); + } + + @Test + public void testMutateRowsPartialError() throws InterruptedException { + Batcher batcher = stub.newMutateRowsBatcher(TableId.of(TABLE), null); + int numMutations = 6; + for (int i = 0; i < numMutations; i++) { + String key = i % 2 == 0 ? "key" : "fail-key"; + batcher.add(RowMutationEntry.create(key).setCell("f", "q", "v")); + } + + Assert.assertThrows(BatchingException.class, batcher::close); + + MetricData metricData = getMetricData(metricReader, ATTEMPT_LATENCIES_NAME); + + Attributes expected = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.MutateRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(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"; + batcher.add(RowMutationEntry.create(key).setCell("f", "q", "v")); + } + + Assert.assertThrows(BatchingException.class, batcher::close); + + MetricData metricData = getMetricData(metricReader, ATTEMPT_LATENCIES_NAME); + + Attributes expected = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "NOT_FOUND") + .put(TABLE_ID_KEY, BAD_TABLE_ID) + .put(ZONE_ID_KEY, "global") + .put(CLUSTER_ID_KEY, "unspecified") + .put(METHOD_KEY, "Bigtable.MutateRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(STREAMING_KEY, false) + .build(); + + verifyAttributes(metricData, expected); + } + + @Test + public void testReadRowsAttemptsTagValues() { + Lists.newArrayList(stub.readRowsCallable().call(Query.create("fake-table")).iterator()); + + MetricData metricData = getMetricData(metricReader, ATTEMPT_LATENCIES_NAME); + + Attributes expected1 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "UNAVAILABLE") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, "global") + .put(CLUSTER_ID_KEY, "unspecified") + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(STREAMING_KEY, true) + .build(); + + Attributes expected2 = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "OK") + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .put(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++) { + 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, CLIENT_BLOCKING_LATENCIES_NAME); + + Attributes expectedAttributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, TABLE) + .put(ZONE_ID_KEY, ZONE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(METHOD_KEY, "Bigtable.MutateRows") + .put(CLIENT_NAME_KEY, 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() { + stub.readRowsCallable().all().call(Query.create(TABLE)); + + MetricData clientLatency = getMetricData(metricReader, CLIENT_BLOCKING_LATENCIES_NAME); + + Attributes attributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, TABLE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(ZONE_ID_KEY, ZONE) + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .build(); + + long value = getAggregatedValue(clientLatency, attributes); + assertThat(value).isAtLeast(CHANNEL_BLOCKING_LATENCY); + } + + @Test + public void testQueuedOnChannelUnaryLatencies() { + + stub.mutateRowCallable().call(RowMutation.create(TABLE, "a-key").setCell("f", "q", "v")); + + MetricData clientLatency = getMetricData(metricReader, CLIENT_BLOCKING_LATENCIES_NAME); + + Attributes attributes = + baseAttributes + .toBuilder() + .put(TABLE_ID_KEY, TABLE) + .put(CLUSTER_ID_KEY, CLUSTER) + .put(ZONE_ID_KEY, ZONE) + .put(METHOD_KEY, "Bigtable.MutateRow") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .build(); + + long expected = CHANNEL_BLOCKING_LATENCY * 2 / 3; + long actual = getAggregatedValue(clientLatency, attributes); + assertThat(actual).isAtLeast(expected); + } + + @Test + public void testPermanentFailure() { + try { + Lists.newArrayList(stub.readRowsCallable().call(Query.create(BAD_TABLE_ID)).iterator()); + Assert.fail("Request should throw not found error"); + } catch (NotFoundException e) { + } + + MetricData attemptLatency = getMetricData(metricReader, ATTEMPT_LATENCIES_NAME); + + Attributes expected = + baseAttributes + .toBuilder() + .put(STATUS_KEY, "NOT_FOUND") + .put(TABLE_ID_KEY, BAD_TABLE_ID) + .put(CLUSTER_ID_KEY, "unspecified") + .put(ZONE_ID_KEY, "global") + .put(STREAMING_KEY, true) + .put(METHOD_KEY, "Bigtable.ReadRows") + .put(CLIENT_NAME_KEY, CLIENT_NAME) + .build(); + + verifyAttributes(attemptLatency, expected); + + MetricData opLatency = getMetricData(metricReader, OPERATION_LATENCIES_NAME); + verifyAttributes(opLatency, expected); + } + + 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(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 e) { + } + 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 e) { + } + MutateRowsResponse.Builder builder = MutateRowsResponse.newBuilder(); + for (int i = 0; i < request.getEntriesCount(); i++) { + 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); + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } + + public AtomicInteger getAttemptCounter() { + return attemptCounter; + } + + public AtomicInteger getResponseCounter() { + return responseCounter; + } + } +} 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 index 69a741d0e3..11dd0b5095 100644 --- 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 @@ -23,6 +23,7 @@ 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.misc_utilities.MethodComparator; import com.google.common.collect.ImmutableList; import io.grpc.Status; @@ -118,11 +119,12 @@ public void testConnectionSelected() { @Test public void testAttemptStarted() { - compositeTracer.attemptStarted(3); - verify(child1, times(1)).attemptStarted(3); - verify(child2, times(1)).attemptStarted(3); - verify(child3, times(1)).attemptStarted(3); - verify(child4, times(1)).attemptStarted(3); + 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 @@ -249,4 +251,11 @@ public void testMethodsOverride() { .comparingElementsUsing(MethodComparator.METHOD_CORRESPONDENCE) .containsAtLeastElementsIn(baseMethods); } + + @Test + public void testRequestBlockedOnChannel() { + compositeTracer.grpcChannelQueuedLatencies(5L); + verify(child3, times(1)).grpcChannelQueuedLatencies(5L); + verify(child4, times(1)).grpcChannelQueuedLatencies(5L); + } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionTest.java new file mode 100644 index 0000000000..b34d21da17 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/ErrorCountPerConnectionTest.java @@ -0,0 +1,308 @@ +/* + * 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 org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.when; + +import com.google.api.gax.core.FixedExecutorProvider; +import com.google.api.gax.grpc.ChannelPoolSettings; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.bigtable.v2.*; +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.models.*; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStub; +import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; +import io.grpc.Server; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.InstrumentSelector; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder; +import io.opentelemetry.sdk.metrics.View; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +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.ArgumentCaptor; +import org.mockito.Mockito; +import org.mockito.stubbing.Answer; + +@RunWith(JUnit4.class) +public class ErrorCountPerConnectionTest { + private static final String SUCCESS_TABLE_NAME = "some-table"; + private static final String ERROR_TABLE_NAME = "nonexistent-table"; + private Server server; + private final FakeService fakeService = new FakeService(); + private EnhancedBigtableStubSettings.Builder builder; + private ArgumentCaptor runnableCaptor; + + private InMemoryMetricReader metricReader; + + private Attributes attributes; + + @Before + public void setup() throws Exception { + server = FakeServiceBuilder.create(fakeService).start(); + + ScheduledExecutorService executors = Mockito.mock(ScheduledExecutorService.class); + + attributes = + Attributes.builder() + .put(BuiltinMetricsConstants.BIGTABLE_PROJECT_ID_KEY, "fake-project") + .put(BuiltinMetricsConstants.INSTANCE_ID_KEY, "fake-instance") + .put(BuiltinMetricsConstants.APP_PROFILE_KEY, "") + .put(BuiltinMetricsConstants.CLIENT_NAME_KEY, "bigtable-java/" + Version.VERSION) + .build(); + + metricReader = InMemoryMetricReader.create(); + + SdkMeterProviderBuilder meterProvider = + SdkMeterProvider.builder().registerMetricReader(metricReader); + + for (Map.Entry entry : + BuiltinMetricsConstants.getAllViews().entrySet()) { + meterProvider.registerView(entry.getKey(), entry.getValue()); + } + + OpenTelemetrySdk otel = + OpenTelemetrySdk.builder().setMeterProvider(meterProvider.build()).build(); + + builder = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .stubSettings() + .setBackgroundExecutorProvider(FixedExecutorProvider.create(executors)) + .setProjectId("fake-project") + .setInstanceId("fake-instance") + .setMetricsProvider(CustomOpenTelemetryMetricsProvider.create(otel)); + + runnableCaptor = ArgumentCaptor.forClass(Runnable.class); + when(executors.scheduleAtFixedRate(runnableCaptor.capture(), anyLong(), anyLong(), any())) + .then((Answer>) invocation -> Mockito.mock(ScheduledFuture.class)); + } + + @After + public void tearDown() throws Exception { + if (server != null) { + server.shutdown(); + } + } + + @Test + public void readWithOneChannel() throws Exception { + long errorCount = 0; + + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(builder.build())) { + for (int i = 0; i < 20; i++) { + Query query; + if (i % 3 == 0) { + query = Query.create(ERROR_TABLE_NAME); + errorCount += 1; + } else { + query = Query.create(SUCCESS_TABLE_NAME); + } + try { + stub.readRowsCallable().call(query).iterator().hasNext(); + } catch (Exception e) { + // noop + } + } + } + + runInterceptorTasksAndAssertCount(); + + MetricData metricData = + BuiltinMetricsTestUtils.getMetricData( + metricReader, BuiltinMetricsConstants.PER_CONNECTION_ERROR_COUNT_NAME); + + // Make sure the correct bucket is updated with the correct number of data points + ArrayList histogramPointData = + new ArrayList<>(metricData.getHistogramData().getPoints()); + assertThat(histogramPointData.size()).isEqualTo(1); + HistogramPointData point = histogramPointData.get(0); + int index = findDataPointIndex(point.getBoundaries(), errorCount); + assertThat(point.getCounts().get(index)).isEqualTo(1); + } + + @Test + public void readWithTwoChannels() throws Exception { + EnhancedBigtableStubSettings.Builder builderWithTwoChannels = + builder.setTransportChannelProvider( + ((InstantiatingGrpcChannelProvider) builder.getTransportChannelProvider()) + .toBuilder() + .setChannelPoolSettings(ChannelPoolSettings.staticallySized(2)) + .build()); + long totalErrorCount = 0; + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(builderWithTwoChannels.build())) { + for (int i = 0; i < 20; i++) { + try { + if (i < 10) { + totalErrorCount += 1; + stub.readRowsCallable().call(Query.create(ERROR_TABLE_NAME)).iterator().hasNext(); + } else { + stub.readRowsCallable().call(Query.create(SUCCESS_TABLE_NAME)).iterator().hasNext(); + } + } catch (Exception e) { + // noop + } + } + } + runInterceptorTasksAndAssertCount(); + + long errorCountPerChannel = totalErrorCount / 2; + + MetricData metricData = + BuiltinMetricsTestUtils.getMetricData( + metricReader, BuiltinMetricsConstants.PER_CONNECTION_ERROR_COUNT_NAME); + + // The 2 channels should get equal amount of errors, so the totalErrorCount / 2 bucket is + // updated twice. + ArrayList histogramPointData = + new ArrayList<>(metricData.getHistogramData().getPoints()); + assertThat(histogramPointData.size()).isEqualTo(1); + HistogramPointData point = histogramPointData.get(0); + int index = findDataPointIndex(point.getBoundaries(), errorCountPerChannel); + assertThat(point.getCounts().get(index)).isEqualTo(2); + } + + @Test + public void readOverTwoPeriods() throws Exception { + long errorCount1 = 0; + long errorCount2 = 0; + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(builder.build())) { + + for (int i = 0; i < 20; i++) { + Query query; + if (i % 3 == 0) { + query = Query.create(ERROR_TABLE_NAME); + errorCount1 += 1; + } else { + query = Query.create(SUCCESS_TABLE_NAME); + } + try { + stub.readRowsCallable().call(query).iterator().hasNext(); + } catch (Exception e) { + // noop + } + } + + runInterceptorTasksAndAssertCount(); + + for (int i = 0; i < 20; i++) { + Query query; + if (i % 3 == 0) { + query = Query.create(SUCCESS_TABLE_NAME); + } else { + query = Query.create(ERROR_TABLE_NAME); + errorCount2 += 1; + } + try { + stub.readRowsCallable().call(query).iterator().hasNext(); + } catch (Exception e) { + // noop + } + } + } + + runInterceptorTasksAndAssertCount(); + + MetricData metricData = + BuiltinMetricsTestUtils.getMetricData( + metricReader, BuiltinMetricsConstants.PER_CONNECTION_ERROR_COUNT_NAME); + + ArrayList histogramPointData = + new ArrayList<>(metricData.getHistogramData().getPoints()); + assertThat(histogramPointData.size()).isEqualTo(1); + HistogramPointData point = histogramPointData.get(0); + int index1 = findDataPointIndex(point.getBoundaries(), errorCount1); + int index2 = findDataPointIndex(point.getBoundaries(), errorCount2); + assertThat(point.getCounts().get(index1)).isEqualTo(1); + assertThat(point.getCounts().get(index2)).isEqualTo(1); + } + + @Test + public void noFailedRequests() throws Exception { + try (EnhancedBigtableStub stub = EnhancedBigtableStub.create(builder.build())) { + for (int i = 0; i < 20; i++) { + try { + stub.readRowsCallable().call(Query.create(SUCCESS_TABLE_NAME)).iterator().hasNext(); + } catch (Exception e) { + // noop + } + } + } + + runInterceptorTasksAndAssertCount(); + MetricData metricData = + BuiltinMetricsTestUtils.getMetricData( + metricReader, BuiltinMetricsConstants.PER_CONNECTION_ERROR_COUNT_NAME); + long value = BuiltinMetricsTestUtils.getAggregatedValue(metricData, attributes); + assertThat(value).isEqualTo(0); + } + + private void runInterceptorTasksAndAssertCount() { + int actualNumOfTasks = 0; + for (Runnable runnable : runnableCaptor.getAllValues()) { + if (runnable instanceof ErrorCountPerConnectionMetricTracker) { + runnable.run(); + actualNumOfTasks++; + } + } + assertThat(actualNumOfTasks).isEqualTo(1); + } + + private int findDataPointIndex(List boundaries, long dataPoint) { + int index = 0; + for (; index < boundaries.size(); index++) { + if (boundaries.get(index) >= dataPoint) { + break; + } + } + return index; + } + + static class FakeService extends BigtableGrpc.BigtableImplBase { + @Override + public void readRows( + ReadRowsRequest request, StreamObserver responseObserver) { + if (request.getTableName().contains(SUCCESS_TABLE_NAME)) { + responseObserver.onNext(ReadRowsResponse.getDefaultInstance()); + responseObserver.onCompleted(); + } else { + // Send a non-retriable error, since otherwise the client tries to use the mocked + // ScheduledExecutorService object for retyring, resulting in a hang. + StatusRuntimeException exception = new StatusRuntimeException(Status.INTERNAL); + responseObserver.onError(exception); + } + } + } +} 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 index 69183f1375..d72eac4056 100644 --- 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 @@ -22,7 +22,6 @@ import com.google.api.gax.batching.Batcher; import com.google.api.gax.batching.BatcherImpl; -import com.google.api.gax.batching.BatchingDescriptor; import com.google.api.gax.batching.FlowController; import com.google.api.gax.grpc.GrpcCallContext; import com.google.api.gax.rpc.ApiCallContext; @@ -34,30 +33,31 @@ 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.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.stub.EnhancedBigtableStub; -import com.google.cloud.bigtable.data.v2.stub.EnhancedBigtableStubSettings; import com.google.cloud.bigtable.data.v2.stub.mutaterows.MutateRowsBatchingDescriptor; -import com.google.cloud.bigtable.misc_utilities.MethodComparator; 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.impl.stats.StatsComponentImpl; +import io.opencensus.stats.StatsComponent; import io.opencensus.tags.TagKey; import io.opencensus.tags.TagValue; import io.opencensus.tags.Tags; -import java.lang.reflect.Method; -import java.util.Arrays; +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; @@ -82,6 +82,7 @@ public class MetricsTracerTest { 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 long SLEEP_VARIABILITY = 15; private static final ReadRowsResponse DEFAULT_READ_ROWS_RESPONSES = ReadRowsResponse.newBuilder() @@ -97,38 +98,47 @@ public class MetricsTracerTest { @Rule public final MockitoRule mockitoRule = MockitoJUnit.rule(); - FakeServiceHelper serviceHelper; + private Server server; @Mock(answer = Answers.CALLS_REAL_METHODS) private BigtableGrpc.BigtableImplBase mockService; - private StatsComponentImpl localStats = new StatsComponentImpl(); + private final StatsComponent localStats = new SimpleStatsComponent(); private EnhancedBigtableStub stub; private BigtableDataSettings settings; @Before public void setUp() throws Exception { - serviceHelper = new FakeServiceHelper(mockService); - serviceHelper.start(); + server = FakeServiceBuilder.create(mockService).start(); RpcViews.registerBigtableClientViews(localStats.getViewManager()); settings = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.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)); + + ClientContext clientContext = + EnhancedBigtableStub.createClientContext(settings.getStubSettings()); + clientContext = + clientContext + .toBuilder() + .setTracerFactory( + EnhancedBigtableStub.createBigtableTracerFactory( + settings.getStubSettings(), + Tags.getTagger(), + localStats.getStatsRecorder(), + null)) + .build(); + stub = new EnhancedBigtableStub(settings.getStubSettings(), clientContext); } @After public void tearDown() { stub.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test @@ -155,9 +165,6 @@ public Object answer(InvocationOnMock invocation) throws Throwable { 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, @@ -191,9 +198,6 @@ public Object answer(InvocationOnMock invocation) { 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, @@ -212,29 +216,40 @@ public void testReadRowsFirstRow() throws InterruptedException { final long beforeSleep = 50; final long afterSleep = 50; + SettableFuture gotFirstRow = SettableFuture.create(); + + ExecutorService executor = Executors.newCachedThreadPool(); 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; - } + 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(); - Lists.newArrayList(stub.readRowsCallable().call(Query.create(TABLE_ID))); + + // 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); - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); + executor.shutdown(); long firstRowLatency = StatsTestUtils.getAggregationValueAsLong( @@ -245,9 +260,10 @@ public Object answer(InvocationOnMock invocation) throws Throwable { 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)); + assertThat(firstRowLatency) + .isIn( + Range.closed( + beforeSleep - SLEEP_VARIABILITY, elapsed - afterSleep + SLEEP_VARIABILITY)); } @Test @@ -279,9 +295,6 @@ public Object answer(InvocationOnMock invocation) { 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, @@ -328,9 +341,6 @@ public Object answer(InvocationOnMock invocation) throws Throwable { 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, @@ -347,12 +357,11 @@ public Object answer(InvocationOnMock invocation) throws Throwable { } @Test - public void testInvalidRequest() throws InterruptedException { + public void testInvalidRequest() { 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( @@ -385,56 +394,52 @@ public Object answer(InvocationOnMock invocation) { .when(mockService) .readRows(any(ReadRowsRequest.class), any()); - try (Batcher batcher = + try (Batcher batcher = stub.newBulkReadRowsBatcher(Query.create(TABLE_ID), GrpcCallContext.createDefault())) { batcher.add(ByteString.copyFromUtf8("row1")); - batcher.sendOutstanding(); - - // Give OpenCensus a chance to update the views asynchronously. - Thread.sleep(100); - - 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); } + + 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); - BatchingDescriptor batchingDescriptor = Mockito.mock(MutateRowsBatchingDescriptor.class); + MutateRowsBatchingDescriptor batchingDescriptor = new MutateRowsBatchingDescriptor(); + // Mock throttling final long throttled = 50; doAnswer( - new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - Thread.sleep(throttled); - return null; - } + 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); - when(batchingDescriptor.countBytes(any())).thenReturn(1l); - when(batchingDescriptor.newRequestBuilder(any())).thenCallRealMethod(); doAnswer( new Answer() { @Override public Object answer(InvocationOnMock invocation) { + MutateRowsRequest request = (MutateRowsRequest) invocation.getArguments()[0]; @SuppressWarnings("unchecked") StreamObserver observer = (StreamObserver) invocation.getArguments()[1]; - observer.onNext(MutateRowsResponse.getDefaultInstance()); + 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; } @@ -444,20 +449,19 @@ public Object answer(InvocationOnMock invocation) { ApiCallContext defaultContext = GrpcCallContext.createDefault(); - Batcher batcher = - new BatcherImpl( + try (Batcher batcher = + new BatcherImpl<>( batchingDescriptor, - stub.bulkMutateRowsCallable().withDefaultCallContext(defaultContext), + stub.internalBulkMutateRowsCallable().withDefaultCallContext(defaultContext), BulkMutation.create(TABLE_ID), settings.getStubSettings().bulkMutateRowsSettings().getBatchingSettings(), Executors.newSingleThreadScheduledExecutor(), flowController, - defaultContext); + defaultContext)) { - batcher.add(RowMutationEntry.create("key")); - batcher.sendOutstanding(); + batcher.add(RowMutationEntry.create("key").deleteRow()); + } - Thread.sleep(100); long throttledTimeMetric = StatsTestUtils.getAggregationValueAsLong( localStats, @@ -470,15 +474,6 @@ public Object answer(InvocationOnMock invocation) { assertThat(throttledTimeMetric).isAtLeast(throttled); } - @Test - public void testMethodsOverride() { - Method[] baseMethods = BigtableTracer.class.getDeclaredMethods(); - Method[] metricsTracerMethods = MetricsTracer.class.getDeclaredMethods(); - assertThat(Arrays.asList(metricsTracerMethods)) - .comparingElementsUsing(MethodComparator.METHOD_CORRESPONDENCE) - .containsAtLeastElementsIn(baseMethods); - } - @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/SimpleStatsComponent.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/SimpleStatsComponent.java new file mode 100644 index 0000000000..99aed9c3b4 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/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.stub.metrics; + +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/StatsHeadersCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/StatsHeadersCallableTest.java index c59a848281..99b0ab5b5e 100644 --- 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 @@ -29,10 +29,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.models.BulkMutation; import com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation; import com.google.cloud.bigtable.data.v2.models.Mutation; @@ -40,6 +39,8 @@ 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; @@ -47,6 +48,7 @@ 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; @@ -64,7 +66,7 @@ @RunWith(JUnit4.class) public class StatsHeadersCallableTest { - private FakeServiceHelper serviceHelper; + private Server server; private FakeService fakeService = new FakeService(); @@ -81,11 +83,10 @@ public class StatsHeadersCallableTest { @Before public void setUp() throws Exception { metadataInterceptor = new MetadataInterceptor(); - serviceHelper = new FakeServiceHelper(metadataInterceptor, fakeService); - serviceHelper.start(); + server = FakeServiceBuilder.create(fakeService).intercept(metadataInterceptor).start(); EnhancedBigtableStubSettings settings = - BigtableDataSettings.newBuilderForEmulator(serviceHelper.getPort()) + BigtableDataSettings.newBuilderForEmulator(server.getPort()) .setProjectId(PROJECT_ID) .setInstanceId(INSTANCE_ID) .setAppProfileId(APP_PROFILE_ID) @@ -97,7 +98,7 @@ public void setUp() throws Exception { @After public void tearDown() { stub.close(); - serviceHelper.shutdown(); + server.shutdown(); } @Test @@ -139,6 +140,15 @@ public void testSampleRowKeysHeaders() throws Exception { verifyHeaders(attemptCounts, startTimestamp); } + @Test + public void testSampleRowKeysWithRequestHeaders() throws Exception { + long startTimestamp = System.currentTimeMillis() * 1000; + stub.sampleRowKeysCallableWithRequest() + .call(SampleRowKeysRequest.create(TableId.of(TABLE_ID))) + .get(0); + verifyHeaders(attemptCounts, startTimestamp); + } + @Test public void testCheckAndMutateHeaders() throws Exception { long startTimestamp = System.currentTimeMillis() * 1000; @@ -223,13 +233,18 @@ public void mutateRows(MutateRowsRequest request, StreamObserver observer) { + com.google.bigtable.v2.SampleRowKeysRequest request, + StreamObserver observer) { if (callCount.get() < attemptCounts - 1) { callCount.incrementAndGet(); observer.onError(new StatusRuntimeException(Status.UNAVAILABLE)); 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/stub/metrics/StatsTestUtils.java index 6aede96161..e808af8a84 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/stub/metrics/StatsTestUtils.java @@ -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/stub/metrics/UtilTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/UtilTest.java index efef3b67d2..3c0fb4e617 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/stub/metrics/UtilTest.java @@ -30,13 +30,13 @@ public class UtilTest { @Test public void testOk() { - TagValue tagValue = Util.extractStatus((Throwable) null); + TagValue tagValue = TagValue.create(Util.extractStatus((Throwable) null)); assertThat(tagValue.asString()).isEqualTo("OK"); } @Test public void testOkFuture() { - TagValue tagValue = Util.extractStatus(Futures.immediateFuture(null)); + TagValue tagValue = Util.extractStatusFromFuture(Futures.immediateFuture(null)); assertThat(tagValue.asString()).isEqualTo("OK"); } @@ -45,7 +45,7 @@ public void testError() { DeadlineExceededException error = new DeadlineExceededException( "Deadline exceeded", null, GrpcStatusCode.of(Status.Code.DEADLINE_EXCEEDED), true); - TagValue tagValue = Util.extractStatus(error); + TagValue tagValue = TagValue.create(Util.extractStatus(error)); assertThat(tagValue.asString()).isEqualTo("DEADLINE_EXCEEDED"); } @@ -54,13 +54,13 @@ 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 = Util.extractStatusFromFuture(Futures.immediateFailedFuture(error)); assertThat(tagValue.asString()).isEqualTo("DEADLINE_EXCEEDED"); } @Test public void testCancelledFuture() { - TagValue tagValue = Util.extractStatus(Futures.immediateCancelledFuture()); + TagValue tagValue = Util.extractStatusFromFuture(Futures.immediateCancelledFuture()); assertThat(tagValue.asString()).isEqualTo("CANCELLED"); } } 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..6dd1ff9bd0 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; @@ -45,6 +48,7 @@ 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) @@ -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,16 +94,49 @@ 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 = @@ -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; @@ -381,7 +415,7 @@ static class MockRetryingFuture extends AbstractApiFuture implements Retry } @Override - public void setAttemptFuture(ApiFuture attemptFuture) { + public void setAttemptFuture(ApiFuture attemptFuture) { this.attemptFuture = attemptFuture; } @@ -391,17 +425,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..c5f11d91d5 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,26 @@ 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.common.collect.ImmutableList; import io.grpc.Status; +import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; import org.junit.Test; @@ -91,11 +97,58 @@ 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( + Arrays.asList( + FailedMutation.create( + 0, + ApiExceptionFactory.createException( + "error message", + null, + GrpcStatusCode.of(io.grpc.Status.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..170aa66188 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsErrorConverterUnaryCallableTest.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.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.stub.MutateRowsErrorConverterUnaryCallable; +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.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 { + @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("fake-table")); + } catch (Throwable t) { + unexpectedError = t; + } + assertThat(unexpectedError).isNull(); + } + + @Test + public void testPartialFailure() { + MutateRowsErrorConverterUnaryCallable callable = + new MutateRowsErrorConverterUnaryCallable(innerCallable); + + innerResult.set( + MutateRowsAttemptResult.create( + Arrays.asList( + FailedMutation.create( + 0, + ApiExceptionFactory.createException( + null, GrpcStatusCode.of(io.grpc.Status.Code.INTERNAL), false))), + true)); + + MutateRowsException exception = + Assert.assertThrows( + MutateRowsException.class, () -> callable.call(BulkMutation.create("fake-table"))); + + 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("fake-table"))); + + 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..86a94d34ea --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/mutaterows/MutateRowsRetryTest.java @@ -0,0 +1,122 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.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.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 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()); + + settings + .stubSettings() + .setTransportChannelProvider( + FixedTransportChannelProvider.create( + GrpcTransportChannel.create(serverRule.getChannel()))) + // channel priming doesn't work with FixedTransportChannelProvider. Disable it for the test + .setRefreshingChannel(false) + .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("fake-table") + .add(RowMutationEntry.create("row-key-1").setCell("cf", "q", "v"))); + } catch (ApiException e) { + Assert.fail("Rst stream errors should be retried"); + } + + Assert.assertEquals(attemptCounter.get(), 2); + } + + 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/ReadRowsFirstCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsFirstCallableTest.java index edc20e6081..07cf3478c1 100644 --- 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 @@ -15,8 +15,13 @@ */ package com.google.cloud.bigtable.data.v2.stub.readrows; -import com.google.api.core.SettableApiFuture; -import com.google.api.gax.rpc.UnaryCallable; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; + +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.cloud.bigtable.data.v2.internal.RequestContext; import com.google.cloud.bigtable.data.v2.models.Query; import com.google.cloud.bigtable.data.v2.models.Row; @@ -38,26 +43,23 @@ public class ReadRowsFirstCallableTest { private static final RequestContext REQUEST_CONTEXT = RequestContext.create("fake-project", "fake-instance", "fake-profile"); - private UnaryCallable innerCallable; + + private ServerStreamingCallable innerCallable; private ArgumentCaptor innerQuery; - private SettableApiFuture innerResult; @SuppressWarnings("unchecked") @Before public void setUp() { - innerCallable = Mockito.mock(UnaryCallable.class); + innerCallable = Mockito.mock(ServerStreamingCallable.class); innerQuery = ArgumentCaptor.forClass(Query.class); - innerResult = SettableApiFuture.create(); - Mockito.when(innerCallable.futureCall(innerQuery.capture(), Mockito.any())) - .thenReturn(innerResult); } @Test public void testLimitAdded() { ReadRowsFirstCallable callable = new ReadRowsFirstCallable<>(innerCallable); - innerResult.set(null); - callable.call(Query.create("fake-table")); - + callable.futureCall(Query.create("fake-table"), GrpcCallContext.createDefault()); + verify(innerCallable) + .call(innerQuery.capture(), any(ResponseObserver.class), any(ApiCallContext.class)); Truth.assertThat(innerQuery.getValue().toProto(REQUEST_CONTEXT)) .isEqualTo(Query.create("fake-table").limit(1).toProto(REQUEST_CONTEXT)); } @@ -65,9 +67,9 @@ public void testLimitAdded() { @Test public void testLimitChanged() { ReadRowsFirstCallable callable = new ReadRowsFirstCallable<>(innerCallable); - innerResult.set(null); - callable.call(Query.create("fake-table").limit(1_000)); - + callable.futureCall(Query.create("fake-table").limit(10), GrpcCallContext.createDefault()); + verify(innerCallable) + .call(innerQuery.capture(), any(ResponseObserver.class), any(ApiCallContext.class)); 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/ReadRowsRetryTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/readrows/ReadRowsRetryTest.java index 54a3af5cf5..8a8c6d7709 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 @@ -34,7 +34,6 @@ import com.google.cloud.bigtable.data.v2.models.Range.ByteStringRange; import com.google.cloud.bigtable.data.v2.models.Row; 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.ByteString; @@ -48,6 +47,7 @@ import java.io.IOException; import java.util.List; import java.util.Queue; +import java.util.concurrent.LinkedBlockingDeque; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -81,6 +81,8 @@ public void setUp() throws IOException { .setTransportChannelProvider( FixedTransportChannelProvider.create( GrpcTransportChannel.create(serverRule.getChannel()))) + // Refreshing channel doesn't work with FixedTransportChannelProvider + .setRefreshingChannel(false) .build(); client = BigtableDataClient.create(settings.build()); @@ -298,7 +300,7 @@ private List getResults(Query query) { } private static class TestBigtableService extends BigtableGrpc.BigtableImplBase { - Queue expectations = Queues.newArrayDeque(); + Queue expectations = new LinkedBlockingDeque<>(); int i = -1; @Override 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..b518a55415 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 @@ -41,17 +41,4 @@ public void testRequestConverted() { 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..c98506eb41 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 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..deedfbaba1 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ExecuteQueryCallableTest.java @@ -0,0 +1,198 @@ +/* + * 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.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.api.gax.rpc.UnavailableException; +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.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.internal.ProtoSqlRow; +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.sql.Statement; +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.Status; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.StreamObserver; +import java.io.IOException; +import java.util.Collections; +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; +import org.threeten.bp.Duration; + +@RunWith(JUnit4.class) +public class ExecuteQueryCallableTest { + + private static final RequestContext REQUEST_CONTEXT = + RequestContext.create("fake-project", "fake-instance", "fake-profile"); + + 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())).getMetadata()), + Collections.singletonList(stringValue("foo"))); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Collections.singletonList(row)); + ExecuteQueryCallable callable = new ExecuteQueryCallable(innerCallable, REQUEST_CONTEXT); + SqlServerStream stream = callable.call(Statement.of("SELECT * FROM table")); + + assertThat(stream.metadataFuture()) + .isEqualTo(innerCallable.getActualRequest().resultSetMetadataFuture()); + Iterator responseIterator = stream.rows().iterator(); + assertThat(responseIterator.next()).isEqualTo(row); + assertThat(responseIterator.hasNext()).isFalse(); + } + + @Test + public void testExecuteQueryRequestsAreNotRetried() { + // TODO: retries for execute query is currently disabled. This test should be + // updated once resumption token is in place. + SqlServerStream stream = stub.executeQueryCallable().call(Statement.of("SELECT * FROM table")); + + Iterator iterator = stream.rows().iterator(); + + assertThrows(UnavailableException.class, iterator::next).getCause(); + assertThat(fakeService.attempts).isEqualTo(1); + } + + @Test + public void testExecuteQueryRequestsIgnoreOverriddenMaxAttempts() throws IOException { + BigtableDataSettings.Builder overrideSettings = + BigtableDataSettings.newBuilderForEmulator(server.getPort()) + .setProjectId("fake-project") + .setInstanceId("fake-instance"); + overrideSettings + .stubSettings() + .executeQuerySettings() + .setRetrySettings(RetrySettings.newBuilder().setMaxAttempts(10).build()); + EnhancedBigtableStub overrideStub = + EnhancedBigtableStub.create(overrideSettings.build().getStubSettings()); + SqlServerStream stream = + overrideStub.executeQueryCallable().call(Statement.of("SELECT * FROM table")); + + Iterator iterator = stream.rows().iterator(); + + assertThrows(UnavailableException.class, iterator::next).getCause(); + assertThat(fakeService.attempts).isEqualTo(1); + } + + @Test + public void testExecuteQueryRequestsSetDefaultDeadline() { + SqlServerStream stream = stub.executeQueryCallable().call(Statement.of("SELECT * FROM table")); + Iterator iterator = stream.rows().iterator(); + // We don't care about this but are reusing the fake service that tests retries + assertThrows(UnavailableException.class, iterator::next).getCause(); + // We have 30s default, we give it a wide range to avoid flakiness, this is mostly just checking + // that some default is set + assertThat(fakeService.deadlineMillisRemaining).isLessThan(30001L); + } + + @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() + .setInitialRpcTimeout(Duration.ofMillis(10)) + .setMaxRpcTimeout(Duration.ofMillis(10)) + .build()); + EnhancedBigtableStub overrideDeadline = + EnhancedBigtableStub.create(overrideSettings.build().getStubSettings()); + SqlServerStream streamOverride = + overrideDeadline.executeQueryCallable().call(Statement.of("SELECT * FROM table")); + 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).getCause(); + } + + private static class FakeService extends BigtableGrpc.BigtableImplBase { + + private int attempts = 0; + 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); + } + attempts++; + responseObserver.onNext(metadata(columnMetadata("test", stringType()))); + responseObserver.onError(new StatusRuntimeException(Status.UNAVAILABLE)); + } + } +} diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataResolvingCallableTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataResolvingCallableTest.java new file mode 100644 index 0000000000..1c04a11d33 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/MetadataResolvingCallableTest.java @@ -0,0 +1,204 @@ +/* + * 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.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.bigtable.v2.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +import com.google.cloud.bigtable.data.v2.internal.ProtoResultSetMetadata; +import com.google.cloud.bigtable.data.v2.models.sql.ResultSetMetadata; +import com.google.cloud.bigtable.data.v2.stub.sql.MetadataResolvingCallable.MetadataObserver; +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 java.util.Arrays; +import java.util.Collections; +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 MetadataResolvingCallableTest { + + private static final ExecuteQueryRequest FAKE_REQUEST = ExecuteQueryRequest.newBuilder().build(); + private static final ExecuteQueryResponse METADATA = + metadata(columnMetadata("foo", stringType()), columnMetadata("bar", int64Type())); + private static final ExecuteQueryResponse DATA = + partialResultSetWithToken(stringValue("fooVal"), int64Value(100)); + + MockResponseObserver outerObserver; + SettableApiFuture metadataFuture; + MetadataResolvingCallable.MetadataObserver observer; + + @Before + public void setUp() { + metadataFuture = SettableApiFuture.create(); + outerObserver = new MockResponseObserver<>(true); + observer = new MetadataObserver(outerObserver, metadataFuture); + } + + @Test + public void observer_parsesMetadataSetsFutureAndPassesThroughResponses() + throws ExecutionException, InterruptedException { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Arrays.asList(METADATA, DATA)); + innerCallable.call(FAKE_REQUEST, observer); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThat(metadataFuture.get()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA.getMetadata())); + assertThat(outerObserver.popNextResponse()).isEqualTo(METADATA); + assertThat(outerObserver.popNextResponse()).isEqualTo(DATA); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isNull(); + } + + @Test + public void observer_invalidMetadataFailsFutureAndPassesThroughError() { + ExecuteQueryResponse invalidMetadataResponse = metadata(); + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Arrays.asList(invalidMetadataResponse, DATA)); + innerCallable.call(FAKE_REQUEST, observer); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThrows(ExecutionException.class, metadataFuture::get); + ExecutionException e = assertThrows(ExecutionException.class, metadataFuture::get); + assertThat(e.getCause()).isInstanceOf(IllegalStateException.class); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class); + } + + @Test + public void observer_invalidFirstResponseFailsFutureAndPassesThroughError() { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Collections.singletonList(DATA)); + innerCallable.call(FAKE_REQUEST, observer); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThrows(ExecutionException.class, metadataFuture::get); + ExecutionException e = assertThrows(ExecutionException.class, metadataFuture::get); + assertThat(e.getCause()).isInstanceOf(IllegalStateException.class); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class); + } + + // cancel will manifest as an onError call so these are testing both cancellation and + // other exceptions + @Test + public void observer_passesThroughErrorBeforeReceivingMetadata() { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(FAKE_REQUEST, 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); + } + + @Test + public void observer_passesThroughErrorAfterReceivingMetadata() + throws ExecutionException, InterruptedException { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(FAKE_REQUEST, observer); + MockServerStreamingCall lastCall = + innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + innerController.getObserver().onResponse(METADATA); + innerController.getObserver().onError(new RuntimeException("exception after metadata")); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThat(metadataFuture.get()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA.getMetadata())); + assertThat(outerObserver.popNextResponse()).isEqualTo(METADATA); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isInstanceOf(RuntimeException.class); + } + + @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_onCompleteBeforeMetadata_throwsException() throws InterruptedException { + MockServerStreamingCallable innerCallable = + new MockServerStreamingCallable<>(); + innerCallable.call(FAKE_REQUEST, observer); + MockServerStreamingCall lastCall = + innerCallable.popLastCall(); + MockStreamController innerController = lastCall.getController(); + + innerController.getObserver().onComplete(); + assertThrows(ExecutionException.class, metadataFuture::get); + ExecutionException e = assertThrows(ExecutionException.class, metadataFuture::get); + assertThat(e.getCause()).isInstanceOf(IllegalStateException.class); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isInstanceOf(IllegalStateException.class); + } + + @Test + public void testCallable() throws ExecutionException, InterruptedException { + ServerStreamingStashCallable innerCallable = + new ServerStreamingStashCallable<>(Arrays.asList(METADATA, DATA)); + MetadataResolvingCallable callable = new MetadataResolvingCallable(innerCallable); + MockResponseObserver outerObserver = new MockResponseObserver<>(true); + SettableApiFuture metadataFuture = SettableApiFuture.create(); + ExecuteQueryCallContext callContext = + ExecuteQueryCallContext.create(FAKE_REQUEST, metadataFuture); + + callable.call(callContext, outerObserver); + + assertThat(metadataFuture.isDone()).isTrue(); + assertThat(metadataFuture.get()) + .isEqualTo(ProtoResultSetMetadata.fromProto(METADATA.getMetadata())); + assertThat(outerObserver.popNextResponse()).isEqualTo(METADATA); + assertThat(outerObserver.popNextResponse()).isEqualTo(DATA); + assertThat(outerObserver.isDone()).isTrue(); + assertThat(outerObserver.getFinalError()).isNull(); + } +} 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..9ec406d71e --- /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 hasCompleteBatch(boolean expectation) { + if (expectation) { + check("hasCompleteBatch()").that(actual.hasCompleteBatch()).isTrue(); + } else { + check("hasCompleteBatch()").that(actual.hasCompleteBatch()).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..c4586a5c13 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/ProtoRowsMergingStateMachineTest.java @@ -0,0 +1,434 @@ +/* + * 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.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.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.assertThrows; + +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.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 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_hasCompleteBatch_falseWhenEmpty() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType())).getMetadata()); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(metadata); + assertThat(stateMachine).hasCompleteBatch(false); + } + + @Test + public void stateMachine_hasCompleteBatch_falseWhenAwaitingPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType())).getMetadata()); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + assertThat(stateMachine).hasCompleteBatch(false); + } + + @Test + public void stateMachine_hasCompleteBatch_trueWhenAwaitingBatchConsume() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType())).getMetadata()); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("bar")).getResults()); + assertThat(stateMachine).hasCompleteBatch(true); + } + + @Test + public void stateMachine_isBatchInProgress_falseWhenEmpty() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType())).getMetadata()); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(metadata); + assertThat(stateMachine).isBatchInProgress(false); + } + + @Test + public void stateMachine_isBatchInProgress_trueWhenAwaitingPartialBatch() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("a", stringType())).getMetadata()); + 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())).getMetadata()); + 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())) + .getMetadata()); + 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())).getMetadata()); + 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())).getMetadata()); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(metadata); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("foo")).getResults()); + stateMachine.addPartialResultSet( + partialResultSetWithoutToken(stringValue("bar")).getResults()); + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("baz")).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_mergesPartialBatches_withRandomChunks() { + ResultSetMetadata metadata = + ProtoResultSetMetadata.fromProto( + metadata(columnMetadata("map", mapType(stringType(), bytesType()))).getMetadata()); + 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()) + .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()))) + .getMetadata()); + 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).hasCompleteBatch(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).hasCompleteBatch(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())) + .getMetadata()); + 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())).getMetadata()); + 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())).getMetadata()); + 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())).getMetadata()); + ProtoRowsMergingStateMachine stateMachine = new ProtoRowsMergingStateMachine(metadata); + stateMachine.addPartialResultSet(partialResultSetWithToken(stringValue("test")).getResults()); + + assertThrows( + IllegalStateException.class, + () -> + stateMachine.addPartialResultSet( + partialResultSetWithToken(stringValue("test2")).getResults())); + } + } + + @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; + 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..34c49fed2e --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactory.java @@ -0,0 +1,200 @@ +/* + * 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.bigtable.v2.ArrayValue; +import com.google.bigtable.v2.ColumnMetadata; +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.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.protobuf.ByteString; +import com.google.protobuf.Timestamp; +import com.google.type.Date; +import java.util.Arrays; + +/** Utilities for creating sql proto objects in tests */ +public class SqlProtoFactory { + + private SqlProtoFactory() {} + + 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 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 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); + } + + private static ProtoRowsBatch protoRowsBatch(Value... values) { + ProtoRows protoRows = ProtoRows.newBuilder().addAllValues(Arrays.asList(values)).build(); + return ProtoRowsBatch.newBuilder().setBatchData(protoRows.toByteString()).build(); + } + + public static ExecuteQueryResponse partialResultSetWithoutToken(Value... values) { + return ExecuteQueryResponse.newBuilder() + .setResults(PartialResultSet.newBuilder().setProtoRowsBatch(protoRowsBatch(values)).build()) + .build(); + } + + public static ExecuteQueryResponse partialResultSetWithToken(Value... values) { + return ExecuteQueryResponse.newBuilder() + .setResults( + PartialResultSet.newBuilder() + .setProtoRowsBatch(protoRowsBatch(values)) + .setResumeToken(ByteString.copyFromUtf8("test")) + .build()) + .build(); + } + + public static ExecuteQueryResponse tokenOnlyResultSet(ByteString token) { + return ExecuteQueryResponse.newBuilder() + .setResults(PartialResultSet.newBuilder().setResumeToken(token)) + .build(); + } + + public static ExecuteQueryResponse metadata(ColumnMetadata... columnMetadata) { + ProtoSchema schema = + ProtoSchema.newBuilder().addAllColumns(Arrays.asList(columnMetadata)).build(); + ResultSetMetadata metadata = ResultSetMetadata.newBuilder().setProtoSchema(schema).build(); + + return ExecuteQueryResponse.newBuilder().setMetadata(metadata).build(); + } +} 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..2a3eb9e404 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlProtoFactoryTest.java @@ -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 + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 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.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")); + } +} 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..90e9672998 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergerTest.java @@ -0,0 +1,260 @@ +/* + * 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.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.ColumnMetadata; +import com.google.bigtable.v2.ExecuteQueryResponse; +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 org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class SqlRowMergerTest { + + @Test + public void sqlRowMerger_handlesEmptyState() { + SqlRowMerger merger = new SqlRowMerger(); + assertThat(merger).hasPartialFrame(false); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_handlesMetadata() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("strByteMap", mapType(stringType(), bytesType())) + }; + merger.push(metadata(columns)); + assertThat(merger).hasPartialFrame(false); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_rejectsMetadataOfUnrecognizedType() { + SqlRowMerger merger = new SqlRowMerger(); + ExecuteQueryResponse unrecognizedMetadata = + ExecuteQueryResponse.newBuilder() + .setMetadata(com.google.bigtable.v2.ResultSetMetadata.newBuilder().build()) + .build(); + + assertThrows(IllegalStateException.class, () -> merger.push(unrecognizedMetadata)); + } + + @Test + public void hasPartialFrame_trueWithIncompleteBatch() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()) + }; + merger.push(metadata(columns)); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + assertThat(merger).hasPartialFrame(true); + } + + @Test + public void hasPartialFrame_trueWithFullRow() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()) + }; + merger.push(metadata(columns)); + merger.push(partialResultSetWithToken(stringValue("test"), bytesValue("test"))); + assertThat(merger).hasPartialFrame(true); + } + + @Test + public void push_failsOnCompleteBatchWithIncompleteRow() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()) + }; + merger.push(metadata(columns)); + assertThrows( + IllegalStateException.class, + () -> merger.push(partialResultSetWithToken(stringValue("test")))); + } + + @Test + public void hasFullFrame_trueWithFullRow() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()) + }; + merger.push(metadata(columns)); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + merger.push(partialResultSetWithToken(bytesValue("test"))); + assertThat(merger).hasFullFrame(true); + } + + @Test + public void hasFullFrame_falseWithIncompleteBatch() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()) + }; + merger.push(metadata(columns)); + merger.push(partialResultSetWithoutToken(stringValue("test"))); + assertThat(merger).hasFullFrame(false); + } + + @Test + public void sqlRowMerger_handlesResponseStream() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), + columnMetadata("bytes", bytesType()), + columnMetadata("strArr", arrayType(stringType())), + columnMetadata("strByteMap", mapType(stringType(), bytesType())) + }; + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadata(columns).getMetadata()); + merger.push(metadata(columns)); + + // 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 addValue_failsWithoutMetadataFirst() { + SqlRowMerger merger = new SqlRowMerger(); + assertThrows( + IllegalStateException.class, + () -> merger.push(partialResultSetWithToken(stringValue("test")))); + } + + @Test + public void sqlRowMerger_handlesTokenWithOpenPartialBatch() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()), + }; + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadata(columns).getMetadata()); + merger.push(metadata(columns)); + 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() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()), + }; + merger.push(metadata(columns)); + 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() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = { + columnMetadata("str", stringType()), columnMetadata("bytes", bytesType()), + }; + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadata(columns).getMetadata()); + merger.push(metadata(columns)); + 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_failsOnDuplicateMetadata() { + SqlRowMerger merger = new SqlRowMerger(); + ColumnMetadata[] columns = {columnMetadata("str", stringType())}; + merger.push(metadata(columns)); + merger.push(partialResultSetWithToken(stringValue("test"))); + + assertThrows(IllegalStateException.class, () -> merger.push(metadata(columns))); + } + + @Test + public void pop_failsWhenQueueIsEmpty() { + SqlRowMerger merger = new SqlRowMerger(); + 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..761ca4090f --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/sql/SqlRowMergingCallableTest.java @@ -0,0 +1,106 @@ +/* + * 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.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.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.ExecuteQueryRequest; +import com.google.bigtable.v2.ExecuteQueryResponse; +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.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.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() { + ExecuteQueryResponse metadataResponse = + metadata( + columnMetadata("stringCol", stringType()), + columnMetadata("intCol", int64Type()), + columnMetadata("arrayCol", arrayType(stringType()))); + ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>( + Lists.newArrayList( + metadataResponse, + partialResultSetWithoutToken( + stringValue("foo"), + int64Value(1), + arrayValue(stringValue("foo"), stringValue("bar"))), + partialResultSetWithToken(stringValue("test"), int64Value(10), arrayValue()))); + + SqlRowMergingCallable rowMergingCallable = new SqlRowMergingCallable(inner); + ServerStream results = + rowMergingCallable.call( + ExecuteQueryCallContext.create( + ExecuteQueryRequest.getDefaultInstance(), SettableApiFuture.create())); + List resultsList = results.stream().collect(Collectors.toList()); + ResultSetMetadata metadata = ProtoResultSetMetadata.fromProto(metadataResponse.getMetadata()); + 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() { + // empty metadata is invalid + ServerStreamingStashCallable inner = + new ServerStreamingStashCallable<>(Lists.newArrayList(metadata())); + + SqlRowMergingCallable rowMergingCallable = new SqlRowMergingCallable(inner); + ServerStream results = + rowMergingCallable.call( + ExecuteQueryCallContext.create( + ExecuteQueryRequest.getDefaultInstance(), SettableApiFuture.create())); + + assertThrows(IllegalStateException.class, () -> results.iterator().next()); + } +} 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..23df3726d3 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; @@ -431,6 +438,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/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..83c40403f8 --- /dev/null +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/AuthorizedViewTestHelper.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.misc_utilities; + +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.test_helpers.env.TestEnvRule; +import java.util.UUID; + +public class AuthorizedViewTestHelper { + public static String AUTHORIZED_VIEW_ROW_PREFIX = "row#"; + public static String AUTHORIZED_VIEW_COLUMN_QUALIFIER = "qualifier"; + + public static AuthorizedView createTestAuthorizedView(TestEnvRule testEnvRule) { + String tableId = testEnvRule.env().getTableId(); + String authorizedViewId = UUID.randomUUID().toString(); + CreateAuthorizedViewRequest request = + CreateAuthorizedViewRequest.of(tableId, authorizedViewId) + .setAuthorizedViewType( + SubsetView.create() + .addRowPrefix(AUTHORIZED_VIEW_ROW_PREFIX) + .setFamilySubsets( + testEnvRule.env().getFamilyId(), + FamilySubsets.create() + .addQualifierPrefix(AUTHORIZED_VIEW_COLUMN_QUALIFIER))) + .setDeletionProtection(false); + return testEnvRule.env().getTableAdminClient().createAuthorizedView(request); + } +} 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 ba0fda8b2c..d7b9523b83 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 @@ -18,6 +18,7 @@ import com.google.api.core.ApiFunction; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.HeaderProvider; import com.google.api.gax.rpc.StubSettings; import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminClient; import com.google.cloud.bigtable.admin.v2.BigtableInstanceAdminSettings; @@ -31,6 +32,7 @@ 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; @@ -48,6 +50,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import javax.annotation.Nullable; /** @@ -84,9 +87,12 @@ public boolean apply(InetSocketAddress input) { 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 String tracingCookie; private final String kmsKeyName; private final BigtableDataSettings.Builder dataSettings; @@ -104,7 +110,8 @@ static CloudEnv fromSystemProperties() { getOptionalProperty(CMEK_KMS_KEY_PROPERTY_NAME, ""), getRequiredProperty(PROJECT_PROPERTY_NAME), getRequiredProperty(INSTANCE_PROPERTY_NAME), - getRequiredProperty(TABLE_PROPERTY_NAME)); + getRequiredProperty(TABLE_PROPERTY_NAME), + getOptionalProperty(TRACING_COOKIE_PROPERTY_NAME)); } private CloudEnv( @@ -113,10 +120,12 @@ private CloudEnv( @Nullable String kmsKeyName, String projectId, String instanceId, - String tableId) { + String tableId, + @Nullable String tracingCookie) { this.projectId = projectId; this.instanceId = instanceId; this.tableId = tableId; + this.tracingCookie = tracingCookie; this.kmsKeyName = kmsKeyName; this.dataSettings = @@ -125,9 +134,13 @@ private CloudEnv( dataSettings.stubSettings().setEndpoint(dataEndpoint); } - setupRemoteAddrInterceptor(dataSettings.stubSettings()); + configureConnection(dataSettings.stubSettings()); configureUserAgent(dataSettings.stubSettings()); + if (tracingCookie != null) { + injectTracingCookie(tracingCookie, dataSettings.stubSettings()); + } + this.tableAdminSettings = BigtableTableAdminSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId); if (!Strings.isNullOrEmpty(adminEndpoint)) { @@ -140,7 +153,19 @@ private CloudEnv( } } - private void setupRemoteAddrInterceptor(StubSettings.Builder stubSettings) { + 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; @@ -361,6 +386,11 @@ 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); } 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 e4b0a26515..bec3e0eef2 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 @@ -61,6 +61,7 @@ void start() throws Exception { BigtableDataSettings.newBuilderForEmulator(emulator.getPort()) .setProjectId("fake-project") .setInstanceId("fake-instance") + .setRefreshingChannel(false) .build(); dataClient = BigtableDataClient.create(dataSettings); 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 d4470637af..b6e4651c6b 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 @@ -24,23 +24,16 @@ 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.common.base.Joiner; -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; +import com.google.cloud.bigtable.admin.v2.models.UpdateAuthorizedViewRequest; 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.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; -import java.util.logging.FileHandler; 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; @@ -106,8 +99,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(); @@ -124,33 +115,6 @@ protected void before(Description description) throws Throwable { testEnv.start(); } - private void configureLogging(Description description) throws IOException { - if (!BIGTABLE_ENABLE_VERBOSE_GRPC_LOGS) { - return; - } - Preconditions.checkState( - !Strings.isNullOrEmpty(BIGTABLE_GRPC_LOG_DIR), - "The property " - + BIGTABLE_GRPC_LOG_DIR - + " must be set when verbose grpc logs are enabled"); - - 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 { cleanUpStale(); @@ -203,6 +167,7 @@ private void cleanupStaleTables(String stalePrefix) { continue; } if (stalePrefix.compareTo(tableId) > 0) { + prepTableForDelete(tableId); try { env().getTableAdminClient().deleteTable(tableId); } catch (NotFoundException ignored) { @@ -212,6 +177,21 @@ private void cleanupStaleTables(String stalePrefix) { } } + private void prepTableForDelete(String tableId) { + // Unprotected views + if (!(env() instanceof EmulatorEnv)) { + for (String viewId : env().getTableAdminClient().listAuthorizedViews(tableId)) { + try { + env() + .getTableAdminClient() + .updateAuthorizedView( + UpdateAuthorizedViewRequest.of(tableId, viewId).setDeletionProtection(false)); + } catch (NotFoundException ignored) { + } + } + } + } + /** * Clean up AppProfile that were dynamically created in the default instance that have been * orphaned. 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/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..70319867bf --- /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%n + + 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..452e0b8902 100644 --- a/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml +++ b/grpc-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml @@ -7,4 +7,9 @@ com/google/bigtable/admin/v2/*Grpc METHOD_* + + 7012 + com/google/bigtable/admin/v2/BigtableTableAdminGrpc* + * + diff --git a/grpc-google-cloud-bigtable-admin-v2/pom.xml b/grpc-google-cloud-bigtable-admin-v2/pom.xml index 72e7e5cdc6..c5a2a05390 100644 --- a/grpc-google-cloud-bigtable-admin-v2/pom.xml +++ b/grpc-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.45.0 grpc-google-cloud-bigtable-admin-v2 GRPC library for grpc-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.45.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.0 pom import @@ -74,7 +74,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 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 085763c3f6..f786bb0b33 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 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. @@ -34,7 +34,8 @@ 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< @@ -922,6 +923,53 @@ private BigtableInstanceAdminGrpc() {} return getTestIamPermissionsMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListHotTablets", + requestType = com.google.bigtable.admin.v2.ListHotTabletsRequest.class, + responseType = com.google.bigtable.admin.v2.ListHotTabletsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.admin.v2.ListHotTabletsRequest, + com.google.bigtable.admin.v2.ListHotTabletsResponse> + getListHotTabletsMethod; + if ((getListHotTabletsMethod = BigtableInstanceAdminGrpc.getListHotTabletsMethod) == null) { + synchronized (BigtableInstanceAdminGrpc.class) { + if ((getListHotTabletsMethod = BigtableInstanceAdminGrpc.getListHotTabletsMethod) == null) { + BigtableInstanceAdminGrpc.getListHotTabletsMethod = + getListHotTabletsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListHotTablets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListHotTabletsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.admin.v2.ListHotTabletsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new BigtableInstanceAdminMethodDescriptorSupplier("ListHotTablets")) + .build(); + } + } + } + return getListHotTabletsMethod; + } + /** 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 = @@ -972,7 +1020,7 @@ public BigtableInstanceAdminFutureStub newStub( * tables' metadata or data stored in those tables. * */ - public abstract static class BigtableInstanceAdminImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -986,7 +1034,7 @@ public abstract static class BigtableInstanceAdminImplBase implements io.grpc.Bi * enabled. * */ - public void createInstance( + default void createInstance( com.google.bigtable.admin.v2.CreateInstanceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1000,7 +1048,7 @@ public void createInstance( * Gets information about an instance. * */ - public void getInstance( + default void getInstance( com.google.bigtable.admin.v2.GetInstanceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1014,7 +1062,7 @@ public void getInstance( * Lists information about instances in a project. * */ - public void listInstances( + default void listInstances( com.google.bigtable.admin.v2.ListInstancesRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1031,7 +1079,7 @@ public void listInstances( * labels, use PartialUpdateInstance. * */ - public void updateInstance( + default void updateInstance( com.google.bigtable.admin.v2.Instance request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1046,7 +1094,7 @@ public void updateInstance( * fields of an Instance and is the preferred way to update an Instance. * */ - public void partialUpdateInstance( + default void partialUpdateInstance( com.google.bigtable.admin.v2.PartialUpdateInstanceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1060,7 +1108,7 @@ public void partialUpdateInstance( * Delete an instance from a project. * */ - public void deleteInstance( + default void deleteInstance( com.google.bigtable.admin.v2.DeleteInstanceRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1079,7 +1127,7 @@ public void deleteInstance( * enabled. * */ - public void createCluster( + default void createCluster( com.google.bigtable.admin.v2.CreateClusterRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1093,7 +1141,7 @@ public void createCluster( * Gets information about a cluster. * */ - public void getCluster( + default void getCluster( com.google.bigtable.admin.v2.GetClusterRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); @@ -1106,7 +1154,7 @@ public void getCluster( * Lists information about clusters in an instance. * */ - public void listClusters( + default void listClusters( com.google.bigtable.admin.v2.ListClustersRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1124,7 +1172,7 @@ public void listClusters( * must use PartialUpdateCluster. * */ - public void updateCluster( + default void updateCluster( com.google.bigtable.admin.v2.Cluster request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1147,7 +1195,7 @@ public void updateCluster( * and explicitly set a serve_node count via the update_mask. * */ - public void partialUpdateCluster( + default void partialUpdateCluster( com.google.bigtable.admin.v2.PartialUpdateClusterRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1161,7 +1209,7 @@ public void partialUpdateCluster( * Deletes a cluster from an instance. * */ - public void deleteCluster( + default void deleteCluster( com.google.bigtable.admin.v2.DeleteClusterRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1175,7 +1223,7 @@ public void deleteCluster( * Creates an app profile within an instance. * */ - public void createAppProfile( + default void createAppProfile( com.google.bigtable.admin.v2.CreateAppProfileRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1189,7 +1237,7 @@ public void createAppProfile( * Gets information about an app profile. * */ - public void getAppProfile( + default void getAppProfile( com.google.bigtable.admin.v2.GetAppProfileRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1203,7 +1251,7 @@ public void getAppProfile( * Lists information about app profiles in an instance. * */ - public void listAppProfiles( + default void listAppProfiles( com.google.bigtable.admin.v2.ListAppProfilesRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1218,7 +1266,7 @@ public void listAppProfiles( * Updates an app profile within an instance. * */ - public void updateAppProfile( + default void updateAppProfile( com.google.bigtable.admin.v2.UpdateAppProfileRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1232,7 +1280,7 @@ public void updateAppProfile( * Deletes an app profile from an instance. * */ - public void deleteAppProfile( + default void deleteAppProfile( com.google.bigtable.admin.v2.DeleteAppProfileRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1247,7 +1295,7 @@ public void deleteAppProfile( * policy if an instance 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1262,7 +1310,7 @@ public void getIamPolicy( * existing policy. * */ - public void setIamPolicy( + default void setIamPolicy( com.google.iam.v1.SetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1276,7 +1324,7 @@ public void setIamPolicy( * Returns permissions that the caller has on the specified instance resource. * */ - public void testIamPermissions( + default void testIamPermissions( com.google.iam.v1.TestIamPermissionsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1284,139 +1332,43 @@ public void testIamPermissions( 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); + } + } + + /** + * 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 io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreateInstanceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateInstanceRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_INSTANCE))) - .addMethod( - getGetInstanceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetInstanceRequest, - com.google.bigtable.admin.v2.Instance>(this, METHODID_GET_INSTANCE))) - .addMethod( - getListInstancesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListInstancesRequest, - com.google.bigtable.admin.v2.ListInstancesResponse>( - this, METHODID_LIST_INSTANCES))) - .addMethod( - getUpdateInstanceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.Instance, com.google.bigtable.admin.v2.Instance>( - this, METHODID_UPDATE_INSTANCE))) - .addMethod( - getPartialUpdateInstanceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, - com.google.longrunning.Operation>(this, METHODID_PARTIAL_UPDATE_INSTANCE))) - .addMethod( - getDeleteInstanceMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteInstanceRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_INSTANCE))) - .addMethod( - getCreateClusterMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateClusterRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_CLUSTER))) - .addMethod( - getGetClusterMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetClusterRequest, - com.google.bigtable.admin.v2.Cluster>(this, METHODID_GET_CLUSTER))) - .addMethod( - getListClustersMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListClustersRequest, - com.google.bigtable.admin.v2.ListClustersResponse>( - this, METHODID_LIST_CLUSTERS))) - .addMethod( - getUpdateClusterMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.Cluster, com.google.longrunning.Operation>( - this, METHODID_UPDATE_CLUSTER))) - .addMethod( - getPartialUpdateClusterMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.PartialUpdateClusterRequest, - com.google.longrunning.Operation>(this, METHODID_PARTIAL_UPDATE_CLUSTER))) - .addMethod( - getDeleteClusterMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteClusterRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_CLUSTER))) - .addMethod( - getCreateAppProfileMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateAppProfileRequest, - com.google.bigtable.admin.v2.AppProfile>(this, 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>(this, 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>( - this, METHODID_LIST_APP_PROFILES))) - .addMethod( - getUpdateAppProfileMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.UpdateAppProfileRequest, - com.google.longrunning.Operation>(this, METHODID_UPDATE_APP_PROFILE))) - .addMethod( - getDeleteAppProfileMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteAppProfileRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_APP_PROFILE))) - .addMethod( - getGetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_GET_IAM_POLICY))) - .addMethod( - getSetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_SET_IAM_POLICY))) - .addMethod( - getTestIamPermissionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.TestIamPermissionsRequest, - com.google.iam.v1.TestIamPermissionsResponse>( - this, METHODID_TEST_IAM_PERMISSIONS))) - .build(); + 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
    @@ -1784,10 +1736,28 @@ public void testIamPermissions(
               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); + } } /** - * + * A stub to allow clients to do synchronous rpc calls to service BigtableInstanceAdmin. * *
        * Service for creating, configuring, and deleting Cloud Bigtable Instances and
    @@ -2092,10 +2062,25 @@ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(
           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); + } } /** - * + * A stub to allow clients to do ListenableFuture-style rpc calls to service + * BigtableInstanceAdmin. * *
        * Service for creating, configuring, and deleting Cloud Bigtable Instances and
    @@ -2408,6 +2393,21 @@ protected BigtableInstanceAdminFutureStub build(
           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); + } } private static final int METHODID_CREATE_INSTANCE = 0; @@ -2430,16 +2430,17 @@ protected BigtableInstanceAdminFutureStub build( 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 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; } @@ -2556,6 +2557,12 @@ 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; default: throw new AssertionError(); } @@ -2572,6 +2579,140 @@ 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))) + .build(); + } + private abstract static class BigtableInstanceAdminBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { @@ -2596,9 +2737,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; } @@ -2640,6 +2781,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetIamPolicyMethod()) .addMethod(getSetIamPolicyMethod()) .addMethod(getTestIamPermissionsMethod()) + .addMethod(getListHotTabletsMethod()) .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 c226e35060..8e49c828c2 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 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. @@ -34,7 +34,7 @@ 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< @@ -216,6 +216,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; @@ -257,6 +299,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> @@ -883,6 +1209,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; @@ -1056,7 +1424,7 @@ public BigtableTableAdminFutureStub newStub( * the tables. *
    */ - public abstract static class BigtableTableAdminImplBase implements io.grpc.BindableService { + public interface AsyncService { /** * @@ -1067,7 +1435,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1087,7 +1455,7 @@ public void createTable( * policy. *
    */ - public void createTableFromSnapshot( + default void createTableFromSnapshot( com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1101,7 +1469,7 @@ 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) { @@ -1115,12 +1483,26 @@ 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) { 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); + } + /** * * @@ -1128,13 +1510,98 @@ 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) { 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); + } + /** * * @@ -1145,7 +1612,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1161,7 +1628,7 @@ public void modifyColumnFamilies( * particular prefix. * */ - public void dropRowRange( + default void dropRowRange( com.google.bigtable.admin.v2.DropRowRangeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1178,7 +1645,7 @@ public void dropRowRange( * for 90 days. * */ - public void generateConsistencyToken( + default void generateConsistencyToken( com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1195,7 +1662,7 @@ 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) { @@ -1216,7 +1683,7 @@ public void checkConsistency( * policy. * */ - public void snapshotTable( + default void snapshotTable( com.google.bigtable.admin.v2.SnapshotTableRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1235,7 +1702,7 @@ public void snapshotTable( * policy. * */ - public void getSnapshot( + default void getSnapshot( com.google.bigtable.admin.v2.GetSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1254,7 +1721,7 @@ public void getSnapshot( * policy. * */ - public void listSnapshots( + default void listSnapshots( com.google.bigtable.admin.v2.ListSnapshotsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1274,7 +1741,7 @@ public void listSnapshots( * policy. * */ - public void deleteSnapshot( + default void deleteSnapshot( com.google.bigtable.admin.v2.DeleteSnapshotRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1291,11 +1758,11 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1309,7 +1776,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBackupMethod(), responseObserver); @@ -1322,7 +1789,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1336,7 +1803,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1351,7 +1818,7 @@ public void deleteBackup( * backups. * */ - public void listBackups( + default void listBackups( com.google.bigtable.admin.v2.ListBackupsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -1363,23 +1830,36 @@ public void listBackups( * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same project 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getRestoreTableMethod(), responseObserver); } + /** + * + * + *
    +     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
    +     * located in the destination instance and project.
    +     * 
    + */ + default void copyBackup( + com.google.bigtable.admin.v2.CopyBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCopyBackupMethod(), responseObserver); + } + /** * * @@ -1389,7 +1869,7 @@ public void restoreTable( * set. * */ - public void getIamPolicy( + default void getIamPolicy( com.google.iam.v1.GetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1404,7 +1884,7 @@ public void getIamPolicy( * Replaces any existing policy. * */ - public void setIamPolicy( + default void setIamPolicy( com.google.iam.v1.SetIamPolicyRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( @@ -1415,163 +1895,39 @@ 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 Table or Backup
    +     * resource.
          * 
    */ - public void testIamPermissions( + default void testIamPermissions( com.google.iam.v1.TestIamPermissionsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getTestIamPermissionsMethod(), 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(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateTableRequest, - com.google.bigtable.admin.v2.Table>(this, METHODID_CREATE_TABLE))) - .addMethod( - getCreateTableFromSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest, - com.google.longrunning.Operation>(this, 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>(this, METHODID_LIST_TABLES))) - .addMethod( - getGetTableMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetTableRequest, - com.google.bigtable.admin.v2.Table>(this, METHODID_GET_TABLE))) - .addMethod( - getDeleteTableMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteTableRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_TABLE))) - .addMethod( - getModifyColumnFamiliesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest, - com.google.bigtable.admin.v2.Table>(this, METHODID_MODIFY_COLUMN_FAMILIES))) - .addMethod( - getDropRowRangeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DropRowRangeRequest, com.google.protobuf.Empty>( - this, 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>( - this, 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>( - this, METHODID_CHECK_CONSISTENCY))) - .addMethod( - getSnapshotTableMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.SnapshotTableRequest, - com.google.longrunning.Operation>(this, METHODID_SNAPSHOT_TABLE))) - .addMethod( - getGetSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetSnapshotRequest, - com.google.bigtable.admin.v2.Snapshot>(this, METHODID_GET_SNAPSHOT))) - .addMethod( - getListSnapshotsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListSnapshotsRequest, - com.google.bigtable.admin.v2.ListSnapshotsResponse>( - this, METHODID_LIST_SNAPSHOTS))) - .addMethod( - getDeleteSnapshotMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteSnapshotRequest, - com.google.protobuf.Empty>(this, METHODID_DELETE_SNAPSHOT))) - .addMethod( - getCreateBackupMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.CreateBackupRequest, - com.google.longrunning.Operation>(this, METHODID_CREATE_BACKUP))) - .addMethod( - getGetBackupMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.GetBackupRequest, - com.google.bigtable.admin.v2.Backup>(this, METHODID_GET_BACKUP))) - .addMethod( - getUpdateBackupMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.UpdateBackupRequest, - com.google.bigtable.admin.v2.Backup>(this, METHODID_UPDATE_BACKUP))) - .addMethod( - getDeleteBackupMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.DeleteBackupRequest, com.google.protobuf.Empty>( - this, METHODID_DELETE_BACKUP))) - .addMethod( - getListBackupsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.ListBackupsRequest, - com.google.bigtable.admin.v2.ListBackupsResponse>( - this, METHODID_LIST_BACKUPS))) - .addMethod( - getRestoreTableMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.admin.v2.RestoreTableRequest, - com.google.longrunning.Operation>(this, METHODID_RESTORE_TABLE))) - .addMethod( - getGetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_GET_IAM_POLICY))) - .addMethod( - getSetIamPolicyMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( - this, METHODID_SET_IAM_POLICY))) - .addMethod( - getTestIamPermissionsMethod(), - io.grpc.stub.ServerCalls.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.
    @@ -1585,26 +1941,125 @@ private BigtableTableAdminStub(io.grpc.Channel channel, io.grpc.CallOptions call
           super(channel, callOptions);
         }
     
    -    @java.lang.Override
    -    protected BigtableTableAdminStub build(
    -        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    -      return new BigtableTableAdminStub(channel, callOptions);
    +    @java.lang.Override
    +    protected BigtableTableAdminStub build(
    +        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
    +      return new BigtableTableAdminStub(channel, callOptions);
    +    }
    +
    +    /**
    +     *
    +     *
    +     * 
    +     * Creates a new table in the specified instance.
    +     * The table can be created with a full set of initial column families,
    +     * specified in the request.
    +     * 
    + */ + public void createTable( + com.google.bigtable.admin.v2.CreateTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
    +     * Creates a new table from the specified snapshot. The target table must
    +     * not exist. The snapshot and the table must be in the same instance.
    +     * Note: This is a private alpha release of Cloud Bigtable snapshots. This
    +     * feature is not currently available to most Cloud Bigtable customers. This
    +     * feature might be changed in backward-incompatible ways and is not
    +     * recommended for production use. It is not subject to any SLA or deprecation
    +     * policy.
    +     * 
    + */ + public void createTableFromSnapshot( + com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateTableFromSnapshotMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
    +     * Lists all tables served from a specified instance.
    +     * 
    + */ + public void listTables( + com.google.bigtable.admin.v2.ListTablesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListTablesMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
    +     * Gets metadata information about the specified table.
    +     * 
    + */ + public void getTable( + com.google.bigtable.admin.v2.GetTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetTableMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
    +     * Updates a specified table.
    +     * 
    + */ + public void updateTable( + com.google.bigtable.admin.v2.UpdateTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateTableMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
    +     * Permanently deletes a specified table and all of its data.
    +     * 
    + */ + public void deleteTable( + com.google.bigtable.admin.v2.DeleteTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteTableMethod(), getCallOptions()), + request, + responseObserver); } /** * * *
    -     * 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.
    +     * Restores a specified table which was accidentally deleted.
          * 
    */ - public void createTable( - com.google.bigtable.admin.v2.CreateTableRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void undeleteTable( + com.google.bigtable.admin.v2.UndeleteTableRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateTableMethod(), getCallOptions()), + getChannel().newCall(getUndeleteTableMethod(), getCallOptions()), request, responseObserver); } @@ -1613,20 +2068,14 @@ public void createTable( * * *
    -     * 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.
    +     * Creates a new AuthorizedView in a table.
          * 
    */ - public void createTableFromSnapshot( - com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest request, + public void createAuthorizedView( + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateTableFromSnapshotMethod(), getCallOptions()), + getChannel().newCall(getCreateAuthorizedViewMethod(), getCallOptions()), request, responseObserver); } @@ -1635,43 +2084,63 @@ public void createTableFromSnapshot( * * *
    -     * Lists all tables served from a specified instance.
    +     * Lists all AuthorizedViews from a specific table.
          * 
    */ - public void listTables( - com.google.bigtable.admin.v2.ListTablesRequest request, - io.grpc.stub.StreamObserver + public void listAuthorizedViews( + com.google.bigtable.admin.v2.ListAuthorizedViewsRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTablesMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getListAuthorizedViewsMethod(), getCallOptions()), + request, + responseObserver); } /** * * *
    -     * Gets metadata information about the specified table.
    +     * Gets information from a specified AuthorizedView.
          * 
    */ - public void getTable( - com.google.bigtable.admin.v2.GetTableRequest request, - io.grpc.stub.StreamObserver responseObserver) { + public void getAuthorizedView( + com.google.bigtable.admin.v2.GetAuthorizedViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetTableMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getGetAuthorizedViewMethod(), getCallOptions()), + request, + responseObserver); } /** * * *
    -     * Permanently deletes a specified table and all of its data.
    +     * Updates an AuthorizedView in a table.
          * 
    */ - public void deleteTable( - com.google.bigtable.admin.v2.DeleteTableRequest request, + 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(getDeleteTableMethod(), getCallOptions()), + getChannel().newCall(getDeleteAuthorizedViewMethod(), getCallOptions()), request, responseObserver); } @@ -1848,8 +2317,8 @@ 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( @@ -1929,12 +2398,11 @@ public void listBackups( * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same project 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.
          * 
    @@ -1948,6 +2416,21 @@ public void restoreTable( responseObserver); } + /** + * + * + *
    +     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
    +     * located in the destination instance and project.
    +     * 
    + */ + public void copyBackup( + com.google.bigtable.admin.v2.CopyBackupRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCopyBackupMethod(), getCallOptions()), request, responseObserver); + } + /** * * @@ -1987,7 +2470,8 @@ 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 Table or Backup
    +     * resource.
          * 
    */ public void testIamPermissions( @@ -2002,7 +2486,7 @@ public void testIamPermissions( } /** - * + * A stub to allow clients to do synchronous rpc calls to service BigtableTableAdmin. * *
        * Service for creating, configuring, and deleting Cloud Bigtable tables.
    @@ -2083,6 +2567,19 @@ public com.google.bigtable.admin.v2.Table getTable(
               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); + } + /** * * @@ -2096,6 +2593,84 @@ public com.google.protobuf.Empty deleteTable( 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); + } + /** * * @@ -2241,8 +2816,8 @@ 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( @@ -2308,12 +2883,11 @@ public com.google.bigtable.admin.v2.ListBackupsResponse listBackups( * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same project 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.
          * 
    @@ -2324,6 +2898,20 @@ public com.google.longrunning.Operation restoreTable( 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); + } + /** * * @@ -2355,7 +2943,8 @@ public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyReque * * *
    -     * Returns permissions that the caller has on the specified Table or Backup resource.
    +     * Returns permissions that the caller has on the specified Table or Backup
    +     * resource.
          * 
    */ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( @@ -2366,7 +2955,7 @@ public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( } /** - * + * A stub to allow clients to do ListenableFuture-style rpc calls to service BigtableTableAdmin. * *
        * Service for creating, configuring, and deleting Cloud Bigtable tables.
    @@ -2448,6 +3037,19 @@ protected BigtableTableAdminFutureStub build(
               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); + } + /** * * @@ -2461,6 +3063,86 @@ protected BigtableTableAdminFutureStub build( 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); + } + /** * * @@ -2610,8 +3292,8 @@ 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 @@ -2678,12 +3360,11 @@ protected BigtableTableAdminFutureStub build( * * *
    -     * Create a new table by restoring from a completed backup. The new table
    -     * must be in the same project 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.
          * 
    @@ -2694,6 +3375,20 @@ protected BigtableTableAdminFutureStub build( getChannel().newCall(getRestoreTableMethod(), getCallOptions()), request); } + /** + * + * + *
    +     * Copy a Cloud Bigtable backup to a new backup in the destination cluster
    +     * located in the destination instance and project.
    +     * 
    + */ + public com.google.common.util.concurrent.ListenableFuture + copyBackup(com.google.bigtable.admin.v2.CopyBackupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCopyBackupMethod(), getCallOptions()), request); + } + /** * * @@ -2727,7 +3422,8 @@ 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 Table or Backup
    +     * resource.
          * 
    */ public com.google.common.util.concurrent.ListenableFuture< @@ -2742,34 +3438,42 @@ protected BigtableTableAdminFutureStub build( 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 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; } @@ -2799,11 +3503,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, @@ -2880,6 +3622,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, @@ -2912,6 +3659,198 @@ 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))) + .build(); + } + private abstract static class BigtableTableAdminBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { @@ -2936,9 +3875,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; } @@ -2964,7 +3903,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()) @@ -2979,6 +3925,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getDeleteBackupMethod()) .addMethod(getListBackupsMethod()) .addMethod(getRestoreTableMethod()) + .addMethod(getCopyBackupMethod()) .addMethod(getGetIamPolicyMethod()) .addMethod(getSetIamPolicyMethod()) .addMethod(getTestIamPermissionsMethod()) diff --git a/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml b/grpc-google-cloud-bigtable-v2/clirr-ignored-differences.xml index 9f4bd315b7..ee16d40221 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 + *executeQuery(* diff --git a/grpc-google-cloud-bigtable-v2/pom.xml b/grpc-google-cloud-bigtable-v2/pom.xml index 8d7d9566f1..840387af63 100644 --- a/grpc-google-cloud-bigtable-v2/pom.xml +++ b/grpc-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.5.3 + 2.45.0 grpc-google-cloud-bigtable-v2 GRPC library for grpc-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.45.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.0 pom import @@ -66,7 +66,6 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 protected true diff --git a/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java b/grpc-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/BigtableGrpc.java index ddb99b378f..6917926d9f 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 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. @@ -32,7 +32,7 @@ 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< @@ -246,6 +246,47 @@ private BigtableGrpc() {} return getCheckAndMutateRowMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PingAndWarm", + requestType = com.google.bigtable.v2.PingAndWarmRequest.class, + responseType = com.google.bigtable.v2.PingAndWarmResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod() { + io.grpc.MethodDescriptor< + com.google.bigtable.v2.PingAndWarmRequest, com.google.bigtable.v2.PingAndWarmResponse> + getPingAndWarmMethod; + if ((getPingAndWarmMethod = BigtableGrpc.getPingAndWarmMethod) == null) { + synchronized (BigtableGrpc.class) { + if ((getPingAndWarmMethod = BigtableGrpc.getPingAndWarmMethod) == null) { + BigtableGrpc.getPingAndWarmMethod = + getPingAndWarmMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PingAndWarm")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PingAndWarmRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.bigtable.v2.PingAndWarmResponse.getDefaultInstance())) + .setSchemaDescriptor(new BigtableMethodDescriptorSupplier("PingAndWarm")) + .build(); + } + } + } + return getPingAndWarmMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.bigtable.v2.ReadModifyWriteRowRequest, com.google.bigtable.v2.ReadModifyWriteRowResponse> @@ -293,6 +334,145 @@ 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.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 = @@ -340,7 +520,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 { /** * @@ -353,7 +533,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadRowsMethod(), responseObserver); @@ -369,7 +549,7 @@ public void readRows( * mapreduces. * */ - public void sampleRowKeys( + default void sampleRowKeys( com.google.bigtable.v2.SampleRowKeysRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -385,7 +565,7 @@ 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) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMutateRowMethod(), responseObserver); @@ -400,7 +580,7 @@ public void mutateRow( * atomically. * */ - public void mutateRows( + default void mutateRows( com.google.bigtable.v2.MutateRowsRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMutateRowsMethod(), responseObserver); @@ -413,7 +593,7 @@ 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) { @@ -421,6 +601,21 @@ public void checkAndMutateRow( getCheckAndMutateRowMethod(), responseObserver); } + /** + * + * + *
    +     * Warm up associated instance metadata for this connection.
    +     * This call is not required but may be useful for connection keep-alive.
    +     * 
    + */ + default void pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPingAndWarmMethod(), responseObserver); + } + /** * * @@ -432,7 +627,7 @@ 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) { @@ -440,54 +635,75 @@ public void readModifyWriteRow( getReadModifyWriteRowMethod(), responseObserver); } + /** + * + * + *
    +     * NOTE: This API is intended to be used by Apache Beam BigtableIO.
    +     * 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`.
    +     * 
    + */ + 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); + } + + /** + * + * + *
    +     * NOTE: This API is intended to be used by Apache Beam BigtableIO.
    +     * Reads changes from a table's change stream. Changes will
    +     * reflect both user-initiated mutations and mutations that are caused by
    +     * garbage collection.
    +     * 
    + */ + default void readChangeStream( + com.google.bigtable.v2.ReadChangeStreamRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReadChangeStreamMethod(), responseObserver); + } + + /** + * + * + *
    +     * Executes a BTQL query against a particular Cloud 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(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.bigtable.v2.ReadRowsRequest, - com.google.bigtable.v2.ReadRowsResponse>(this, METHODID_READ_ROWS))) - .addMethod( - getSampleRowKeysMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.bigtable.v2.SampleRowKeysRequest, - com.google.bigtable.v2.SampleRowKeysResponse>( - this, METHODID_SAMPLE_ROW_KEYS))) - .addMethod( - getMutateRowMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.v2.MutateRowRequest, - com.google.bigtable.v2.MutateRowResponse>(this, METHODID_MUTATE_ROW))) - .addMethod( - getMutateRowsMethod(), - io.grpc.stub.ServerCalls.asyncServerStreamingCall( - new MethodHandlers< - com.google.bigtable.v2.MutateRowsRequest, - com.google.bigtable.v2.MutateRowsResponse>(this, METHODID_MUTATE_ROWS))) - .addMethod( - getCheckAndMutateRowMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.bigtable.v2.CheckAndMutateRowRequest, - com.google.bigtable.v2.CheckAndMutateRowResponse>( - this, METHODID_CHECK_AND_MUTATE_ROW))) - .addMethod( - getReadModifyWriteRowMethod(), - io.grpc.stub.ServerCalls.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.
    @@ -589,6 +805,23 @@ public void checkAndMutateRow(
               responseObserver);
         }
     
    +    /**
    +     *
    +     *
    +     * 
    +     * Warm up associated instance metadata for this connection.
    +     * This call is not required but may be useful for connection keep-alive.
    +     * 
    + */ + public void pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPingAndWarmMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -609,10 +842,67 @@ public void readModifyWriteRow( request, responseObserver); } + + /** + * + * + *
    +     * NOTE: This API is intended to be used by Apache Beam BigtableIO.
    +     * 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`.
    +     * 
    + */ + 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); + } + + /** + * + * + *
    +     * NOTE: This API is intended to be used by Apache Beam BigtableIO.
    +     * Reads changes from a table's change stream. Changes will
    +     * reflect both user-initiated mutations and mutations that are caused by
    +     * garbage collection.
    +     * 
    + */ + 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); + } + + /** + * + * + *
    +     * Executes a BTQL query against a particular Cloud 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.
    @@ -704,6 +994,20 @@ public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow(
               getChannel(), getCheckAndMutateRowMethod(), getCallOptions(), request);
         }
     
    +    /**
    +     *
    +     *
    +     * 
    +     * Warm up associated instance metadata for this connection.
    +     * This call is not required but may be useful for connection keep-alive.
    +     * 
    + */ + public com.google.bigtable.v2.PingAndWarmResponse pingAndWarm( + com.google.bigtable.v2.PingAndWarmRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPingAndWarmMethod(), getCallOptions(), request); + } + /** * * @@ -720,10 +1024,59 @@ public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getReadModifyWriteRowMethod(), getCallOptions(), request); } + + /** + * + * + *
    +     * NOTE: This API is intended to be used by Apache Beam BigtableIO.
    +     * 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`.
    +     * 
    + */ + public java.util.Iterator + generateInitialChangeStreamPartitions( + com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), + getGenerateInitialChangeStreamPartitionsMethod(), + getCallOptions(), + request); + } + + /** + * + * + *
    +     * NOTE: This API is intended to be used by Apache Beam BigtableIO.
    +     * Reads changes from a table's change stream. Changes will
    +     * reflect both user-initiated mutations and mutations that are caused by
    +     * garbage collection.
    +     * 
    + */ + public java.util.Iterator readChangeStream( + com.google.bigtable.v2.ReadChangeStreamRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getReadChangeStreamMethod(), getCallOptions(), request); + } + + /** + * + * + *
    +     * Executes a BTQL query against a particular Cloud 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.
    @@ -769,6 +1122,21 @@ protected BigtableFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions
               getChannel().newCall(getCheckAndMutateRowMethod(), getCallOptions()), request);
         }
     
    +    /**
    +     *
    +     *
    +     * 
    +     * Warm up associated instance metadata for this connection.
    +     * This call is not required but may be useful for connection keep-alive.
    +     * 
    + */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.bigtable.v2.PingAndWarmResponse> + pingAndWarm(com.google.bigtable.v2.PingAndWarmRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPingAndWarmMethod(), getCallOptions()), request); + } + /** * * @@ -793,17 +1161,21 @@ 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_EXECUTE_QUERY = 9; 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; } @@ -842,12 +1214,37 @@ 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_EXECUTE_QUERY: + serviceImpl.executeQuery( + (com.google.bigtable.v2.ExecuteQueryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -864,6 +1261,76 @@ 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( + 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 { @@ -886,9 +1353,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; } @@ -915,7 +1382,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getMutateRowMethod()) .addMethod(getMutateRowsMethod()) .addMethod(getCheckAndMutateRowMethod()) + .addMethod(getPingAndWarmMethod()) .addMethod(getReadModifyWriteRowMethod()) + .addMethod(getGenerateInitialChangeStreamPartitionsMethod()) + .addMethod(getReadChangeStreamMethod()) + .addMethod(getExecuteQueryMethod()) .build(); } } diff --git a/owlbot.py b/owlbot.py index 6a08b5638f..c9aac4e206 100644 --- a/owlbot.py +++ b/owlbot.py @@ -97,14 +97,21 @@ def make_internal_only(sources): 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' + '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 e8e5ef249e..fbd2eed2e0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ google-cloud-bigtable-parent pom - 2.5.3 + 2.45.0 Google Cloud Bigtable Parent https://github.com/googleapis/java-bigtable @@ -13,8 +13,9 @@ com.google.cloud - google-cloud-shared-config - 1.2.7 + sdk-platform-java-config + 3.36.1 + @@ -152,43 +153,43 @@ com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.5.3 + 2.45.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.45.0 com.google.api.grpc grpc-google-cloud-bigtable-v2 - 2.5.3 + 2.45.0 com.google.api.grpc grpc-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.45.0 com.google.cloud google-cloud-bigtable - 2.5.3 + 2.45.0 com.google.cloud google-cloud-conformance-tests - 0.2.7 + 0.3.7 com.google.truth truth - 1.1.3 + 1.4.4 com.google.truth.extensions truth-proto-extension - 1.1.3 + 1.4.4 test @@ -206,12 +207,29 @@ org.mockito mockito-core - 4.3.1 + 4.11.0 + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + requireUpperBoundDeps + false + + + + + @@ -225,7 +243,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.8.0 aggregate @@ -244,6 +262,7 @@ + none protected true @@ -284,18 +303,19 @@ **/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.2.4 + 3.6.0 + + + org.apache.maven.plugins + maven-dependency-plugin + + true + @@ -303,23 +323,36 @@ docFX + + ${env.KOKORO_GFILE_DIR}/java-docfx-doclet-1.9.0.jar + org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + com.microsoft.doclet.DocFxDoclet false - ${env.KOKORO_GFILE_DIR}/java-docfx-doclet-1.5.0.jar + + ${docletPath} -outputpath ${project.build.directory}/docfx-yml - -projectname ${artifactId} + -projectname ${project.artifactId} - -excludeclasses com\.google\.cloud\.bigtable\.admin\.v2\.internal\.:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableInstanceAdminClient:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableInstanceAdminSettings:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableInstanceAdminCallableFactory:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableInstanceAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.BigtableInstanceAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableTableAdminClient:com\.google\.cloud\.bigtable\.admin\.v2\.BaseBigtableTableAdminSettings:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableTableAdminCallableFactory:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.GrpcBigtableTableAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.BigtableTableAdminStub:com\.google\.cloud\.bigtable\.admin\.v2\.stub\.EnhancedBigtableTableAdminStub:com\.google\.cloud\.bigtable\.data\.v2\.internal\.:com\.google\.cloud\.bigtable\.data\.v2\.BaseBigtableDataClient:com\.google\.cloud\.bigtable\.data\.v2\.BaseBigtableDataSettings:com\.google\.cloud\.bigtable\.data\.v2\.stub\.BigtableStub:com\.google\.cloud\.bigtable\.data\.v2\.stub\.BigtableStubSettings:com\.google\.cloud\.bigtable\.data\.v2\.stub\.GrpcBigtableStub:com\.google\.cloud\.bigtable\.data\.v2\.stub\.GrpcBigtableCallableFactory:com\.google\.cloud\.bigtable\.data\.v2\.stub\.EnhancedBigtableStub:com\.google\.cloud\.bigtable\.data\.v2\.stub\.mutaterows\.:com\.google\.cloud\.bigtable\.data\.v2\.stub\.readrows\.:com\.google\.cloud\.bigtable\.data\.v2\.stub\.metrics\. + + -excludeclasses com\.google\.cloud\.bigtable\.admin\.v2\.(internal\.|(Base.*).*|stub\.(?!Bigtable.*StubSettings).*):com\.google\.cloud\.bigtable\.data\.v2\.(internal\.|(Base.*).*|stub\.(?!Enhanced.*StubSettings).*) + + -excludepackages com\.google\.(bigtable\.v2|bigtable\.admin\.v2|cloud\.bigtable\.stats) + aggregate @@ -332,21 +365,6 @@ - - - with-shaded - - - !skip-shaded - - - - google-cloud-bigtable-stats - - @@ -355,6 +373,7 @@ 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 8037ba0f9e..ba54b21a67 100644 --- a/proto-google-cloud-bigtable-admin-v2/pom.xml +++ b/proto-google-cloud-bigtable-admin-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-admin-v2 - 2.5.3 + 2.45.0 proto-google-cloud-bigtable-admin-v2 PROTO library for proto-google-cloud-bigtable-admin-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.45.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.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 ca41c7f286..e2ca508f61 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -50,113 +51,6 @@ 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; @@ -172,6 +66,139 @@ 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), + ; + + /** + * + * + *
    +     * 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 final 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) @@ -231,6 +258,54 @@ public interface MultiClusterRoutingUseAnyOrBuilder * @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(); } /** * @@ -256,7 +331,7 @@ private MultiClusterRoutingUseAny(com.google.protobuf.GeneratedMessageV3.Builder } private MultiClusterRoutingUseAny() { - clusterIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -265,62 +340,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new MultiClusterRoutingUseAny(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - 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(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - clusterIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - clusterIds_.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)) { - clusterIds_ = clusterIds_.getUnmodifiableView(); - } - 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_MultiClusterRoutingUseAny_descriptor; @@ -336,870 +355,656 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder.class); } - public static final int CLUSTER_IDS_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList clusterIds_; - /** - * - * - *
    -     * The set of clusters to route to. The order is ignored; clusters will be
    -     * tried in order of distance. If left empty, all clusters are eligible.
    -     * 
    - * - * repeated string cluster_ids = 1; - * - * @return A list containing the clusterIds. - */ - public com.google.protobuf.ProtocolStringList getClusterIdsList() { - return clusterIds_; - } - /** - * - * - *
    -     * The set of clusters to route to. The order is ignored; clusters will be
    -     * tried in order of distance. If left empty, all clusters are eligible.
    -     * 
    - * - * repeated string cluster_ids = 1; - * - * @return The count of clusterIds. - */ - public int getClusterIdsCount() { - return clusterIds_.size(); - } - /** - * - * - *
    -     * The set of clusters to route to. The order is ignored; clusters will be
    -     * tried in order of distance. If left empty, all clusters are eligible.
    -     * 
    - * - * repeated string cluster_ids = 1; - * - * @param index The index of the element to return. - * @return The clusterIds at the given index. - */ - public java.lang.String getClusterIds(int index) { - return clusterIds_.get(index); - } + public interface RowAffinityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + 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.
    +     * 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.
          * 
    * - * repeated string cluster_ids = 1; - * - * @param index The index of the value to return. - * @return The bytes of the clusterIds at the given index. + * Protobuf type {@code + * google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} */ - public com.google.protobuf.ByteString getClusterIdsBytes(int index) { - return clusterIds_.getByteString(index); - } + public static final class RowAffinity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + RowAffinityOrBuilder { + private static final long serialVersionUID = 0L; + // Use RowAffinity.newBuilder() to construct. + private RowAffinity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } - private byte memoizedIsInitialized = -1; + private RowAffinity() {} - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RowAffinity(); + } - memoizedIsInitialized = 1; - return true; - } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < clusterIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clusterIds_.getRaw(i)); + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.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); } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private byte memoizedIsInitialized = -1; - size = 0; - { - int dataSize = 0; - for (int i = 0; i < clusterIds_.size(); i++) { - dataSize += computeStringSizeNoTag(clusterIds_.getRaw(i)); - } - size += dataSize; - size += 1 * getClusterIdsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { + memoizedIsInitialized = 1; return true; } - if (!(obj instanceof com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny)) { - return super.equals(obj); - } - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other = - (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) obj; - - if (!getClusterIdsList().equals(other.getClusterIdsList())) return false; - if (!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(); - if (getClusterIdsCount() > 0) { - hash = (37 * hash) + CLUSTER_IDS_FIELD_NUMBER; - hash = (53 * hash) + getClusterIdsList().hashCode(); + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getUnknownFields().writeTo(output); } - 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(); - } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity other = + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) obj; - public static Builder newBuilder( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + @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; + } - @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; + 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 - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.class, - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder.class); + public 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); } - // Construct using - // com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + 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); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + 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); } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + 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 clear() { - super.clear(); - clusterIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; + 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 com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance(); + 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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny build() { - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - @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); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - clusterIds_ = clusterIds_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.clusterIds_ = clusterIds_; - onBuilt(); - return result; + 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.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - @java.lang.Override - public Builder clone() { - return super.clone(); + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - @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.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 clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + public Builder newBuilderForType() { + return newBuilder(); } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); } - @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 Builder newBuilder( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @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; - } + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } + /** + * + * + *
    +       * If enabled, Bigtable will route the request based on the row key of the
    +       * request, rather than randomly. Instead, each row key will be assigned
    +       * to a cluster, and will stick to that cluster. If clusters are added or
    +       * removed, then this may affect which row keys stick to which clusters.
    +       * To avoid this, users can use a cluster group to specify which clusters
    +       * are to be used. In this case, new clusters that are not a part of the
    +       * cluster group will not be routed to, and routing will be unaffected by
    +       * the new cluster. Moreover, clusters specified in the cluster group cannot
    +       * be deleted unless removed from the cluster group.
    +       * 
    + * + * Protobuf type {@code + * google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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; + } - public Builder mergeFrom( - com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny other) { - if (other - == com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - .getDefaultInstance()) return this; - if (!other.clusterIds_.isEmpty()) { - if (clusterIds_.isEmpty()) { - clusterIds_ = other.clusterIds_; - bitField0_ = (bitField0_ & ~0x00000001); + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .class, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .Builder.class); + } + + // Construct using + // com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + build() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + buildPartial() { + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity result = + new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity( + this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder 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.AppProfile.MultiClusterRoutingUseAny.RowAffinity) { + return mergeFrom( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + other); } else { - ensureClusterIdsIsMutable(); - clusterIds_.addAll(other.clusterIds_); + 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; } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + @java.lang.Override + public final 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.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); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (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; } - 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.AppProfile.MultiClusterRoutingUseAny.RowAffinity) } - private int bitField0_; + // @@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; - private com.google.protobuf.LazyStringList clusterIds_ = - com.google.protobuf.LazyStringArrayList.EMPTY; + static { + DEFAULT_INSTANCE = + new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity(); + } - private void ensureClusterIdsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - clusterIds_ = new com.google.protobuf.LazyStringArrayList(clusterIds_); - bitField0_ |= 0x00000001; - } + public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getDefaultInstance() { + return DEFAULT_INSTANCE; } - /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @return A list containing the clusterIds. - */ - public com.google.protobuf.ProtocolStringList getClusterIdsList() { - return clusterIds_.getUnmodifiableView(); + + 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; } - /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @return The count of clusterIds. - */ - public int getClusterIdsCount() { - return clusterIds_.size(); + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; } - /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @param index The index of the element to return. - * @return The clusterIds at the given index. - */ - public java.lang.String getClusterIds(int index) { - return clusterIds_.get(index); + + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - /** - * - * - *
    -       * 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); + } + + 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; } /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @param index The index to set the value at. - * @param value The clusterIds to set. - * @return This builder for chaining. + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. */ - public Builder setClusterIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClusterIdsIsMutable(); - clusterIds_.set(index, value); - onChanged(); - return this; + @java.lang.Deprecated + public static AffinityCase valueOf(int value) { + return forNumber(value); } - /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @param value The clusterIds to add. - * @return This builder for chaining. - */ - public Builder addClusterIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + + public static AffinityCase forNumber(int value) { + switch (value) { + case 3: + return ROW_AFFINITY; + case 0: + return AFFINITY_NOT_SET; + default: + return null; } - ensureClusterIdsIsMutable(); - clusterIds_.add(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 values The clusterIds to add. - * @return This builder for chaining. - */ - public Builder addAllClusterIds(java.lang.Iterable values) { - ensureClusterIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterIds_); - onChanged(); - return this; } - /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @return This builder for chaining. - */ - public Builder clearClusterIds() { - clusterIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; + + public int getNumber() { + return this.value; } - /** - * - * - *
    -       * The set of clusters to route to. The order is ignored; clusters will be
    -       * tried in order of distance. If left empty, all clusters are eligible.
    -       * 
    - * - * repeated string cluster_ids = 1; - * - * @param value The bytes of the clusterIds to add. - * @return This builder for chaining. - */ - public Builder addClusterIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureClusterIdsIsMutable(); - clusterIds_.add(value); - 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.AppProfile.MultiClusterRoutingUseAny) - } - - // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) - private static final com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); - } - - public static com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MultiClusterRoutingUseAny parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MultiClusterRoutingUseAny(input, extensionRegistry); - } - }; + }; - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; + 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 static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.bigtable.admin.v2.InstanceProto - .internal_static_google_bigtable_admin_v2_AppProfile_SingleClusterRouting_descriptor; + public java.lang.String getClusterIds(int index) { + return clusterIds_.get(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); + /** + * + * + *
    +     * The set of clusters to route to. The order is ignored; clusters will be
    +     * tried in order of distance. If left empty, all clusters are eligible.
    +     * 
    + * + * repeated string cluster_ids = 1; + * + * @param index The index of the value to return. + * @return The bytes of the clusterIds at the given index. + */ + public com.google.protobuf.ByteString getClusterIdsBytes(int index) { + return clusterIds_.getByteString(index); } - public static final int CLUSTER_ID_FIELD_NUMBER = 1; - private volatile java.lang.Object clusterId_; + public static final int ROW_AFFINITY_FIELD_NUMBER = 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 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; @@ -1216,13 +1021,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clusterId_); + for (int i = 0; i < clusterIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.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 @@ -1231,14 +1039,23 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clusterId_); - } - if (allowTransactionalWrites_ != false) { - size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowTransactionalWrites_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; + { + int dataSize = 0; + for (int i = 0; i < clusterIds_.size(); i++) { + dataSize += computeStringSizeNoTag(clusterIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getClusterIdsList().size(); + } + if (affinityCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; return size; } @@ -1247,15 +1064,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; } @@ -1266,80 +1090,89 @@ 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); } - 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( PARSER, input, extensionRegistry); } - public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { + 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.SingleClusterRouting parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { + 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.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); } - 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 { @@ -1357,7 +1190,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); } @@ -1376,72 +1209,72 @@ protected Builder newBuilderForType( * * *
    -     * 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 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 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) { 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); } @@ -1449,15 +1282,35 @@ 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; } + private void buildPartial0( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + clusterIds_.makeImmutable(); + result.clusterIds_ = clusterIds_; + } + } + + private void buildPartialOneofs( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny result) { + result.affinityCase_ = affinityCase_; + result.affinity_ = this.affinity_; + if (affinityCase_ == 3 && rowAffinityBuilder_ != null) { + result.affinity_ = rowAffinityBuilder_.build(); + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -1495,26 +1348,42 @@ public Builder addRepeatedField( @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; } @@ -1529,163 +1398,199 @@ 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(getRowAffinityFieldBuilder().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(); - } - - clusterId_ = value; - onChanged(); - return this; + public java.lang.String getClusterIds(int index) { + return clusterIds_.get(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; * - * @return This builder for chaining. + * @param index The index of the value to return. + * @return The bytes of the clusterIds at the given index. */ - public Builder clearClusterId() { - - clusterId_ = getDefaultInstance().getClusterId(); - onChanged(); - return this; + 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 value The bytes for clusterId to set. + * @param index The index to set the value at. + * @param value The clusterIds to set. * @return This builder for chaining. */ - public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { + public Builder setClusterIds(int index, java.lang.String value) { if (value == null) { throw new NullPointerException(); } - checkByteStringIsUtf8(value); - - clusterId_ = value; + ensureClusterIdsIsMutable(); + clusterIds_.set(index, 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 value The clusterIds to add. + * @return This builder for chaining. */ - @java.lang.Override - public boolean getAllowTransactionalWrites() { - return allowTransactionalWrites_; + public Builder addClusterIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClusterIdsIsMutable(); + clusterIds_.add(value); + 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. + * @param values The clusterIds to add. * @return This builder for chaining. */ - public Builder setAllowTransactionalWrites(boolean value) { - - allowTransactionalWrites_ = value; + public Builder addAllClusterIds(java.lang.Iterable values) { + ensureClusterIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, clusterIds_); + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1693,22 +1598,305 @@ public Builder setAllowTransactionalWrites(boolean value) { * * *
    -       * 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 This builder for chaining. */ - public Builder clearAllowTransactionalWrites() { - - allowTransactionalWrites_ = false; + public Builder clearClusterIds() { + clusterIds_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
    +       * The set of clusters to route to. The order is ignored; clusters will be
    +       * tried in order of distance. If left empty, all clusters are eligible.
    +       * 
    + * + * repeated string cluster_ids = 1; + * + * @param value The bytes of the clusterIds to add. + * @return This builder for chaining. + */ + public Builder addClusterIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureClusterIdsIsMutable(); + clusterIds_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder, + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinityOrBuilder> + rowAffinityBuilder_; + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return Whether the rowAffinity field is set. + */ + @java.lang.Override + public boolean hasRowAffinity() { + return affinityCase_ == 3; + } + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + * + * @return The rowAffinity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + getRowAffinity() { + if (rowAffinityBuilder_ == null) { + if (affinityCase_ == 3) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity) + affinity_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } else { + if (affinityCase_ == 3) { + return rowAffinityBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + } + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity value) { + if (rowAffinityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + affinity_ = value; + onChanged(); + } else { + rowAffinityBuilder_.setMessage(value); + } + affinityCase_ = 3; + return this; + } + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder setRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder + builderForValue) { + if (rowAffinityBuilder_ == null) { + affinity_ = builderForValue.build(); + onChanged(); + } else { + rowAffinityBuilder_.setMessage(builderForValue.build()); + } + affinityCase_ = 3; + return this; + } + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder mergeRowAffinity( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity value) { + if (rowAffinityBuilder_ == null) { + if (affinityCase_ == 3 + && affinity_ + != com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance()) { + affinity_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .newBuilder( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .RowAffinity) + affinity_) + .mergeFrom(value) + .buildPartial(); + } else { + affinity_ = value; + } + onChanged(); + } else { + if (affinityCase_ == 3) { + rowAffinityBuilder_.mergeFrom(value); + } else { + rowAffinityBuilder_.setMessage(value); + } + } + affinityCase_ = 3; + return this; + } + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public Builder clearRowAffinity() { + if (rowAffinityBuilder_ == null) { + if (affinityCase_ == 3) { + affinityCase_ = 0; + affinity_ = null; + onChanged(); + } + } else { + if (affinityCase_ == 3) { + affinityCase_ = 0; + affinity_ = null; + } + rowAffinityBuilder_.clear(); + } + return this; + } + /** + * + * + *
    +       * Row affinity sticky routing based on the row key of the request.
    +       * Requests that span multiple rows are routed non-deterministically.
    +       * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity row_affinity = 3; + * + */ + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity.Builder + getRowAffinityBuilder() { + return getRowAffinityFieldBuilder().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.SingleFieldBuilderV3< + 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> + getRowAffinityFieldBuilder() { + if (rowAffinityBuilder_ == null) { + if (!(affinityCase_ == 3)) { + affinity_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.RowAffinity + .getDefaultInstance(); + } + rowAffinityBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1721,83 +1909,2358 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) } - // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.AppProfile.SingleClusterRouting) - private static final 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.SingleClusterRouting(); + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny(); } - public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting + 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: + java.lang.String getClusterId(); + /** + * + * + *
    +     * The cluster to which read/write requests should be routed.
    +     * 
    + * + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
    +     * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
    +     * allowed by this app profile. It is unsafe to send these requests to
    +     * the same table/row/column in multiple clusters.
    +     * 
    + * + * bool allow_transactional_writes = 2; + * + * @return The allowTransactionalWrites. + */ + boolean getAllowTransactionalWrites(); + } + /** + * + * + *
    +   * Unconditionally routes all read/write requests to a specific cluster.
    +   * This option preserves read-your-writes consistency but does not improve
    +   * availability.
    +   * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.SingleClusterRouting} + */ + public static final class SingleClusterRouting extends com.google.protobuf.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(); + } + + 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.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 CLUSTER_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object clusterId_ = ""; + /** + * + * + *
    +     * The cluster to which read/write requests should be routed.
    +     * 
    + * + * string cluster_id = 1; + * + * @return The clusterId. + */ + @java.lang.Override + public java.lang.String getClusterId() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + clusterId_ = s; + return s; + } + } + /** + * + * + *
    +     * The cluster to which read/write requests should be routed.
    +     * 
    + * + * string cluster_id = 1; + * + * @return The bytes for clusterId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getClusterIdBytes() { + java.lang.Object ref = clusterId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + clusterId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALLOW_TRANSACTIONAL_WRITES_FIELD_NUMBER = 2; + private boolean allowTransactionalWrites_ = false; + /** + * + * + *
    +     * Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are
    +     * allowed by this app profile. It is unsafe to send these requests to
    +     * the same table/row/column in multiple clusters.
    +     * 
    + * + * bool allow_transactional_writes = 2; + * + * @return The allowTransactionalWrites. + */ + @java.lang.Override + public boolean getAllowTransactionalWrites() { + return allowTransactionalWrites_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clusterId_); + } + if (allowTransactionalWrites_ != false) { + output.writeBool(2, allowTransactionalWrites_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clusterId_); + } + if (allowTransactionalWrites_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowTransactionalWrites_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting other = + (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) obj; + + if (!getClusterId().equals(other.getClusterId())) return false; + if (getAllowTransactionalWrites() != other.getAllowTransactionalWrites()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER; + hash = (53 * hash) + getClusterId().hashCode(); + hash = (37 * hash) + ALLOW_TRANSACTIONAL_WRITES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowTransactionalWrites()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.SingleClusterRouting 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.SingleClusterRouting 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.SingleClusterRouting 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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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); + } + + // Construct using com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.StandardIsolation) + StandardIsolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use StandardIsolation.newBuilder() to construct. + private StandardIsolation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StandardIsolation() { + priority_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StandardIsolation(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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 on your Bigtable data, without impacting the
    +   * performance of the clusters that handle your application traffic.
    +   * Currently, Data Boost exclusively supports read-only use-cases with
    +   * single-cluster routing.
    +   *
    +   * Data Boost reads are only guaranteed to see the results of writes that
    +   * were written at least 30 minutes ago. This means newly written values may
    +   * not become visible for up to 30m, and also means that old values may
    +   * remain visible for up to 30m after being deleted or overwritten. To
    +   * mitigate the staleness of the data, users may either wait 30m, or use
    +   * CheckConsistency.
    +   * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} + */ + public static final class DataBoostIsolationReadOnly + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly) + DataBoostIsolationReadOnlyOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataBoostIsolationReadOnly.newBuilder() to construct. + private DataBoostIsolationReadOnly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataBoostIsolationReadOnly() { + computeBillingOwner_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataBoostIsolationReadOnly(); + } + + 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.GeneratedMessageV3.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), + ; + + /** + * + * + *
    +       * 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 final 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +     * Data Boost is a serverless compute capability that lets you run
    +     * high-throughput read jobs on your Bigtable data, without impacting the
    +     * performance of the clusters that handle your application traffic.
    +     * Currently, Data Boost exclusively supports read-only use-cases with
    +     * single-cluster routing.
    +     *
    +     * Data Boost reads are only guaranteed to see the results of writes that
    +     * were written at least 30 minutes ago. This means newly written values may
    +     * not become visible for up to 30m, and also means that old values may
    +     * remain visible for up to 30m after being deleted or overwritten. To
    +     * mitigate the staleness of the data, users may either wait 30m, or use
    +     * CheckConsistency.
    +     * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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()) { + setComputeBillingOwner(other.getComputeBillingOwner()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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; + } + + @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.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; } } @@ -1811,13 +4274,67 @@ 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; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + 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]*`.
        * 
    @@ -1842,7 +4359,6 @@ public 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]*`.
        * 
    @@ -1865,7 +4381,9 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int ETAG_FIELD_NUMBER = 2; - private volatile java.lang.Object etag_; + + @SuppressWarnings("serial") + private volatile java.lang.Object etag_ = ""; /** * * @@ -1928,12 +4446,14 @@ public com.google.protobuf.ByteString getEtagBytes() { } public static final int DESCRIPTION_FIELD_NUMBER = 3; - private volatile java.lang.Object description_; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; /** * * *
    -   * Optional long form description of the use case for this AppProfile.
    +   * Long form description of the use case for this AppProfile.
        * 
    * * string description = 3; @@ -1956,7 +4476,7 @@ public 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; @@ -1998,96 +4518,286 @@ public boolean hasMultiClusterRoutingUseAny() { * * *
    -   * Use a multi-cluster routing policy.
    +   * 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=405 + * @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=405 + * @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=405 + * @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.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 (routingPolicyCase_ == 5) { - return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + 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.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; */ @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 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.MultiClusterRoutingUseAny.getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); } - public static final int SINGLE_CLUSTER_ROUTING_FIELD_NUMBER = 6; + public static final int DATA_BOOST_ISOLATION_READ_ONLY_FIELD_NUMBER = 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 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 (routingPolicyCase_ == 6) { - return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + 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.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; * */ @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder - getSingleClusterRoutingOrBuilder() { - if (routingPolicyCase_ == 6) { - return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + 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.SingleClusterRouting.getDefaultInstance(); + return com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @@ -2121,7 +4831,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeMessage( 6, (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_); } - unknownFields.writeTo(output); + 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 @@ -2150,7 +4871,22 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 6, (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_); } - size += unknownFields.getSerializedSize(); + 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; } @@ -2180,7 +4916,22 @@ public boolean equals(final java.lang.Object obj) { case 0: default: } - if (!unknownFields.equals(other.unknownFields)) return false; + 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; } @@ -2209,7 +4960,23 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + 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; } @@ -2339,515 +5106,1214 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.AppProfile.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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 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.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( + getMultiClusterRoutingUseAnyFieldBuilder().getBuilder(), extensionRegistry); + routingPolicyCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage( + getSingleClusterRoutingFieldBuilder().getBuilder(), extensionRegistry); + routingPolicyCase_ = 6; + break; + } // case 50 + case 56: + { + int rawValue = input.readEnum(); + isolationCase_ = 7; + isolation_ = rawValue; + break; + } // case 56 + case 82: + { + input.readMessage( + getDataBoostIsolationReadOnlyFieldBuilder().getBuilder(), extensionRegistry); + isolationCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage( + getStandardIsolationFieldBuilder().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 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + private int routingPolicyCase_ = 0; + private java.lang.Object routingPolicy_; - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + public RoutingPolicyCase getRoutingPolicyCase() { + return RoutingPolicyCase.forNumber(routingPolicyCase_); } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - etag_ = ""; - - description_ = ""; - + public Builder clearRoutingPolicy() { routingPolicyCase_ = 0; routingPolicy_ = null; + onChanged(); 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; + private int isolationCase_ = 0; + private java.lang.Object isolation_; + + public IsolationCase getIsolationCase() { + return IsolationCase.forNumber(isolationCase_); } - @java.lang.Override - public com.google.bigtable.admin.v2.AppProfile getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.AppProfile.getDefaultInstance(); + public Builder clearIsolation() { + isolationCase_ = 0; + isolation_ = null; + onChanged(); + 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); + 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; } - 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); - result.name_ = name_; - result.etag_ = etag_; - result.description_ = description_; - if (routingPolicyCase_ == 5) { - if (multiClusterRoutingUseAnyBuilder_ == null) { - result.routingPolicy_ = routingPolicy_; - } else { - result.routingPolicy_ = multiClusterRoutingUseAnyBuilder_.build(); - } + /** + * + * + *
    +     * 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; } - if (routingPolicyCase_ == 6) { - if (singleClusterRoutingBuilder_ == null) { - result.routingPolicy_ = routingPolicy_; - } else { - result.routingPolicy_ = singleClusterRoutingBuilder_.build(); - } + } + /** + * + * + *
    +     * 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(); } - result.routingPolicyCase_ = routingPolicyCase_; - onBuilt(); - return result; + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; } - - @java.lang.Override - public Builder clone() { - return super.clone(); + /** + * + * + *
    +     * 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; } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + /** + * + * + *
    +     * 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; } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + private java.lang.Object etag_ = ""; + /** + * + * + *
    +     * Strongly validated etag for optimistic concurrency control. Preserve the
    +     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
    +     * fail the request if there has been a modification in the mean time. The
    +     * `update_mask` of the request need not include `etag` for this protection
    +     * to apply.
    +     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
    +     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
    +     * details.
    +     * 
    + * + * string etag = 2; + * + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + /** + * + * + *
    +     * Strongly validated etag for optimistic concurrency control. Preserve the
    +     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
    +     * fail the request if there has been a modification in the mean time. The
    +     * `update_mask` of the request need not include `etag` for this protection
    +     * to apply.
    +     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
    +     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
    +     * details.
    +     * 
    + * + * string etag = 2; + * + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
    +     * Strongly validated etag for optimistic concurrency control. Preserve the
    +     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
    +     * fail the request if there has been a modification in the mean time. The
    +     * `update_mask` of the request need not include `etag` for this protection
    +     * to apply.
    +     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
    +     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
    +     * details.
    +     * 
    + * + * string etag = 2; + * + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + /** + * + * + *
    +     * 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; } - - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + /** + * + * + *
    +     * 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; } - @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); + private java.lang.Object description_ = ""; + /** + * + * + *
    +     * Long form description of the use case for this AppProfile.
    +     * 
    + * + * string description = 3; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; } else { - super.mergeFrom(other); - return this; + return (java.lang.String) ref; } } - - 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(); + /** + * + * + *
    +     * 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; } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); + } + /** + * + * + *
    +     * 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(); } - 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; - } + description_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
    +     * Long form description of the use case for this AppProfile.
    +     * 
    + * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
    +     * Long form description of the use case for this AppProfile.
    +     * 
    + * + * string description = 3; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - this.mergeUnknownFields(other.unknownFields); + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000004; 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_; + /** + * + * + *
    +     * 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 final boolean isInitialized() { - return true; + 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 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.MultiClusterRoutingUseAny + getMultiClusterRoutingUseAny() { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } else { + if (routingPolicyCase_ == 5) { + return multiClusterRoutingUseAnyBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); + } + } + /** + * + * + *
    +     * Use a multi-cluster routing policy.
    +     * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny value) { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } + routingPolicy_ = value; + onChanged(); + } else { + multiClusterRoutingUseAnyBuilder_.setMessage(value); } + routingPolicyCase_ = 5; return this; } - - private int routingPolicyCase_ = 0; - private java.lang.Object routingPolicy_; - - public RoutingPolicyCase getRoutingPolicyCase() { - return RoutingPolicyCase.forNumber(routingPolicyCase_); - } - - public Builder clearRoutingPolicy() { - routingPolicyCase_ = 0; - routingPolicy_ = null; - onChanged(); + /** + * + * + *
    +     * Use a multi-cluster routing policy.
    +     * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder setMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder builderForValue) { + if (multiClusterRoutingUseAnyBuilder_ == null) { + routingPolicy_ = builderForValue.build(); + onChanged(); + } else { + multiClusterRoutingUseAnyBuilder_.setMessage(builderForValue.build()); + } + routingPolicyCase_ = 5; return this; } - - 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 multi-cluster routing policy.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public Builder mergeMultiClusterRoutingUseAny( + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny value) { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (routingPolicyCase_ == 5 + && routingPolicy_ + != com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance()) { + routingPolicy_ = + com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.newBuilder( + (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) + routingPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + routingPolicy_ = value; + } + onChanged(); + } else { + if (routingPolicyCase_ == 5) { + multiClusterRoutingUseAnyBuilder_.mergeFrom(value); + } else { + multiClusterRoutingUseAnyBuilder_.setMessage(value); + } + } + routingPolicyCase_ = 5; + return this; + } + /** * - * @return The name. + * + *
    +     * Use a multi-cluster routing policy.
    +     * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * */ - 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 clearMultiClusterRoutingUseAny() { + if (multiClusterRoutingUseAnyBuilder_ == null) { + if (routingPolicyCase_ == 5) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + onChanged(); + } } else { - return (java.lang.String) ref; + if (routingPolicyCase_ == 5) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + } + multiClusterRoutingUseAnyBuilder_.clear(); } + 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 multi-cluster routing policy.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * + */ + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny.Builder + getMultiClusterRoutingUseAnyBuilder() { + return getMultiClusterRoutingUseAnyFieldBuilder().getBuilder(); + } + /** * - * @return The bytes for name. + * + *
    +     * Use a multi-cluster routing policy.
    +     * 
    + * + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * */ - 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; + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAnyOrBuilder + getMultiClusterRoutingUseAnyOrBuilder() { + if ((routingPolicyCase_ == 5) && (multiClusterRoutingUseAnyBuilder_ != null)) { + return multiClusterRoutingUseAnyBuilder_.getMessageOrBuilder(); } else { - return (com.google.protobuf.ByteString) ref; + if (routingPolicyCase_ == 5) { + return (com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny + .getDefaultInstance(); } } /** * * *
    -     * (`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 multi-cluster routing policy.
          * 
    * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. + * + * .google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; + * */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + 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(); + } + 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_, + getParentForChildren(), + isClean()); + routingPolicy_ = null; } - - name_ = value; + routingPolicyCase_ = 5; onChanged(); - return this; + return multiClusterRoutingUseAnyBuilder_; + } + + 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_; + /** + * + * + *
    +     * 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; } /** * * *
    -     * (`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; + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * * - * @return This builder for chaining. + * @return The singleClusterRouting. */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting getSingleClusterRouting() { + if (singleClusterRoutingBuilder_ == null) { + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } else { + if (routingPolicyCase_ == 6) { + return singleClusterRoutingBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } + } + /** + * + * + *
    +     * Use a single-cluster routing policy.
    +     * 
    + * + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * + */ + public Builder setSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting value) { + if (singleClusterRoutingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + routingPolicy_ = value; + onChanged(); + } else { + singleClusterRoutingBuilder_.setMessage(value); + } + routingPolicyCase_ = 6; return this; } /** * * *
    -     * (`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 setSingleClusterRouting( + com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder builderForValue) { + if (singleClusterRoutingBuilder_ == null) { + routingPolicy_ = builderForValue.build(); + onChanged(); + } else { + singleClusterRoutingBuilder_.setMessage(builderForValue.build()); } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); + routingPolicyCase_ = 6; 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; + 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 { - return (java.lang.String) ref; + if (routingPolicyCase_ == 6) { + singleClusterRoutingBuilder_.mergeFrom(value); + } else { + singleClusterRoutingBuilder_.setMessage(value); + } } + routingPolicyCase_ = 6; + return this; } /** * * *
    -     * Strongly validated etag for optimistic concurrency control. Preserve the
    -     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
    -     * fail the request if there has been a modification in the mean time. The
    -     * `update_mask` of the request need not include `etag` for this protection
    -     * to apply.
    -     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
    -     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
    -     * details.
    +     * 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; + public Builder clearSingleClusterRouting() { + if (singleClusterRoutingBuilder_ == null) { + if (routingPolicyCase_ == 6) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + onChanged(); + } } else { - return (com.google.protobuf.ByteString) ref; + if (routingPolicyCase_ == 6) { + routingPolicyCase_ = 0; + routingPolicy_ = null; + } + singleClusterRoutingBuilder_.clear(); } + return this; } /** * * *
    -     * Strongly validated etag for optimistic concurrency control. Preserve the
    -     * value returned from `GetAppProfile` when calling `UpdateAppProfile` to
    -     * fail the request if there has been a modification in the mean time. The
    -     * `update_mask` of the request need not include `etag` for this protection
    -     * to apply.
    -     * See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and
    -     * [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more
    -     * details.
    +     * 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(); - } - - etag_ = value; - onChanged(); - return this; + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.Builder + getSingleClusterRoutingBuilder() { + return getSingleClusterRoutingFieldBuilder().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 This builder for chaining. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - public Builder clearEtag() { - - etag_ = getDefaultInstance().getEtag(); - onChanged(); - return this; + @java.lang.Override + public com.google.bigtable.admin.v2.AppProfile.SingleClusterRoutingOrBuilder + getSingleClusterRoutingOrBuilder() { + if ((routingPolicyCase_ == 6) && (singleClusterRoutingBuilder_ != null)) { + return singleClusterRoutingBuilder_.getMessageOrBuilder(); + } else { + if (routingPolicyCase_ == 6) { + return (com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting) routingPolicy_; + } + return com.google.bigtable.admin.v2.AppProfile.SingleClusterRouting.getDefaultInstance(); + } } /** * * *
    -     * 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 bytes for etag to set. - * @return This builder for chaining. + * .google.bigtable.admin.v2.AppProfile.SingleClusterRouting single_cluster_routing = 6; + * */ - public Builder setEtagBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + 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(); + } + 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_, + getParentForChildren(), + isClean()); + routingPolicy_ = null; } - checkByteStringIsUtf8(value); - - etag_ = value; + routingPolicyCase_ = 6; onChanged(); - return this; + return singleClusterRoutingBuilder_; } - 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=405 + * @return Whether the priority field is set. */ - 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 + @java.lang.Deprecated + public boolean hasPriority() { + return isolationCase_ == 7; } /** * * *
    -     * 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=405 + * @return The enum numeric value on the wire for 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 int getPriorityValue() { + if (isolationCase_ == 7) { + return ((java.lang.Integer) isolation_).intValue(); } + return 0; } /** * * *
    -     * 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=405 + * @param value The enum numeric value on the wire for priority to set. * @return This builder for chaining. */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - description_ = value; + @java.lang.Deprecated + public Builder setPriorityValue(int value) { + isolationCase_ = 7; + isolation_ = value; onChanged(); return this; } @@ -2855,16 +6321,55 @@ public Builder setDescription(java.lang.String value) { * * *
    -     * 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.
    +     * 
    + * + * .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=405 + * @return The priority. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.bigtable.admin.v2.AppProfile.Priority getPriority() { + if (isolationCase_ == 7) { + com.google.bigtable.admin.v2.AppProfile.Priority result = + com.google.bigtable.admin.v2.AppProfile.Priority.forNumber( + (java.lang.Integer) isolation_); + return result == null + ? com.google.bigtable.admin.v2.AppProfile.Priority.UNRECOGNIZED + : result; + } + return com.google.bigtable.admin.v2.AppProfile.Priority.PRIORITY_UNSPECIFIED; + } + /** + * + * + *
    +     * This field has been deprecated in favor of `standard_isolation.priority`.
    +     * If you set this field, `standard_isolation.priority` will be set instead.
    +     *
    +     * The priority of requests sent using this app profile.
          * 
    * - * string description = 3; + * .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=405 + * @param value The priority to set. * @return This builder for chaining. */ - public Builder clearDescription() { - - description_ = getDefaultInstance().getDescription(); + @java.lang.Deprecated + public Builder setPriority(com.google.bigtable.admin.v2.AppProfile.Priority value) { + if (value == null) { + throw new NullPointerException(); + } + isolationCase_ = 7; + isolation_ = value.getNumber(); onChanged(); return this; } @@ -2872,185 +6377,178 @@ public Builder clearDescription() { * * *
    -     * 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=405 * @return This builder for chaining. */ - public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + @java.lang.Deprecated + public Builder clearPriority() { + if (isolationCase_ == 7) { + isolationCase_ = 0; + isolation_ = null; + onChanged(); } - checkByteStringIsUtf8(value); - - description_ = value; - 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_; + 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; } @@ -3058,229 +6556,241 @@ public Builder clearMultiClusterRoutingUseAny() { * * *
    -     * 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 getStandardIsolationFieldBuilder().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(); + com.google.bigtable.admin.v2.AppProfile.StandardIsolation, + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.Builder, + com.google.bigtable.admin.v2.AppProfile.StandardIsolationOrBuilder> + getStandardIsolationFieldBuilder() { + if (standardIsolationBuilder_ == null) { + if (!(isolationCase_ == 11)) { + isolation_ = + com.google.bigtable.admin.v2.AppProfile.StandardIsolation.getDefaultInstance(); } - multiClusterRoutingUseAnyBuilder_ = + standardIsolationBuilder_ = 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_, + 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_; + 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; } @@ -3288,72 +6798,79 @@ public Builder clearSingleClusterRouting() { * * *
    -     * 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 getDataBoostIsolationReadOnlyFieldBuilder().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(); + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly.Builder, + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnlyOrBuilder> + getDataBoostIsolationReadOnlyFieldBuilder() { + if (dataBoostIsolationReadOnlyBuilder_ == null) { + if (!(isolationCase_ == 10)) { + isolation_ = + com.google.bigtable.admin.v2.AppProfile.DataBoostIsolationReadOnly + .getDefaultInstance(); } - singleClusterRoutingBuilder_ = + dataBoostIsolationReadOnlyBuilder_ = 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_, + 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_; + return dataBoostIsolationReadOnlyBuilder_; } @java.lang.Override @@ -3388,7 +6905,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 a8387acd9c..4e4eb28823 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 2021 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. @@ -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) 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..8ec2bbbcce 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface AppProfileOrBuilder @@ -27,7 +28,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]*`.
        * 
    @@ -41,7 +41,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]*`.
        * 
    @@ -95,7 +94,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; @@ -107,7 +106,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; @@ -197,5 +196,147 @@ 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=405 + * @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=405 + * @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=405 + * @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..5610d13355 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedView.java @@ -0,0 +1,3788 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/table.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class AuthorizedView extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AuthorizedView) + AuthorizedViewOrBuilder { + private static final long serialVersionUID = 0L; + // Use AuthorizedView.newBuilder() to construct. + private AuthorizedView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthorizedView() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthorizedView(); + } + + 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.GeneratedMessageV3.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), + ; + + /** + * + * + *
    +     * 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 final 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AuthorizedView.FamilySubsets) + FamilySubsetsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FamilySubsets.newBuilder() to construct. + private FamilySubsets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FamilySubsets() { + qualifiers_ = emptyList(com.google.protobuf.ByteString.class); + qualifierPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FamilySubsets(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.AuthorizedView.SubsetView) + SubsetViewOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubsetView.newBuilder() to construct. + private SubsetView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SubsetView() { + rowPrefixes_ = emptyList(com.google.protobuf.ByteString.class); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SubsetView(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (authorizedViewCase_ == 2) { + output.writeMessage( + 2, (com.google.bigtable.admin.v2.AuthorizedView.SubsetView) authorizedView_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getSubsetViewFieldBuilder().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.SingleFieldBuilderV3< + 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 getSubsetViewFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.AuthorizedView.SubsetView, + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.Builder, + com.google.bigtable.admin.v2.AuthorizedView.SubsetViewOrBuilder> + getSubsetViewFieldBuilder() { + if (subsetViewBuilder_ == null) { + if (!(authorizedViewCase_ == 2)) { + authorizedView_ = + com.google.bigtable.admin.v2.AuthorizedView.SubsetView.getDefaultInstance(); + } + subsetViewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; + } + + @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.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..3cb203204a --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewName.java @@ -0,0 +1,269 @@ +/* + * 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.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..4888013326 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AuthorizedViewOrBuilder.java @@ -0,0 +1,136 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/table.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 index 468651f4f3..6dc311e328 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,58 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new AutoscalingLimits(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AutoscalingLimits( - 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: - { - minServeNodes_ = input.readInt32(); - break; - } - case 16: - { - maxServeNodes_ = 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.InstanceProto .internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor; @@ -113,7 +62,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int MIN_SERVE_NODES_FIELD_NUMBER = 1; - private int minServeNodes_; + private int minServeNodes_ = 0; /** * * @@ -131,7 +80,7 @@ public int getMinServeNodes() { } public static final int MAX_SERVE_NODES_FIELD_NUMBER = 2; - private int maxServeNodes_; + private int maxServeNodes_ = 0; /** * * @@ -168,7 +117,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (maxServeNodes_ != 0) { output.writeInt32(2, maxServeNodes_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -183,7 +132,7 @@ public int getSerializedSize() { if (maxServeNodes_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, maxServeNodes_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -201,7 +150,7 @@ public boolean equals(final java.lang.Object obj) { if (getMinServeNodes() != other.getMinServeNodes()) return false; if (getMaxServeNodes() != other.getMaxServeNodes()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -216,7 +165,7 @@ public int hashCode() { hash = (53 * hash) + getMinServeNodes(); hash = (37 * hash) + MAX_SERVE_NODES_FIELD_NUMBER; hash = (53 * hash) + getMaxServeNodes(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -345,26 +294,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.AutoscalingLimits.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; minServeNodes_ = 0; - maxServeNodes_ = 0; - return this; } @@ -392,12 +333,23 @@ public com.google.bigtable.admin.v2.AutoscalingLimits build() { public com.google.bigtable.admin.v2.AutoscalingLimits buildPartial() { com.google.bigtable.admin.v2.AutoscalingLimits result = new com.google.bigtable.admin.v2.AutoscalingLimits(this); - result.minServeNodes_ = minServeNodes_; - result.maxServeNodes_ = maxServeNodes_; + 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 clone() { return super.clone(); @@ -449,7 +401,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.AutoscalingLimits other) { if (other.getMaxServeNodes() != 0) { setMaxServeNodes(other.getMaxServeNodes()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -464,20 +416,48 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.AutoscalingLimits 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: + { + 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) { - parsedMessage = (com.google.bigtable.admin.v2.AutoscalingLimits) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private int minServeNodes_; /** * @@ -509,6 +489,7 @@ public int getMinServeNodes() { public Builder setMinServeNodes(int value) { minServeNodes_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -524,7 +505,7 @@ public Builder setMinServeNodes(int value) { * @return This builder for chaining. */ public Builder clearMinServeNodes() { - + bitField0_ = (bitField0_ & ~0x00000001); minServeNodes_ = 0; onChanged(); return this; @@ -561,6 +542,7 @@ public int getMaxServeNodes() { public Builder setMaxServeNodes(int value) { maxServeNodes_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -576,7 +558,7 @@ public Builder setMaxServeNodes(int value) { * @return This builder for chaining. */ public Builder clearMaxServeNodes() { - + bitField0_ = (bitField0_ & ~0x00000002); maxServeNodes_ = 0; onChanged(); return this; @@ -614,7 +596,18 @@ public AutoscalingLimits parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AutoscalingLimits(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/AutoscalingLimitsOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingLimitsOrBuilder.java index ef8bea2e1b..ddbae6ef13 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface AutoscalingLimitsOrBuilder 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 index e690ab0847..e7dc8bf512 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,53 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new AutoscalingTargets(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private AutoscalingTargets( - 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 16: - { - cpuUtilizationPercent_ = 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.InstanceProto .internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor; @@ -108,14 +62,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CPU_UTILIZATION_PERCENT_FIELD_NUMBER = 2; - private int cpuUtilizationPercent_; + 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).
    +   * 100 (total utilization), and is limited between 10 and 80, otherwise it
    +   * will return INVALID_ARGUMENT error.
        * 
    * * int32 cpu_utilization_percent = 2; @@ -127,6 +82,29 @@ 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 @@ -144,7 +122,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (cpuUtilizationPercent_ != 0) { output.writeInt32(2, cpuUtilizationPercent_); } - unknownFields.writeTo(output); + if (storageUtilizationGibPerNode_ != 0) { + output.writeInt32(3, storageUtilizationGibPerNode_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -156,7 +137,11 @@ public int getSerializedSize() { if (cpuUtilizationPercent_ != 0) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, cpuUtilizationPercent_); } - size += unknownFields.getSerializedSize(); + if (storageUtilizationGibPerNode_ != 0) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size(3, storageUtilizationGibPerNode_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -173,7 +158,8 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.AutoscalingTargets) obj; if (getCpuUtilizationPercent() != other.getCpuUtilizationPercent()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (getStorageUtilizationGibPerNode() != other.getStorageUtilizationGibPerNode()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -186,7 +172,9 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CPU_UTILIZATION_PERCENT_FIELD_NUMBER; hash = (53 * hash) + getCpuUtilizationPercent(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (37 * hash) + STORAGE_UTILIZATION_GIB_PER_NODE_FIELD_NUMBER; + hash = (53 * hash) + getStorageUtilizationGibPerNode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -315,24 +303,18 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.AutoscalingTargets.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; cpuUtilizationPercent_ = 0; - + storageUtilizationGibPerNode_ = 0; return this; } @@ -360,11 +342,23 @@ public com.google.bigtable.admin.v2.AutoscalingTargets build() { public com.google.bigtable.admin.v2.AutoscalingTargets buildPartial() { com.google.bigtable.admin.v2.AutoscalingTargets result = new com.google.bigtable.admin.v2.AutoscalingTargets(this); - result.cpuUtilizationPercent_ = cpuUtilizationPercent_; + 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 clone() { return super.clone(); @@ -414,7 +408,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.AutoscalingTargets other) if (other.getCpuUtilizationPercent() != 0) { setCpuUtilizationPercent(other.getCpuUtilizationPercent()); } - this.mergeUnknownFields(other.unknownFields); + if (other.getStorageUtilizationGibPerNode() != 0) { + setStorageUtilizationGibPerNode(other.getStorageUtilizationGibPerNode()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -429,20 +426,48 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.AutoscalingTargets 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 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) { - parsedMessage = (com.google.bigtable.admin.v2.AutoscalingTargets) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private int cpuUtilizationPercent_; /** * @@ -450,7 +475,8 @@ public Builder mergeFrom( *
          * 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).
    +     * 100 (total utilization), and is limited between 10 and 80, otherwise it
    +     * will return INVALID_ARGUMENT error.
          * 
    * * int32 cpu_utilization_percent = 2; @@ -467,7 +493,8 @@ public int getCpuUtilizationPercent() { *
          * 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).
    +     * 100 (total utilization), and is limited between 10 and 80, otherwise it
    +     * will return INVALID_ARGUMENT error.
          * 
    * * int32 cpu_utilization_percent = 2; @@ -478,6 +505,7 @@ public int getCpuUtilizationPercent() { public Builder setCpuUtilizationPercent(int value) { cpuUtilizationPercent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -487,7 +515,8 @@ public Builder setCpuUtilizationPercent(int value) { *
          * 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).
    +     * 100 (total utilization), and is limited between 10 and 80, otherwise it
    +     * will return INVALID_ARGUMENT error.
          * 
    * * int32 cpu_utilization_percent = 2; @@ -495,12 +524,80 @@ public Builder setCpuUtilizationPercent(int value) { * @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; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -533,7 +630,18 @@ public AutoscalingTargets parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AutoscalingTargets(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/AutoscalingTargetsOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AutoscalingTargetsOrBuilder.java index ef660e939d..db5a8b6b33 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface AutoscalingTargetsOrBuilder @@ -29,7 +30,8 @@ public interface AutoscalingTargetsOrBuilder *
        * 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).
    +   * 100 (total utilization), and is limited between 10 and 80, otherwise it
    +   * will return INVALID_ARGUMENT error.
        * 
    * * int32 cpu_utilization_percent = 2; @@ -37,4 +39,22 @@ public interface AutoscalingTargetsOrBuilder * @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 8d0afd5dff..25f48d7a19 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -40,7 +41,9 @@ private Backup(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Backup() { name_ = ""; sourceTable_ = ""; + sourceBackup_ = ""; state_ = 0; + backupType_ = 0; } @java.lang.Override @@ -49,135 +52,6 @@ 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_Backup_descriptor; @@ -352,24 +226,195 @@ 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), + ; + + /** + * + * + *
    +     * 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 final 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]*`
        * 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. */ @@ -389,18 +434,19 @@ public 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]*`
        * 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 +464,9 @@ 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_ = ""; /** * * @@ -474,17 +522,76 @@ 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 +601,19 @@ 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]; @@ -520,11 +629,13 @@ public 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]; @@ -532,7 +643,7 @@ 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; @@ -555,7 +666,7 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -593,7 +704,7 @@ 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; @@ -613,7 +724,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -645,11 +756,11 @@ 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 +778,7 @@ public long getSizeBytes() { } public static final int STATE_FIELD_NUMBER = 7; - private int state_; + private int state_ = 0; /** * * @@ -700,9 +811,8 @@ 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; } @@ -723,7 +833,7 @@ public com.google.bigtable.admin.v2.Backup.State getState() { */ @java.lang.Override public boolean hasEncryptionInfo() { - return encryptionInfo_ != null; + return ((bitField0_ & 0x00000008) != 0); } /** * @@ -757,7 +867,115 @@ public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { */ @java.lang.Override public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { - return getEncryptionInfo(); + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + + public static final int BACKUP_TYPE_FIELD_NUMBER = 11; + private int backupType_ = 0; + /** + * + * + *
    +   * Indicates the backup type of the backup.
    +   * 
    + * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The enum numeric value on the wire for backupType. + */ + @java.lang.Override + public int getBackupTypeValue() { + return backupType_; + } + /** + * + * + *
    +   * Indicates the backup type of the backup.
    +   * 
    + * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The backupType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup.BackupType getBackupType() { + com.google.bigtable.admin.v2.Backup.BackupType result = + com.google.bigtable.admin.v2.Backup.BackupType.forNumber(backupType_); + return result == null ? com.google.bigtable.admin.v2.Backup.BackupType.UNRECOGNIZED : result; + } + + public static final int HOT_TO_STANDARD_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp hotToStandardTime_; + /** + * + * + *
    +   * The time at which the hot backup will be converted to a standard backup.
    +   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
    +   * hot backup to a standard backup. This value must be greater than the backup
    +   * creation time by:
    +   * - At least 24 hours
    +   *
    +   * This field only applies for hot backups. When creating or updating a
    +   * standard backup, attempting to set this field will fail the request.
    +   * 
    + * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return Whether the hotToStandardTime field is set. + */ + @java.lang.Override + public boolean hasHotToStandardTime() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
    +   * The time at which the hot backup will be converted to a standard backup.
    +   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
    +   * hot backup to a standard backup. This value must be greater than the backup
    +   * creation time by:
    +   * - At least 24 hours
    +   *
    +   * This field only applies for hot backups. When creating or updating a
    +   * standard backup, attempting to set this field will fail the request.
    +   * 
    + * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + * + * @return The hotToStandardTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getHotToStandardTime() { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; + } + /** + * + * + *
    +   * The time at which the hot backup will be converted to a standard backup.
    +   * Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the
    +   * hot backup to a standard backup. This value must be greater than the backup
    +   * creation time by:
    +   * - At least 24 hours
    +   *
    +   * This field only applies for hot backups. When creating or updating a
    +   * standard backup, attempting to set this field will fail the request.
    +   * 
    + * + * .google.protobuf.Timestamp hot_to_standard_time = 12; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getHotToStandardTimeOrBuilder() { + return hotToStandardTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : hotToStandardTime_; } private byte memoizedIsInitialized = -1; @@ -780,13 +998,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceTable_)) { com.google.protobuf.GeneratedMessageV3.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 +1013,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.GeneratedMessageV3.isStringEmpty(sourceBackup_)) { + com.google.protobuf.GeneratedMessageV3.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 @@ -813,13 +1041,13 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceTable_)) { size += com.google.protobuf.GeneratedMessageV3.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 +1056,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.GeneratedMessageV3.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessageV3.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 +1086,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 +1105,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 +1125,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 +1147,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; } @@ -1039,44 +1291,50 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExpireTimeFieldBuilder(); + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + getEncryptionInfoFieldBuilder(); + getHotToStandardTimeFieldBuilder(); + } } @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,32 +1361,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 (bitField0_ != 0) { + buildPartial0(result); } - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.admin.v2.Backup result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceTable_ = sourceTable_; } - result.sizeBytes_ = sizeBytes_; - result.state_ = state_; - if (encryptionInfoBuilder_ == null) { - result.encryptionInfo_ = encryptionInfo_; - } else { - result.encryptionInfo_ = encryptionInfoBuilder_.build(); + if (((from_bitField0_ & 0x00000004) != 0)) { + result.sourceBackup_ = sourceBackup_; } - onBuilt(); - return result; + 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 +1463,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 +1494,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 +1515,121 @@ 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(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + input.readMessage(getEndTimeFieldBuilder().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(getEncryptionInfoFieldBuilder().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( + getHotToStandardTimeFieldBuilder().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]*`
          * 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. */ @@ -1266,18 +1648,19 @@ public 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]*`
          * 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. */ @@ -1296,18 +1679,19 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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]*`
          * 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,8 +1700,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1325,24 +1709,25 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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]*`
          * 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; } @@ -1350,18 +1735,19 @@ public Builder clearName() { * * *
    -     * 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]*`
          * 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,8 +1757,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1450,8 +1836,8 @@ public Builder setSourceTable(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceTable_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1471,8 +1857,8 @@ 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,8 +1883,129 @@ 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; } @@ -1513,11 +2020,13 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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 +2035,19 @@ 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]; @@ -1557,11 +2068,13 @@ public 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]; @@ -1573,22 +2086,24 @@ 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 +2112,24 @@ 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,60 +2137,66 @@ 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(); } @@ -1681,11 +2204,13 @@ public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { * * *
    -     * 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]; @@ -1704,11 +2229,13 @@ public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { * * *
    -     * 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]; @@ -1754,7 +2281,7 @@ 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); } /** * @@ -1799,11 +2326,11 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } /** @@ -1823,11 +2350,11 @@ 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,17 +2373,20 @@ 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,14 +2404,13 @@ 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,7 +2428,7 @@ public Builder clearStartTime() { *
    */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000010; onChanged(); return getStartTimeFieldBuilder().getBuilder(); } @@ -1975,7 +2504,7 @@ 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); } /** * @@ -2014,11 +2543,11 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } /** @@ -2035,11 +2564,11 @@ 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,17 +2584,20 @@ 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,14 +2612,13 @@ 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,7 +2633,7 @@ public Builder clearEndTime() { *
    */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000020; onChanged(); return getEndTimeFieldBuilder().getBuilder(); } @@ -2183,6 +2714,7 @@ public long getSizeBytes() { public Builder setSizeBytes(long value) { sizeBytes_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2198,7 +2730,7 @@ public Builder setSizeBytes(long value) { * @return This builder for chaining. */ public Builder clearSizeBytes() { - + bitField0_ = (bitField0_ & ~0x00000040); sizeBytes_ = 0L; onChanged(); return this; @@ -2237,8 +2769,8 @@ public int getStateValue() { * @return This builder for chaining. */ public Builder setStateValue(int value) { - state_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } @@ -2257,9 +2789,8 @@ 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,7 +2811,7 @@ 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,7 +2830,7 @@ 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; @@ -2325,7 +2856,7 @@ public Builder clearState() { * @return Whether the encryptionInfo field is set. */ public boolean hasEncryptionInfo() { - return encryptionInfoBuilder_ != null || encryptionInfo_ != null; + return ((bitField0_ & 0x00000100) != 0); } /** * @@ -2366,11 +2897,11 @@ 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,11 +2919,11 @@ 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,19 +2939,21 @@ 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,14 +2968,13 @@ 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,7 +2989,7 @@ public Builder clearEncryptionInfo() { *
    */ public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder() { - + bitField0_ |= 0x00000100; onChanged(); return getEncryptionInfoFieldBuilder().getBuilder(); } @@ -2509,6 +3041,344 @@ 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 int getBackupTypeValue() { + return backupType_; + } + /** + * + * + *
    +     * Indicates the backup type of the backup.
    +     * 
    + * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @param value The enum numeric value on the wire for backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupTypeValue(int value) { + backupType_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
    +     * Indicates the backup type of the backup.
    +     * 
    + * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return The backupType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Backup.BackupType getBackupType() { + com.google.bigtable.admin.v2.Backup.BackupType result = + com.google.bigtable.admin.v2.Backup.BackupType.forNumber(backupType_); + return result == null ? com.google.bigtable.admin.v2.Backup.BackupType.UNRECOGNIZED : result; + } + /** + * + * + *
    +     * Indicates the backup type of the backup.
    +     * 
    + * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @param value The backupType to set. + * @return This builder for chaining. + */ + public Builder setBackupType(com.google.bigtable.admin.v2.Backup.BackupType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + backupType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
    +     * Indicates the backup type of the backup.
    +     * 
    + * + * .google.bigtable.admin.v2.Backup.BackupType backup_type = 11; + * + * @return This builder for chaining. + */ + public Builder clearBackupType() { + bitField0_ = (bitField0_ & ~0x00000200); + backupType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp hotToStandardTime_; + private com.google.protobuf.SingleFieldBuilderV3< + 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 getHotToStandardTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getHotToStandardTimeFieldBuilder() { + if (hotToStandardTimeBuilder_ == null) { + hotToStandardTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getHotToStandardTime(), getParentForChildren(), isClean()); + hotToStandardTime_ = null; + } + return hotToStandardTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -2541,7 +3411,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 2dd94bf584..ba58524ee2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -40,6 +41,7 @@ private BackupInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { private BackupInfo() { backup_ = ""; sourceTable_ = ""; + sourceBackup_ = ""; } @java.lang.Override @@ -48,92 +50,6 @@ 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_BackupInfo_descriptor; @@ -149,8 +65,11 @@ 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_ = ""; /** * * @@ -215,7 +134,7 @@ public com.google.protobuf.ByteString getBackupBytes() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -247,7 +166,7 @@ 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; @@ -267,7 +186,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -299,11 +218,13 @@ 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_ = ""; /** * * @@ -351,6 +272,63 @@ 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 @@ -368,16 +346,19 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backup_)) { com.google.protobuf.GeneratedMessageV3.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceTable_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sourceTable_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceBackup_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, sourceBackup_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -389,16 +370,19 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backup_)) { size += com.google.protobuf.GeneratedMessageV3.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceTable_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sourceTable_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, sourceBackup_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -423,7 +407,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 +431,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; } @@ -585,28 +572,29 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } } @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,22 +622,36 @@ 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 (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.sourceTable_ = sourceTable_; onBuilt(); return result; } + private void buildPartial0(com.google.bigtable.admin.v2.BackupInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backup_ = backup_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sourceTable_ = sourceTable_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sourceBackup_ = sourceBackup_; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -697,6 +699,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 +710,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,20 +733,66 @@ 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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEndTimeFieldBuilder().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_ = ""; /** * @@ -799,8 +854,8 @@ public Builder setBackup(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - backup_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -816,8 +871,8 @@ 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,8 +893,8 @@ public Builder setBackupBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - backup_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -864,7 +919,7 @@ 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); } /** * @@ -903,11 +958,11 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -924,11 +979,11 @@ 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,17 +999,20 @@ 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,14 +1027,13 @@ 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,7 +1048,7 @@ public Builder clearStartTime() { *
    */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getStartTimeFieldBuilder().getBuilder(); } @@ -1061,7 +1118,7 @@ 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); } /** * @@ -1100,11 +1157,11 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1121,11 +1178,11 @@ 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,17 +1198,20 @@ 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,14 +1226,13 @@ 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,7 +1247,7 @@ public Builder clearEndTime() { *
    */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getEndTimeFieldBuilder().getBuilder(); } @@ -1299,8 +1358,8 @@ public Builder setSourceTable(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceTable_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1316,8 +1375,8 @@ 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,8 +1397,129 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sourceTable_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object sourceBackup_ = ""; + /** + * + * + *
    +     * Output only. Name of the backup from which this backup was copied. If a
    +     * backup is not created by copying a backup, this field will be empty. Values
    +     * are of the form:
    +     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
    +     * 
    + * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sourceBackup. + */ + public java.lang.String getSourceBackup() { + java.lang.Object ref = sourceBackup_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceBackup_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
    +     * Output only. Name of the backup from which this backup was copied. If a
    +     * backup is not created by copying a backup, this field will be empty. Values
    +     * are of the form:
    +     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
    +     * 
    + * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for sourceBackup. + */ + public com.google.protobuf.ByteString getSourceBackupBytes() { + java.lang.Object ref = sourceBackup_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceBackup_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
    +     * Output only. Name of the backup from which this backup was copied. If a
    +     * backup is not created by copying a backup, this field will be empty. Values
    +     * are of the form:
    +     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
    +     * 
    + * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackup(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceBackup_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
    +     * Output only. Name of the backup from which this backup was copied. If a
    +     * backup is not created by copying a backup, this field will be empty. Values
    +     * are of the form:
    +     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
    +     * 
    + * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSourceBackup() { + sourceBackup_ = getDefaultInstance().getSourceBackup(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
    +     * Output only. Name of the backup from which this backup was copied. If a
    +     * backup is not created by copying a backup, this field will be empty. Values
    +     * are of the form:
    +     * projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>
    +     * 
    + * + * string source_backup = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for sourceBackup to set. + * @return This builder for chaining. + */ + public Builder setSourceBackupBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceBackup_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1376,7 +1556,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..b6d710f28a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface BackupInfoOrBuilder @@ -154,4 +155,35 @@ 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 94f5d10c45..7e3c83907d 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 2021 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. @@ -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) 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..f3d45eba9b 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface BackupOrBuilder @@ -27,18 +28,19 @@ 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]*`
        * 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. */ @@ -47,18 +49,19 @@ 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]*`
        * 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. */ @@ -101,11 +104,44 @@ 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]; @@ -118,11 +154,13 @@ 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.
    +   * 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]; @@ -135,11 +173,13 @@ 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.
    +   * 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]; @@ -320,4 +360,85 @@ 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 d1ea67424d..f469ae4f11 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public final class BigtableInstanceAdminProto { @@ -87,6 +88,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_CreateClusterMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -127,6 +136,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -194,156 +211,180 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "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\"" - + "\304\001\n\025CreateClusterMetadata\022H\n\020original_re" + + "\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\"\267" - + "\001\n\025UpdateClusterMetadata\022;\n\020original_req" - + "uest\030\001 \001(\0132!.google.bigtable.admin.v2.Cl" - + "uster\0220\n\014request_time\030\002 \001(\0132\032.google.pro" - + "tobuf.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\"\322\001\n\034PartialUpda" - + "teClusterMetadata\0220\n\014request_time\030\001 \001(\0132" - + "\032.google.protobuf.Timestamp\022/\n\013finish_ti" - + "me\030\002 \001(\0132\032.google.protobuf.Timestamp\022O\n\020" - + "original_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.Cluste" - + "rB\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.pro" - + "tobuf.FieldMaskB\003\340A\002\"\316\001\n\027CreateAppProfil" - + "eRequest\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n%bigtab" - + "leadmin.googleapis.com/Instance\022\033\n\016app_p" - + "rofile_id\030\002 \001(\tB\003\340A\002\022>\n\013app_profile\030\003 \001(" - + "\0132$.google.bigtable.admin.v2.AppProfileB" - + "\003\340A\002\022\027\n\017ignore_warnings\030\004 \001(\010\"U\n\024GetAppP" - + "rofileRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'big" - + "tableadmin.googleapis.com/AppProfile\"~\n\026" - + "ListAppProfilesRequest\022=\n\006parent\030\001 \001(\tB-" - + "\340A\002\372A\'\n%bigtableadmin.googleapis.com/Ins" - + "tance\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_" - + "profiles\030\001 \003(\0132$.google.bigtable.admin.v" - + "2.AppProfile\022\027\n\017next_page_token\030\002 \001(\t\022\030\n" - + "\020failed_locations\030\003 \003(\t\"\250\001\n\027UpdateAppPro" - + "fileRequest\022>\n\013app_profile\030\001 \001(\0132$.googl" - + "e.bigtable.admin.v2.AppProfileB\003\340A\002\0224\n\013u" - + "pdate_mask\030\002 \001(\0132\032.google.protobuf.Field" - + "MaskB\003\340A\002\022\027\n\017ignore_warnings\030\003 \001(\010\"v\n\027De" - + "leteAppProfileRequest\022=\n\004name\030\001 \001(\tB/\340A\002" - + "\372A)\n\'bigtableadmin.googleapis.com/AppPro" - + "file\022\034\n\017ignore_warnings\030\002 \001(\010B\003\340A\002\"\032\n\030Up" - + "dateAppProfileMetadata2\211 \n\025BigtableInsta" - + "nceAdmin\022\332\001\n\016CreateInstance\022/.google.big" - + "table.admin.v2.CreateInstanceRequest\032\035.g" - + "oogle.longrunning.Operation\"x\202\323\344\223\002&\"!/v2" - + "/{parent=projects/*}/instances:\001*\332A$pare" - + "nt,instance_id,instance,clusters\312A\"\n\010Ins" - + "tance\022\026CreateInstanceMetadata\022\221\001\n\013GetIns" - + "tance\022,.google.bigtable.admin.v2.GetInst" - + "anceRequest\032\".google.bigtable.admin.v2.I" - + "nstance\"0\202\323\344\223\002#\022!/v2/{name=projects/*/in" - + "stances/*}\332A\004name\022\244\001\n\rListInstances\022..go" - + "ogle.bigtable.admin.v2.ListInstancesRequ" - + "est\032/.google.bigtable.admin.v2.ListInsta" - + "ncesResponse\"2\202\323\344\223\002#\022!/v2/{parent=projec" - + "ts/*}/instances\332A\006parent\022\206\001\n\016UpdateInsta" - + "nce\022\".google.bigtable.admin.v2.Instance\032" - + "\".google.bigtable.admin.v2.Instance\",\202\323\344" - + "\223\002&\032!/v2/{name=projects/*/instances/*}:\001" - + "*\022\350\001\n\025PartialUpdateInstance\0226.google.big" - + "table.admin.v2.PartialUpdateInstanceRequ" - + "est\032\035.google.longrunning.Operation\"x\202\323\344\223" - + "\00262*/v2/{instance.name=projects/*/instan" - + "ces/*}:\010instance\332A\024instance,update_mask\312" - + "A\"\n\010Instance\022\026UpdateInstanceMetadata\022\213\001\n" - + "\016DeleteInstance\022/.google.bigtable.admin." - + "v2.DeleteInstanceRequest\032\026.google.protob" - + "uf.Empty\"0\202\323\344\223\002#*!/v2/{name=projects/*/i" - + "nstances/*}\332A\004name\022\334\001\n\rCreateCluster\022..g" - + "oogle.bigtable.admin.v2.CreateClusterReq" - + "uest\032\035.google.longrunning.Operation\"|\202\323\344" - + "\223\0027\",/v2/{parent=projects/*/instances/*}" - + "/clusters:\007cluster\332A\031parent,cluster_id,c" - + "luster\312A \n\007Cluster\022\025CreateClusterMetadat" - + "a\022\231\001\n\nGetCluster\022+.google.bigtable.admin" - + ".v2.GetClusterRequest\032!.google.bigtable." - + "admin.v2.Cluster\";\202\323\344\223\002.\022,/v2/{name=proj" - + "ects/*/instances/*/clusters/*}\332A\004name\022\254\001" - + "\n\014ListClusters\022-.google.bigtable.admin.v" - + "2.ListClustersRequest\032..google.bigtable." - + "admin.v2.ListClustersResponse\"=\202\323\344\223\002.\022,/" - + "v2/{parent=projects/*/instances/*}/clust" - + "ers\332A\006parent\022\255\001\n\rUpdateCluster\022!.google." - + "bigtable.admin.v2.Cluster\032\035.google.longr" - + "unning.Operation\"Z\202\323\344\223\0021\032,/v2/{name=proj" - + "ects/*/instances/*/clusters/*}:\001*\312A \n\007Cl" - + "uster\022\025UpdateClusterMetadata\022\364\001\n\024Partial" - + "UpdateCluster\0225.google.bigtable.admin.v2" - + ".PartialUpdateClusterRequest\032\035.google.lo" - + "ngrunning.Operation\"\205\001\202\323\344\223\002?24/v2/{clust" - + "er.name=projects/*/instances/*/clusters/" - + "*}:\007cluster\332A\023cluster,update_mask\312A\'\n\007Cl" - + "uster\022\034PartialUpdateClusterMetadata\022\224\001\n\r" - + "DeleteCluster\022..google.bigtable.admin.v2" - + ".DeleteClusterRequest\032\026.google.protobuf." - + "Empty\";\202\323\344\223\002.*,/v2/{name=projects/*/inst" - + "ances/*/clusters/*}\332A\004name\022\325\001\n\020CreateApp" - + "Profile\0221.google.bigtable.admin.v2.Creat" - + "eAppProfileRequest\032$.google.bigtable.adm" - + "in.v2.AppProfile\"h\202\323\344\223\002>\"//v2/{parent=pr" - + "ojects/*/instances/*}/appProfiles:\013app_p" - + "rofile\332A!parent,app_profile_id,app_profi" - + "le\022\245\001\n\rGetAppProfile\022..google.bigtable.a" - + "dmin.v2.GetAppProfileRequest\032$.google.bi" - + "gtable.admin.v2.AppProfile\">\202\323\344\223\0021\022//v2/" - + "{name=projects/*/instances/*/appProfiles" - + "/*}\332A\004name\022\270\001\n\017ListAppProfiles\0220.google." - + "bigtable.admin.v2.ListAppProfilesRequest" - + "\0321.google.bigtable.admin.v2.ListAppProfi" - + "lesResponse\"@\202\323\344\223\0021\022//v2/{parent=project" - + "s/*/instances/*}/appProfiles\332A\006parent\022\372\001" - + "\n\020UpdateAppProfile\0221.google.bigtable.adm" - + "in.v2.UpdateAppProfileRequest\032\035.google.l" - + "ongrunning.Operation\"\223\001\202\323\344\223\002J2;/v2/{app_" - + "profile.name=projects/*/instances/*/appP" - + "rofiles/*}:\013app_profile\332A\027app_profile,up" - + "date_mask\312A&\n\nAppProfile\022\030UpdateAppProfi" - + "leMetadata\022\235\001\n\020DeleteAppProfile\0221.google" - + ".bigtable.admin.v2.DeleteAppProfileReque" - + "st\032\026.google.protobuf.Empty\">\202\323\344\223\0021*//v2/" - + "{name=projects/*/instances/*/appProfiles" - + "/*}\332A\004name\022\223\001\n\014GetIamPolicy\022\".google.iam" - + ".v1.GetIamPolicyRequest\032\025.google.iam.v1." - + "Policy\"H\202\323\344\223\0027\"2/v2/{resource=projects/*" - + "/instances/*}:getIamPolicy:\001*\332A\010resource" - + "\022\232\001\n\014SetIamPolicy\022\".google.iam.v1.SetIam" - + "PolicyRequest\032\025.google.iam.v1.Policy\"O\202\323" - + "\344\223\0027\"2/v2/{resource=projects/*/instances" - + "/*}:setIamPolicy:\001*\332A\017resource,policy\022\305\001" - + "\n\022TestIamPermissions\022(.google.iam.v1.Tes" - + "tIamPermissionsRequest\032).google.iam.v1.T" - + "estIamPermissionsResponse\"Z\202\323\344\223\002=\"8/v2/{" - + "resource=projects/*/instances/*}:testIam" - + "Permissions:\001*\332A\024resource,permissions\032\232\003" - + "\312A\034bigtableadmin.googleapis.com\322A\367\002https" - + "://www.googleapis.com/auth/bigtable.admi" - + "n,https://www.googleapis.com/auth/bigtab" - + "le.admin.cluster,https://www.googleapis." - + "com/auth/bigtable.admin.instance,https:/" - + "/www.googleapis.com/auth/cloud-bigtable." - + "admin,https://www.googleapis.com/auth/cl" - + "oud-bigtable.admin.cluster,https://www.g" - + "oogleapis.com/auth/cloud-platform,https:" - + "//www.googleapis.com/auth/cloud-platform" - + ".read-onlyB\342\001\n\034com.google.bigtable.admin" - + ".v2B\032BigtableInstanceAdminProtoP\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" + + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022K" + + "\n\006tables\030\004 \003(\0132;.google.bigtable.admin.v" + + "2.CreateClusterMetadata.TablesEntry\032\371\001\n\r" + + "TableProgress\022\034\n\024estimated_size_bytes\030\002 " + + "\001(\003\022\036\n\026estimated_copied_bytes\030\003 \001(\003\022R\n\005s" + + "tate\030\004 \001(\0162C.google.bigtable.admin.v2.Cr" + + "eateClusterMetadata.TableProgress.State\"" + + "V\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PENDI" + + "NG\020\001\022\013\n\007COPYING\020\002\022\r\n\tCOMPLETED\020\003\022\r\n\tCANC" + + "ELLED\020\004\032l\n\013TablesEntry\022\013\n\003key\030\001 \001(\t\022L\n\005v" + + "alue\030\002 \001(\0132=.google.bigtable.admin.v2.Cr" + + "eateClusterMetadata.TableProgress:\0028\001\"\267\001" + + "\n\025UpdateClusterMetadata\022;\n\020original_requ" + + "est\030\001 \001(\0132!.google.bigtable.admin.v2.Clu" + + "ster\0220\n\014request_time\030\002 \001(\0132\032.google.prot" + + "obuf.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\"\322\001\n\034PartialUpdat" + + "eClusterMetadata\0220\n\014request_time\030\001 \001(\0132\032" + + ".google.protobuf.Timestamp\022/\n\013finish_tim" + + "e\030\002 \001(\0132\032.google.protobuf.Timestamp\022O\n\020o" + + "riginal_request\030\003 \001(\01325.google.bigtable." + + "admin.v2.PartialUpdateClusterRequest\"\214\001\n" + + "\033PartialUpdateClusterRequest\0227\n\007cluster\030" + + "\001 \001(\0132!.google.bigtable.admin.v2.Cluster" + + "B\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.prot" + + "obuf.FieldMaskB\003\340A\002\"\316\001\n\027CreateAppProfile" + + "Request\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n%bigtabl" + + "eadmin.googleapis.com/Instance\022\033\n\016app_pr" + + "ofile_id\030\002 \001(\tB\003\340A\002\022>\n\013app_profile\030\003 \001(\013" + + "2$.google.bigtable.admin.v2.AppProfileB\003" + + "\340A\002\022\027\n\017ignore_warnings\030\004 \001(\010\"U\n\024GetAppPr" + + "ofileRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372A)\n\'bigt" + + "ableadmin.googleapis.com/AppProfile\"~\n\026L" + + "istAppProfilesRequest\022=\n\006parent\030\001 \001(\tB-\340" + + "A\002\372A\'\n%bigtableadmin.googleapis.com/Inst" + + "ance\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\002 " + + "\001(\t\"\210\001\n\027ListAppProfilesResponse\022:\n\014app_p" + + "rofiles\030\001 \003(\0132$.google.bigtable.admin.v2" + + ".AppProfile\022\027\n\017next_page_token\030\002 \001(\t\022\030\n\020" + + "failed_locations\030\003 \003(\t\"\250\001\n\027UpdateAppProf" + + "ileRequest\022>\n\013app_profile\030\001 \001(\0132$.google" + + ".bigtable.admin.v2.AppProfileB\003\340A\002\0224\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "askB\003\340A\002\022\027\n\017ignore_warnings\030\003 \001(\010\"v\n\027Del" + + "eteAppProfileRequest\022=\n\004name\030\001 \001(\tB/\340A\002\372" + + "A)\n\'bigtableadmin.googleapis.com/AppProf" + + "ile\022\034\n\017ignore_warnings\030\002 \001(\010B\003\340A\002\"\032\n\030Upd" + + "ateAppProfileMetadata\"\332\001\n\025ListHotTablets" + + "Request\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$bigtabl" + + "eadmin.googleapis.com/Cluster\022.\n\nstart_t" + + "ime\030\002 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\003 \001(\0132\032.google.protobuf.Timest" + + "amp\022\021\n\tpage_size\030\004 \001(\005\022\022\n\npage_token\030\005 \001" + + "(\t\"k\n\026ListHotTabletsResponse\0228\n\013hot_tabl" + + "ets\030\001 \003(\0132#.google.bigtable.admin.v2.Hot" + + "Tablet\022\027\n\017next_page_token\030\002 \001(\t2\313!\n\025Bigt" + + "ableInstanceAdmin\022\332\001\n\016CreateInstance\022/.g" + + "oogle.bigtable.admin.v2.CreateInstanceRe" + + "quest\032\035.google.longrunning.Operation\"x\312A" + + "\"\n\010Instance\022\026CreateInstanceMetadata\332A$pa" + + "rent,instance_id,instance,clusters\202\323\344\223\002&" + + "\"!/v2/{parent=projects/*}/instances:\001*\022\221" + + "\001\n\013GetInstance\022,.google.bigtable.admin.v" + + "2.GetInstanceRequest\032\".google.bigtable.a" + + "dmin.v2.Instance\"0\332A\004name\202\323\344\223\002#\022!/v2/{na" + + "me=projects/*/instances/*}\022\244\001\n\rListInsta" + + "nces\022..google.bigtable.admin.v2.ListInst" + + "ancesRequest\032/.google.bigtable.admin.v2." + + "ListInstancesResponse\"2\332A\006parent\202\323\344\223\002#\022!" + + "/v2/{parent=projects/*}/instances\022\206\001\n\016Up" + + "dateInstance\022\".google.bigtable.admin.v2." + + "Instance\032\".google.bigtable.admin.v2.Inst" + + "ance\",\202\323\344\223\002&\032!/v2/{name=projects/*/insta" + + "nces/*}:\001*\022\350\001\n\025PartialUpdateInstance\0226.g" + + "oogle.bigtable.admin.v2.PartialUpdateIns" + + "tanceRequest\032\035.google.longrunning.Operat" + + "ion\"x\312A\"\n\010Instance\022\026UpdateInstanceMetada" + + "ta\332A\024instance,update_mask\202\323\344\223\00262*/v2/{in" + + "stance.name=projects/*/instances/*}:\010ins" + + "tance\022\213\001\n\016DeleteInstance\022/.google.bigtab" + + "le.admin.v2.DeleteInstanceRequest\032\026.goog" + + "le.protobuf.Empty\"0\332A\004name\202\323\344\223\002#*!/v2/{n" + + "ame=projects/*/instances/*}\022\334\001\n\rCreateCl" + + "uster\022..google.bigtable.admin.v2.CreateC" + + "lusterRequest\032\035.google.longrunning.Opera" + + "tion\"|\312A \n\007Cluster\022\025CreateClusterMetadat" + + "a\332A\031parent,cluster_id,cluster\202\323\344\223\0027\",/v2" + + "/{parent=projects/*/instances/*}/cluster" + + "s:\007cluster\022\231\001\n\nGetCluster\022+.google.bigta" + + "ble.admin.v2.GetClusterRequest\032!.google." + + "bigtable.admin.v2.Cluster\";\332A\004name\202\323\344\223\002." + + "\022,/v2/{name=projects/*/instances/*/clust" + + "ers/*}\022\254\001\n\014ListClusters\022-.google.bigtabl" + + "e.admin.v2.ListClustersRequest\032..google." + + "bigtable.admin.v2.ListClustersResponse\"=" + + "\332A\006parent\202\323\344\223\002.\022,/v2/{parent=projects/*/" + + "instances/*}/clusters\022\255\001\n\rUpdateCluster\022" + + "!.google.bigtable.admin.v2.Cluster\032\035.goo" + + "gle.longrunning.Operation\"Z\312A \n\007Cluster\022" + + "\025UpdateClusterMetadata\202\323\344\223\0021\032,/v2/{name=" + + "projects/*/instances/*/clusters/*}:\001*\022\364\001" + + "\n\024PartialUpdateCluster\0225.google.bigtable" + + ".admin.v2.PartialUpdateClusterRequest\032\035." + + "google.longrunning.Operation\"\205\001\312A\'\n\007Clus" + + "ter\022\034PartialUpdateClusterMetadata\332A\023clus" + + "ter,update_mask\202\323\344\223\002?24/v2/{cluster.name" + + "=projects/*/instances/*/clusters/*}:\007clu" + + "ster\022\224\001\n\rDeleteCluster\022..google.bigtable" + + ".admin.v2.DeleteClusterRequest\032\026.google." + + "protobuf.Empty\";\332A\004name\202\323\344\223\002.*,/v2/{name" + + "=projects/*/instances/*/clusters/*}\022\325\001\n\020" + + "CreateAppProfile\0221.google.bigtable.admin" + + ".v2.CreateAppProfileRequest\032$.google.big" + + "table.admin.v2.AppProfile\"h\332A!parent,app" + + "_profile_id,app_profile\202\323\344\223\002>\"//v2/{pare" + + "nt=projects/*/instances/*}/appProfiles:\013" + + "app_profile\022\245\001\n\rGetAppProfile\022..google.b" + + "igtable.admin.v2.GetAppProfileRequest\032$." + + "google.bigtable.admin.v2.AppProfile\">\332A\004" + + "name\202\323\344\223\0021\022//v2/{name=projects/*/instanc" + + "es/*/appProfiles/*}\022\270\001\n\017ListAppProfiles\022" + + "0.google.bigtable.admin.v2.ListAppProfil" + + "esRequest\0321.google.bigtable.admin.v2.Lis" + + "tAppProfilesResponse\"@\332A\006parent\202\323\344\223\0021\022//" + + "v2/{parent=projects/*/instances/*}/appPr" + + "ofiles\022\372\001\n\020UpdateAppProfile\0221.google.big" + + "table.admin.v2.UpdateAppProfileRequest\032\035" + + ".google.longrunning.Operation\"\223\001\312A&\n\nApp" + + "Profile\022\030UpdateAppProfileMetadata\332A\027app_" + + "profile,update_mask\202\323\344\223\002J2;/v2/{app_prof" + + "ile.name=projects/*/instances/*/appProfi" + + "les/*}:\013app_profile\022\235\001\n\020DeleteAppProfile" + + "\0221.google.bigtable.admin.v2.DeleteAppPro" + + "fileRequest\032\026.google.protobuf.Empty\">\332A\004" + + "name\202\323\344\223\0021*//v2/{name=projects/*/instanc" + + "es/*/appProfiles/*}\022\223\001\n\014GetIamPolicy\022\".g" + + "oogle.iam.v1.GetIamPolicyRequest\032\025.googl" + + "e.iam.v1.Policy\"H\332A\010resource\202\323\344\223\0027\"2/v2/" + + "{resource=projects/*/instances/*}:getIam" + + "Policy:\001*\022\232\001\n\014SetIamPolicy\022\".google.iam." + + "v1.SetIamPolicyRequest\032\025.google.iam.v1.P" + + "olicy\"O\332A\017resource,policy\202\323\344\223\0027\"2/v2/{re" + + "source=projects/*/instances/*}:setIamPol" + + "icy:\001*\022\305\001\n\022TestIamPermissions\022(.google.i" + + "am.v1.TestIamPermissionsRequest\032).google" + + ".iam.v1.TestIamPermissionsResponse\"Z\332A\024r" + + "esource,permissions\202\323\344\223\002=\"8/v2/{resource" + + "=projects/*/instances/*}:testIamPermissi" + + "ons:\001*\022\277\001\n\016ListHotTablets\022/.google.bigta" + + "ble.admin.v2.ListHotTabletsRequest\0320.goo" + + "gle.bigtable.admin.v2.ListHotTabletsResp" + + "onse\"J\332A\006parent\202\323\344\223\002;\0229/v2/{parent=proje" + + "cts/*/instances/*/clusters/*}/hotTablets" + + "\032\232\003\312A\034bigtableadmin.googleapis.com\322A\367\002ht" + + "tps://www.googleapis.com/auth/bigtable.a" + + "dmin,https://www.googleapis.com/auth/big" + + "table.admin.cluster,https://www.googleap" + + "is.com/auth/bigtable.admin.instance,http" + + "s://www.googleapis.com/auth/cloud-bigtab" + + "le.admin,https://www.googleapis.com/auth" + + "/cloud-bigtable.admin.cluster,https://ww" + + "w.googleapis.com/auth/cloud-platform,htt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "orm.read-onlyB\335\001\n\034com.google.bigtable.ad" + + "min.v2B\032BigtableInstanceAdminProtoP\001Z8cl" + + "oud.google.com/go/bigtable/admin/apiv2/a" + + "dminpb;adminpb\252\002\036Google.Cloud.Bigtable.A" + + "dmin.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2" + + "\352\002\"Google::Cloud::Bigtable::Admin::V2b\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -481,7 +522,27 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(0); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TableProgress_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(1); + internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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); @@ -561,6 +622,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_bigtable_admin_v2_ListHotTabletsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(25); + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ListHotTabletsResponse_descriptor, + new java.lang.String[] { + "HotTablets", "NextPageToken", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); 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 0bfe904405..d18b6f2323 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public final class BigtableTableAdminProto { @@ -67,10 +68,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_GetTableRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -91,6 +108,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_CheckConsistencyRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -151,6 +176,46 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_ListBackupsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_DeleteAuthorizedViewRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -212,198 +277,311 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "leRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"bigtabl" + "eadmin.googleapis.com/Table\0222\n\004view\030\002 \001(" + "\0162$.google.bigtable.admin.v2.Table.View\"" - + "N\n\022DeleteTableRequest\0228\n\004name\030\001 \001(\tB*\340A\002" - + "\372A$\n\"bigtableadmin.googleapis.com/Table\"" - + "\337\002\n\033ModifyColumnFamiliesRequest\0228\n\004name\030" - + "\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin.googleapis." - + "com/Table\022^\n\rmodifications\030\002 \003(\0132B.googl" - + "e.bigtable.admin.v2.ModifyColumnFamilies" - + "Request.ModificationB\003\340A\002\032\245\001\n\014Modificati" - + "on\022\n\n\002id\030\001 \001(\t\0228\n\006create\030\002 \001(\0132&.google." - + "bigtable.admin.v2.ColumnFamilyH\000\0228\n\006upda" - + "te\030\003 \001(\0132&.google.bigtable.admin.v2.Colu" - + "mnFamilyH\000\022\016\n\004drop\030\004 \001(\010H\000B\005\n\003mod\"[\n\037Gen" - + "erateConsistencyTokenRequest\0228\n\004name\030\001 \001" + + "\177\n\022UpdateTableRequest\0223\n\005table\030\001 \001(\0132\037.g" + + "oogle.bigtable.admin.v2.TableB\003\340A\002\0224\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "askB\003\340A\002\"\201\001\n\023UpdateTableMetadata\022\014\n\004name" + + "\030\001 \001(\t\022.\n\nstart_time\030\002 \001(\0132\032.google.prot" + + "obuf.Timestamp\022,\n\010end_time\030\003 \001(\0132\032.googl" + + "e.protobuf.Timestamp\"N\n\022DeleteTableReque" + + "st\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin." + + "googleapis.com/Table\"P\n\024UndeleteTableReq" + + "uest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmi" + + "n.googleapis.com/Table\"\203\001\n\025UndeleteTable" + + "Metadata\022\014\n\004name\030\001 \001(\t\022.\n\nstart_time\030\002 \001" + + "(\0132\032.google.protobuf.Timestamp\022,\n\010end_ti" + + "me\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\rmodifications\030\002 \003(\0132B.google.b" + + "igtable.admin.v2.ModifyColumnFamiliesReq" + + "uest.ModificationB\003\340A\002\022\034\n\017ignore_warning" + + "s\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.admi" + + "n.v2.ColumnFamilyH\000\0228\n\006update\030\003 \001(\0132&.go" + + "ogle.bigtable.admin.v2.ColumnFamilyH\000\022\016\n" + + "\004drop\030\004 \001(\010H\000\0224\n\013update_mask\030\006 \001(\0132\032.goo" + + "gle.protobuf.FieldMaskB\003\340A\001B\005\n\003mod\"[\n\037Ge" + + "nerateConsistencyTokenRequest\0228\n\004name\030\001 " + + "\001(\tB*\340A\002\372A$\n\"bigtableadmin.googleapis.co" + + "m/Table\"=\n GenerateConsistencyTokenRespo" + + "nse\022\031\n\021consistency_token\030\001 \001(\t\"\262\002\n\027Check" + + "ConsistencyRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$" + + "\n\"bigtableadmin.googleapis.com/Table\022\036\n\021" + + "consistency_token\030\002 \001(\tB\003\340A\002\022Y\n\033standard" + + "_read_remote_writes\030\003 \001(\01322.google.bigta" + + "ble.admin.v2.StandardReadRemoteWritesH\000\022" + + "Z\n\034data_boost_read_local_writes\030\004 \001(\01322." + + "google.bigtable.admin.v2.DataBoostReadLo" + + "calWritesH\000B\006\n\004mode\"\032\n\030StandardReadRemot" + + "eWrites\"\032\n\030DataBoostReadLocalWrites\".\n\030C" + + "heckConsistencyResponse\022\022\n\nconsistent\030\001 " + + "\001(\010\"\346\001\n\024SnapshotTableRequest\0228\n\004name\030\001 \001" + "(\tB*\340A\002\372A$\n\"bigtableadmin.googleapis.com" - + "/Table\"=\n GenerateConsistencyTokenRespon" - + "se\022\031\n\021consistency_token\030\001 \001(\t\"s\n\027CheckCo" - + "nsistencyRequest\0228\n\004name\030\001 \001(\tB*\340A\002\372A$\n\"" - + "bigtableadmin.googleapis.com/Table\022\036\n\021co" - + "nsistency_token\030\002 \001(\tB\003\340A\002\".\n\030CheckConsi" - + "stencyResponse\022\022\n\nconsistent\030\001 \001(\010\"\346\001\n\024S" - + "napshotTableRequest\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.go" - + "ogleapis.com/Cluster\022\030\n\013snapshot_id\030\003 \001(" - + "\tB\003\340A\002\022&\n\003ttl\030\004 \001(\0132\031.google.protobuf.Du" - + "ration\022\023\n\013description\030\005 \001(\t\"Q\n\022GetSnapsh" - + "otRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%bigtabl" - + "eadmin.googleapis.com/Snapshot\"{\n\024ListSn" - + "apshotsRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$" - + "bigtableadmin.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\"T\n\025DeleteSnapshotRe" - + "quest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%bigtableadm" - + "in.googleapis.com/Snapshot\"\304\001\n\025SnapshotT" - + "ableMetadata\022H\n\020original_request\030\001 \001(\0132." - + ".google.bigtable.admin.v2.SnapshotTableR" - + "equest\0220\n\014request_time\030\002 \001(\0132\032.google.pr" - + "otobuf.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032." - + "google.protobuf.Timestamp\"\330\001\n\037CreateTabl" - + "eFromSnapshotMetadata\022R\n\020original_reques" - + "t\030\001 \001(\01328.google.bigtable.admin.v2.Creat" - + "eTableFromSnapshotRequest\0220\n\014request_tim" - + "e\030\002 \001(\0132\032.google.protobuf.Timestamp\022/\n\013f" - + "inish_time\030\003 \001(\0132\032.google.protobuf.Times" - + "tamp\"\242\001\n\023CreateBackupRequest\022<\n\006parent\030\001" - + " \001(\tB,\340A\002\372A&\n$bigtableadmin.googleapis.c" - + "om/Cluster\022\026\n\tbackup_id\030\002 \001(\tB\003\340A\002\0225\n\006ba" - + "ckup\030\003 \001(\0132 .google.bigtable.admin.v2.Ba" - + "ckupB\003\340A\002\"\230\001\n\024CreateBackupMetadata\022\014\n\004na" - + "me\030\001 \001(\t\022\024\n\014source_table\030\002 \001(\t\022.\n\nstart_" - + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022," - + "\n\010end_time\030\004 \001(\0132\032.google.protobuf.Times" - + "tamp\"\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.protob" - + "uf.FieldMaskB\003\340A\002\"M\n\020GetBackupRequest\0229\n" - + "\004name\030\001 \001(\tB+\340A\002\372A%\n#bigtableadmin.googl" - + "eapis.com/Backup\"P\n\023DeleteBackupRequest\022" - + "9\n\004name\030\001 \001(\tB+\340A\002\372A%\n#bigtableadmin.goo" - + "gleapis.com/Backup\"\233\001\n\022ListBackupsReques" - + "t\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\022" - + "1\n\007backups\030\001 \003(\0132 .google.bigtable.admin" - + ".v2.Backup\022\027\n\017next_page_token\030\002 \001(\t2\230%\n\022" - + "BigtableTableAdmin\022\253\001\n\013CreateTable\022,.goo" - + "gle.bigtable.admin.v2.CreateTableRequest" - + "\032\037.google.bigtable.admin.v2.Table\"M\202\323\344\223\002" - + "/\"*/v2/{parent=projects/*/instances/*}/t" - + "ables:\001*\332A\025parent,table_id,table\022\212\002\n\027Cre" - + "ateTableFromSnapshot\0228.google.bigtable.a" - + "dmin.v2.CreateTableFromSnapshotRequest\032\035" - + ".google.longrunning.Operation\"\225\001\202\323\344\223\002B\"=" - + "/v2/{parent=projects/*/instances/*}/tabl" - + "es:createFromSnapshot:\001*\332A\037parent,table_" - + "id,source_snapshot\312A(\n\005Table\022\037CreateTabl" - + "eFromSnapshotMetadata\022\244\001\n\nListTables\022+.g" - + "oogle.bigtable.admin.v2.ListTablesReques" - + "t\032,.google.bigtable.admin.v2.ListTablesR" - + "esponse\";\202\323\344\223\002,\022*/v2/{parent=projects/*/" - + "instances/*}/tables\332A\006parent\022\221\001\n\010GetTabl" - + "e\022).google.bigtable.admin.v2.GetTableReq" - + "uest\032\037.google.bigtable.admin.v2.Table\"9\202" - + "\323\344\223\002,\022*/v2/{name=projects/*/instances/*/" - + "tables/*}\332A\004name\022\216\001\n\013DeleteTable\022,.googl" - + "e.bigtable.admin.v2.DeleteTableRequest\032\026" - + ".google.protobuf.Empty\"9\202\323\344\223\002,**/v2/{nam" - + "e=projects/*/instances/*/tables/*}\332A\004nam" - + "e\022\317\001\n\024ModifyColumnFamilies\0225.google.bigt" - + "able.admin.v2.ModifyColumnFamiliesReques" - + "t\032\037.google.bigtable.admin.v2.Table\"_\202\323\344\223" - + "\002D\"?/v2/{name=projects/*/instances/*/tab" - + "les/*}:modifyColumnFamilies:\001*\332A\022name,mo" - + "difications\022\231\001\n\014DropRowRange\022-.google.bi" - + "gtable.admin.v2.DropRowRangeRequest\032\026.go" - + "ogle.protobuf.Empty\"B\202\323\344\223\002<\"7/v2/{name=p" - + "rojects/*/instances/*/tables/*}:dropRowR" - + "ange:\001*\022\350\001\n\030GenerateConsistencyToken\0229.g" - + "oogle.bigtable.admin.v2.GenerateConsiste" - + "ncyTokenRequest\032:.google.bigtable.admin." - + "v2.GenerateConsistencyTokenResponse\"U\202\323\344" - + "\223\002H\"C/v2/{name=projects/*/instances/*/ta" - + "bles/*}:generateConsistencyToken:\001*\332A\004na" - + "me\022\332\001\n\020CheckConsistency\0221.google.bigtabl" - + "e.admin.v2.CheckConsistencyRequest\0322.goo" - + "gle.bigtable.admin.v2.CheckConsistencyRe" - + "sponse\"_\202\323\344\223\002@\";/v2/{name=projects/*/ins" - + "tances/*/tables/*}:checkConsistency:\001*\332A" - + "\026name,consistency_token\022\352\001\n\rSnapshotTabl" - + "e\022..google.bigtable.admin.v2.SnapshotTab" - + "leRequest\032\035.google.longrunning.Operation" - + "\"\211\001\202\323\344\223\0028\"3/v2/{name=projects/*/instance" - + "s/*/tables/*}:snapshot:\001*\332A$name,cluster" - + ",snapshot_id,description\312A!\n\010Snapshot\022\025S" - + "napshotTableMetadata\022\250\001\n\013GetSnapshot\022,.g" - + "oogle.bigtable.admin.v2.GetSnapshotReque" - + "st\032\".google.bigtable.admin.v2.Snapshot\"G" - + "\202\323\344\223\002:\0228/v2/{name=projects/*/instances/*" - + "/clusters/*/snapshots/*}\332A\004name\022\273\001\n\rList" - + "Snapshots\022..google.bigtable.admin.v2.Lis" - + "tSnapshotsRequest\032/.google.bigtable.admi" - + "n.v2.ListSnapshotsResponse\"I\202\323\344\223\002:\0228/v2/" - + "{parent=projects/*/instances/*/clusters/" - + "*}/snapshots\332A\006parent\022\242\001\n\016DeleteSnapshot" - + "\022/.google.bigtable.admin.v2.DeleteSnapsh" - + "otRequest\032\026.google.protobuf.Empty\"G\202\323\344\223\002" - + ":*8/v2/{name=projects/*/instances/*/clus" - + "ters/*/snapshots/*}\332A\004name\022\340\001\n\014CreateBac" - + "kup\022-.google.bigtable.admin.v2.CreateBac" - + "kupRequest\032\035.google.longrunning.Operatio" - + "n\"\201\001\202\323\344\223\002@\"6/v2/{parent=projects/*/insta" - + "nces/*/clusters/*}/backups:\006backup\332A\027par" - + "ent,backup_id,backup\312A\036\n\006Backup\022\024CreateB" - + "ackupMetadata\022\240\001\n\tGetBackup\022*.google.big" - + "table.admin.v2.GetBackupRequest\032 .google" - + ".bigtable.admin.v2.Backup\"E\202\323\344\223\0028\0226/v2/{" + + "/Table\022=\n\007cluster\030\002 \001(\tB,\340A\002\372A&\n$bigtabl" + + "eadmin.googleapis.com/Cluster\022\030\n\013snapsho" + + "t_id\030\003 \001(\tB\003\340A\002\022&\n\003ttl\030\004 \001(\0132\031.google.pr" + + "otobuf.Duration\022\023\n\013description\030\005 \001(\t\"Q\n\022" + + "GetSnapshotRequest\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/Cl" + + "uster\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003" + + " \001(\t\"g\n\025ListSnapshotsResponse\0225\n\tsnapsho" + + "ts\030\001 \003(\0132\".google.bigtable.admin.v2.Snap" + + "shot\022\027\n\017next_page_token\030\002 \001(\t\"T\n\025DeleteS" + + "napshotRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n%bi" + + "gtableadmin.googleapis.com/Snapshot\"\304\001\n\025" + + "SnapshotTableMetadata\022H\n\020original_reques" + + "t\030\001 \001(\0132..google.bigtable.admin.v2.Snaps" + + "hotTableRequest\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\037C" + + "reateTableFromSnapshotMetadata\022R\n\020origin" + + "al_request\030\001 \001(\01328.google.bigtable.admin" + + ".v2.CreateTableFromSnapshotRequest\0220\n\014re" + + "quest_time\030\002 \001(\0132\032.google.protobuf.Times" + + "tamp\022/\n\013finish_time\030\003 \001(\0132\032.google.proto" + + "buf.Timestamp\"\242\001\n\023CreateBackupRequest\022<\n" + + "\006parent\030\001 \001(\tB,\340A\002\372A&\n$bigtableadmin.goo" + + "gleapis.com/Cluster\022\026\n\tbackup_id\030\002 \001(\tB\003" + + "\340A\002\0225\n\006backup\030\003 \001(\0132 .google.bigtable.ad" + + "min.v2.BackupB\003\340A\002\"\230\001\n\024CreateBackupMetad" + + "ata\022\014\n\004name\030\001 \001(\t\022\024\n\014source_table\030\002 \001(\t\022" + + ".\n\nstart_time\030\003 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022,\n\010end_time\030\004 \001(\0132\032.google.proto" + + "buf.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.goog" + + "le.protobuf.FieldMaskB\003\340A\002\"M\n\020GetBackupR" + + "equest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#bigtablead" + + "min.googleapis.com/Backup\"P\n\023DeleteBacku" + + "pRequest\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#bigtable" + + "admin.googleapis.com/Backup\"\233\001\n\022ListBack" + + "upsRequest\022<\n\006parent\030\001 \001(\tB,\340A\002\372A&\n$bigt" + + "ableadmin.googleapis.com/Cluster\022\016\n\006filt" + + "er\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\023ListBackups" + + "Response\0221\n\007backups\030\001 \003(\0132 .google.bigta" + + "ble.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\rsour" + + "ce_backup\030\003 \001(\tB+\340A\002\372A%\n#bigtableadmin.g" + + "oogleapis.com/Backup\0224\n\013expire_time\030\004 \001(" + + "\0132\032.google.protobuf.TimestampB\003\340A\002\"\315\001\n\022C" + + "opyBackupMetadata\0226\n\004name\030\001 \001(\tB(\372A%\n#bi" + + "gtableadmin.googleapis.com/Backup\022@\n\022sou" + + "rce_backup_info\030\002 \001(\0132$.google.bigtable." + + "admin.v2.BackupInfo\022=\n\010progress\030\003 \001(\0132+." + + "google.bigtable.admin.v2.OperationProgre" + + "ss\"\313\001\n\033CreateAuthorizedViewRequest\022C\n\006pa" + + "rent\030\001 \001(\tB3\340A\002\372A-\022+bigtableadmin.google" + + "apis.com/AuthorizedView\022\037\n\022authorized_vi" + + "ew_id\030\002 \001(\tB\003\340A\002\022F\n\017authorized_view\030\003 \001(" + + "\0132(.google.bigtable.admin.v2.AuthorizedV" + + "iewB\003\340A\002\"\322\001\n\034CreateAuthorizedViewMetadat" + + "a\022O\n\020original_request\030\001 \001(\01325.google.big" + + "table.admin.v2.CreateAuthorizedViewReque" + + "st\0220\n\014request_time\030\002 \001(\0132\032.google.protob" + + "uf.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.goog" + + "le.protobuf.Timestamp\"\334\001\n\032ListAuthorized" + + "ViewsRequest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\022+bi" + + "gtableadmin.googleapis.com/AuthorizedVie" + + "w\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030" + + "\003 \001(\tB\003\340A\001\022H\n\004view\030\004 \001(\01625.google.bigtab" + + "le.admin.v2.AuthorizedView.ResponseViewB" + + "\003\340A\001\"z\n\033ListAuthorizedViewsResponse\022B\n\020a" + + "uthorized_views\030\001 \003(\0132(.google.bigtable." + + "admin.v2.AuthorizedView\022\027\n\017next_page_tok" + + "en\030\002 \001(\t\"\247\001\n\030GetAuthorizedViewRequest\022A\n" + + "\004name\030\001 \001(\tB3\340A\002\372A-\n+bigtableadmin.googl" + + "eapis.com/AuthorizedView\022H\n\004view\030\002 \001(\01625" + + ".google.bigtable.admin.v2.AuthorizedView" + + ".ResponseViewB\003\340A\001\"\271\001\n\033UpdateAuthorizedV" + + "iewRequest\022F\n\017authorized_view\030\001 \001(\0132(.go" + + "ogle.bigtable.admin.v2.AuthorizedViewB\003\340" + + "A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.protobu" + + "f.FieldMaskB\003\340A\001\022\034\n\017ignore_warnings\030\003 \001(" + + "\010B\003\340A\001\"\322\001\n\034UpdateAuthorizedViewMetadata\022" + + "O\n\020original_request\030\001 \001(\01325.google.bigta" + + "ble.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\033DeleteAuthorizedV" + + "iewRequest\022A\n\004name\030\001 \001(\tB3\340A\002\372A-\n+bigtab" + + "leadmin.googleapis.com/AuthorizedView\022\021\n" + + "\004etag\030\002 \001(\tB\003\340A\0012\2663\n\022BigtableTableAdmin\022" + + "\253\001\n\013CreateTable\022,.google.bigtable.admin." + + "v2.CreateTableRequest\032\037.google.bigtable." + + "admin.v2.Table\"M\332A\025parent,table_id,table" + + "\202\323\344\223\002/\"*/v2/{parent=projects/*/instances" + + "/*}/tables:\001*\022\212\002\n\027CreateTableFromSnapsho" + + "t\0228.google.bigtable.admin.v2.CreateTable" + + "FromSnapshotRequest\032\035.google.longrunning" + + ".Operation\"\225\001\312A(\n\005Table\022\037CreateTableFrom" + + "SnapshotMetadata\332A\037parent,table_id,sourc" + + "e_snapshot\202\323\344\223\002B\"=/v2/{parent=projects/*" + + "/instances/*}/tables:createFromSnapshot:" + + "\001*\022\244\001\n\nListTables\022+.google.bigtable.admi" + + "n.v2.ListTablesRequest\032,.google.bigtable" + + ".admin.v2.ListTablesResponse\";\332A\006parent\202" + + "\323\344\223\002,\022*/v2/{parent=projects/*/instances/" + + "*}/tables\022\221\001\n\010GetTable\022).google.bigtable" + + ".admin.v2.GetTableRequest\032\037.google.bigta" + + "ble.admin.v2.Table\"9\332A\004name\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\023UpdateTableMetad" + + "ata\332A\021table,update_mask\202\323\344\223\002920/v2/{tabl" + + "e.name=projects/*/instances/*/tables/*}:" + + "\005table\022\216\001\n\013DeleteTable\022,.google.bigtable" + + ".admin.v2.DeleteTableRequest\032\026.google.pr" + + "otobuf.Empty\"9\332A\004name\202\323\344\223\002,**/v2/{name=p" + + "rojects/*/instances/*/tables/*}\022\306\001\n\rUnde" + + "leteTable\022..google.bigtable.admin.v2.Und" + + "eleteTableRequest\032\035.google.longrunning.O" + + "peration\"f\312A\036\n\005Table\022\025UndeleteTableMetad" + + "ata\332A\004name\202\323\344\223\0028\"3/v2/{name=projects/*/i" + + "nstances/*/tables/*}:undelete:\001*\022\241\002\n\024Cre" + + "ateAuthorizedView\0225.google.bigtable.admi" + + "n.v2.CreateAuthorizedViewRequest\032\035.googl" + + "e.longrunning.Operation\"\262\001\312A.\n\016Authorize" + + "dView\022\034CreateAuthorizedViewMetadata\332A)pa" + + "rent,authorized_view,authorized_view_id\202" + + "\323\344\223\002O\"\022\022* + * Change stream configuration. + *
    + * + * Protobuf type {@code google.bigtable.admin.v2.ChangeStreamConfig} + */ +public final class ChangeStreamConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ChangeStreamConfig) + ChangeStreamConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ChangeStreamConfig.newBuilder() to construct. + private ChangeStreamConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChangeStreamConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRetentionPeriodFieldBuilder(); + } + } + + @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 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.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(getRetentionPeriodFieldBuilder().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.SingleFieldBuilderV3< + 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 getRetentionPeriodFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getRetentionPeriod(), getParentForChildren(), isClean()); + retentionPeriod_ = null; + } + return retentionPeriodBuilder_; + } + + @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.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..4ffe55e44f --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ChangeStreamConfigOrBuilder.java @@ -0,0 +1,73 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/table.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 7728cd9427..3b509d99b5 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -49,62 +50,6 @@ 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; @@ -120,14 +65,65 @@ 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}`.
        * 
    * @@ -153,8 +149,8 @@ public 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}`.
        * 
    * @@ -178,7 +174,9 @@ 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_ = ""; /** * * @@ -226,6 +224,128 @@ 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 @@ -246,7 +366,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(consistencyToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, consistencyToken_); } - unknownFields.writeTo(output); + if (modeCase_ == 3) { + output.writeMessage(3, (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_); + } + if (modeCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -261,7 +387,17 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(consistencyToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, consistencyToken_); } - size += unknownFields.getSerializedSize(); + if (modeCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_); + } + if (modeCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -279,7 +415,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 +443,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; } @@ -424,26 +585,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) { 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,12 +632,35 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CheckConsistencyRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.consistencyToken_ = consistencyToken_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.CheckConsistencyRequest result) { + result.modeCase_ = modeCase_; + result.mode_ = this.mode_; + if (modeCase_ == 3 && standardReadRemoteWritesBuilder_ != null) { + result.mode_ = standardReadRemoteWritesBuilder_.build(); + } + if (modeCase_ == 4 && dataBoostReadLocalWritesBuilder_ != null) { + result.mode_ = dataBoostReadLocalWritesBuilder_.build(); + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -525,13 +709,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 +748,83 @@ 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( + getStandardReadRemoteWritesFieldBuilder().getBuilder(), extensionRegistry); + modeCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getDataBoostReadLocalWritesFieldBuilder().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}`.
          * 
    * @@ -592,8 +849,8 @@ public 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}`.
          * 
    * @@ -618,8 +875,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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,8 +891,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -643,8 +900,8 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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,8 +912,8 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -664,8 +921,8 @@ public Builder clearName() { * * *
    -     * 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,8 +938,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -748,8 +1005,8 @@ public Builder setConsistencyToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - consistencyToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -765,8 +1022,8 @@ 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,12 +1044,494 @@ public Builder setConsistencyTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - consistencyToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } + private com.google.protobuf.SingleFieldBuilderV3< + 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 getStandardReadRemoteWritesFieldBuilder().getBuilder(); + } + /** + * + * + *
    +     * Checks that reads using an app profile with `StandardIsolation` can
    +     * see all writes committed before the token was created, even if the
    +     * read and write target different clusters.
    +     * 
    + * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder + getStandardReadRemoteWritesOrBuilder() { + if ((modeCase_ == 3) && (standardReadRemoteWritesBuilder_ != null)) { + return standardReadRemoteWritesBuilder_.getMessageOrBuilder(); + } else { + if (modeCase_ == 3) { + return (com.google.bigtable.admin.v2.StandardReadRemoteWrites) mode_; + } + return com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + } + /** + * + * + *
    +     * Checks that reads using an app profile with `StandardIsolation` can
    +     * see all writes committed before the token was created, even if the
    +     * read and write target different clusters.
    +     * 
    + * + * .google.bigtable.admin.v2.StandardReadRemoteWrites standard_read_remote_writes = 3; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.StandardReadRemoteWrites, + com.google.bigtable.admin.v2.StandardReadRemoteWrites.Builder, + com.google.bigtable.admin.v2.StandardReadRemoteWritesOrBuilder> + getStandardReadRemoteWritesFieldBuilder() { + if (standardReadRemoteWritesBuilder_ == null) { + if (!(modeCase_ == 3)) { + mode_ = com.google.bigtable.admin.v2.StandardReadRemoteWrites.getDefaultInstance(); + } + standardReadRemoteWritesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.DataBoostReadLocalWrites, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder, + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder> + dataBoostReadLocalWritesBuilder_; + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return Whether the dataBoostReadLocalWrites field is set. + */ + @java.lang.Override + public boolean hasDataBoostReadLocalWrites() { + return modeCase_ == 4; + } + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + * + * @return The dataBoostReadLocalWrites. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites getDataBoostReadLocalWrites() { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (modeCase_ == 4) { + return (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_; + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } else { + if (modeCase_ == 4) { + return dataBoostReadLocalWritesBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + } + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder setDataBoostReadLocalWrites( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites value) { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mode_ = value; + onChanged(); + } else { + dataBoostReadLocalWritesBuilder_.setMessage(value); + } + modeCase_ = 4; + return this; + } + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder setDataBoostReadLocalWrites( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder builderForValue) { + if (dataBoostReadLocalWritesBuilder_ == null) { + mode_ = builderForValue.build(); + onChanged(); + } else { + dataBoostReadLocalWritesBuilder_.setMessage(builderForValue.build()); + } + modeCase_ = 4; + return this; + } + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder mergeDataBoostReadLocalWrites( + com.google.bigtable.admin.v2.DataBoostReadLocalWrites value) { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (modeCase_ == 4 + && mode_ + != com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance()) { + mode_ = + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.newBuilder( + (com.google.bigtable.admin.v2.DataBoostReadLocalWrites) mode_) + .mergeFrom(value) + .buildPartial(); + } else { + mode_ = value; + } + onChanged(); + } else { + if (modeCase_ == 4) { + dataBoostReadLocalWritesBuilder_.mergeFrom(value); + } else { + dataBoostReadLocalWritesBuilder_.setMessage(value); + } + } + modeCase_ = 4; + return this; + } + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public Builder clearDataBoostReadLocalWrites() { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + onChanged(); + } + } else { + if (modeCase_ == 4) { + modeCase_ = 0; + mode_ = null; + } + dataBoostReadLocalWritesBuilder_.clear(); + } + return this; + } + /** + * + * + *
    +     * Checks that reads using an app profile with `DataBoostIsolationReadOnly`
    +     * can see all writes committed before the token was created, but only if
    +     * the read and write target the same cluster.
    +     * 
    + * + * .google.bigtable.admin.v2.DataBoostReadLocalWrites data_boost_read_local_writes = 4; + * + */ + public com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder + getDataBoostReadLocalWritesBuilder() { + return getDataBoostReadLocalWritesFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.DataBoostReadLocalWrites, + com.google.bigtable.admin.v2.DataBoostReadLocalWrites.Builder, + com.google.bigtable.admin.v2.DataBoostReadLocalWritesOrBuilder> + getDataBoostReadLocalWritesFieldBuilder() { + if (dataBoostReadLocalWritesBuilder_ == null) { + if (!(modeCase_ == 4)) { + mode_ = com.google.bigtable.admin.v2.DataBoostReadLocalWrites.getDefaultInstance(); + } + dataBoostReadLocalWritesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -825,7 +1564,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..a245f6f441 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CheckConsistencyRequestOrBuilder @@ -27,8 +28,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}`.
        * 
    * @@ -43,8 +44,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}`.
        * 
    * @@ -80,4 +81,96 @@ 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..6c25e95dd7 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -46,53 +47,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new CheckConsistencyResponse(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_CheckConsistencyResponse_descriptor; @@ -109,7 +63,7 @@ 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 +98,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 +110,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 +127,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 +140,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; } @@ -317,24 +271,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) { 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,11 +309,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CheckConsistencyResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.consistent_ = consistent_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -416,7 +372,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,21 +387,42 @@ 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_; /** * @@ -479,6 +456,7 @@ public boolean getConsistent() { public Builder setConsistent(boolean value) { consistent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -495,7 +473,7 @@ public Builder setConsistent(boolean value) { * @return This builder for chaining. */ public Builder clearConsistent() { - + bitField0_ = (bitField0_ & ~0x00000001); consistent_ = false; onChanged(); return this; @@ -533,7 +511,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..3ca183ba30 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CheckConsistencyResponseOrBuilder 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 daebbd423c..c1afd363a3 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -43,6 +44,7 @@ private Cluster() { name_ = ""; location_ = ""; state_ = 0; + nodeScalingFactor_ = 0; defaultStorageType_ = 0; } @@ -52,116 +54,6 @@ 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; - } - case 58: - { - com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder subBuilder = null; - if (configCase_ == 7) { - subBuilder = - ((com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_).toBuilder(); - } - config_ = - input.readMessage( - com.google.bigtable.admin.v2.Cluster.ClusterConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_); - config_ = subBuilder.buildPartial(); - } - configCase_ = 7; - 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; @@ -392,6 +284,171 @@ private State(int value) { // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Cluster.State) } + /** + * + * + *
    +   * Possible node scaling factors of the clusters. Node scaling delivers better
    +   * latency and more throughput by removing node boundaries.
    +   * 
    + * + * Protobuf enum {@code google.bigtable.admin.v2.Cluster.NodeScalingFactor} + */ + public enum NodeScalingFactor implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
    +     * No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
    +     * 
    + * + * NODE_SCALING_FACTOR_UNSPECIFIED = 0; + */ + NODE_SCALING_FACTOR_UNSPECIFIED(0), + /** + * + * + *
    +     * The cluster is running with a scaling factor of 1.
    +     * 
    + * + * NODE_SCALING_FACTOR_1X = 1; + */ + NODE_SCALING_FACTOR_1X(1), + /** + * + * + *
    +     * The cluster is running with a scaling factor of 2.
    +     * All node count values must be in increments of 2 with this scaling factor
    +     * enabled, otherwise an INVALID_ARGUMENT error will be returned.
    +     * 
    + * + * NODE_SCALING_FACTOR_2X = 2; + */ + NODE_SCALING_FACTOR_2X(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
    +     * No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X.
    +     * 
    + * + * NODE_SCALING_FACTOR_UNSPECIFIED = 0; + */ + public static final int NODE_SCALING_FACTOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
    +     * The cluster is running with a scaling factor of 1.
    +     * 
    + * + * NODE_SCALING_FACTOR_1X = 1; + */ + public static final int NODE_SCALING_FACTOR_1X_VALUE = 1; + /** + * + * + *
    +     * The cluster is running with a scaling factor of 2.
    +     * All node count values must be in increments of 2 with this scaling factor
    +     * enabled, otherwise an INVALID_ARGUMENT error will be returned.
    +     * 
    + * + * NODE_SCALING_FACTOR_2X = 2; + */ + public static final int NODE_SCALING_FACTOR_2X_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NodeScalingFactor valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static NodeScalingFactor forNumber(int value) { + switch (value) { + case 0: + return NODE_SCALING_FACTOR_UNSPECIFIED; + case 1: + return NODE_SCALING_FACTOR_1X; + case 2: + return NODE_SCALING_FACTOR_2X; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NodeScalingFactor findValueByNumber(int number) { + return NodeScalingFactor.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.Cluster.getDescriptor().getEnumTypes().get(1); + } + + private static final NodeScalingFactor[] VALUES = values(); + + public static NodeScalingFactor valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private NodeScalingFactor(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Cluster.NodeScalingFactor) + } + public interface ClusterAutoscalingConfigOrBuilder extends // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig) @@ -506,81 +563,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ClusterAutoscalingConfig(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClusterAutoscalingConfig( - 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.AutoscalingLimits.Builder subBuilder = null; - if (autoscalingLimits_ != null) { - subBuilder = autoscalingLimits_.toBuilder(); - } - autoscalingLimits_ = - input.readMessage( - com.google.bigtable.admin.v2.AutoscalingLimits.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(autoscalingLimits_); - autoscalingLimits_ = subBuilder.buildPartial(); - } - - break; - } - case 18: - { - com.google.bigtable.admin.v2.AutoscalingTargets.Builder subBuilder = null; - if (autoscalingTargets_ != null) { - subBuilder = autoscalingTargets_.toBuilder(); - } - autoscalingTargets_ = - input.readMessage( - com.google.bigtable.admin.v2.AutoscalingTargets.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(autoscalingTargets_); - autoscalingTargets_ = 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_ClusterAutoscalingConfig_descriptor; @@ -596,6 +578,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; /** @@ -613,7 +596,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasAutoscalingLimits() { - return autoscalingLimits_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -647,7 +630,9 @@ public com.google.bigtable.admin.v2.AutoscalingLimits getAutoscalingLimits() { */ @java.lang.Override public com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder getAutoscalingLimitsOrBuilder() { - return getAutoscalingLimits(); + return autoscalingLimits_ == null + ? com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance() + : autoscalingLimits_; } public static final int AUTOSCALING_TARGETS_FIELD_NUMBER = 2; @@ -667,7 +652,7 @@ public com.google.bigtable.admin.v2.AutoscalingLimitsOrBuilder getAutoscalingLim */ @java.lang.Override public boolean hasAutoscalingTargets() { - return autoscalingTargets_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -702,7 +687,9 @@ public com.google.bigtable.admin.v2.AutoscalingTargets getAutoscalingTargets() { @java.lang.Override public com.google.bigtable.admin.v2.AutoscalingTargetsOrBuilder getAutoscalingTargetsOrBuilder() { - return getAutoscalingTargets(); + return autoscalingTargets_ == null + ? com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance() + : autoscalingTargets_; } private byte memoizedIsInitialized = -1; @@ -719,13 +706,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (autoscalingLimits_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getAutoscalingLimits()); } - if (autoscalingTargets_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getAutoscalingTargets()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -734,14 +721,14 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (autoscalingLimits_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAutoscalingLimits()); } - if (autoscalingTargets_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAutoscalingTargets()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -765,7 +752,7 @@ public boolean equals(final java.lang.Object obj) { if (hasAutoscalingTargets()) { if (!getAutoscalingTargets().equals(other.getAutoscalingTargets())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -784,7 +771,7 @@ public int hashCode() { hash = (37 * hash) + AUTOSCALING_TARGETS_FIELD_NUMBER; hash = (53 * hash) + getAutoscalingTargets().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -926,22 +913,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAutoscalingLimitsFieldBuilder(); + getAutoscalingTargetsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (autoscalingLimitsBuilder_ == null) { - autoscalingLimits_ = null; - } else { - autoscalingLimits_ = null; + bitField0_ = 0; + autoscalingLimits_ = null; + if (autoscalingLimitsBuilder_ != null) { + autoscalingLimitsBuilder_.dispose(); autoscalingLimitsBuilder_ = null; } - if (autoscalingTargetsBuilder_ == null) { - autoscalingTargets_ = null; - } else { - autoscalingTargets_ = null; + autoscalingTargets_ = null; + if (autoscalingTargetsBuilder_ != null) { + autoscalingTargetsBuilder_.dispose(); autoscalingTargetsBuilder_ = null; } return this; @@ -972,20 +961,34 @@ public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig build() { 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 (autoscalingLimitsBuilder_ == null) { - result.autoscalingLimits_ = autoscalingLimits_; - } else { - result.autoscalingLimits_ = autoscalingLimitsBuilder_.build(); - } - if (autoscalingTargetsBuilder_ == null) { - result.autoscalingTargets_ = autoscalingTargets_; - } else { - result.autoscalingTargets_ = autoscalingTargetsBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } + private void buildPartial0( + com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.autoscalingLimits_ = + autoscalingLimitsBuilder_ == null + ? autoscalingLimits_ + : autoscalingLimitsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.autoscalingTargets_ = + autoscalingTargetsBuilder_ == null + ? autoscalingTargets_ + : autoscalingTargetsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -1042,7 +1045,7 @@ public Builder mergeFrom( if (other.hasAutoscalingTargets()) { mergeAutoscalingTargets(other.getAutoscalingTargets()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1057,22 +1060,50 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig 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( + getAutoscalingLimitsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getAutoscalingTargetsFieldBuilder().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.ClusterAutoscalingConfig) - e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.bigtable.admin.v2.AutoscalingLimits autoscalingLimits_; private com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.AutoscalingLimits, @@ -1093,7 +1124,7 @@ public Builder mergeFrom( * @return Whether the autoscalingLimits field is set. */ public boolean hasAutoscalingLimits() { - return autoscalingLimitsBuilder_ != null || autoscalingLimits_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -1134,11 +1165,11 @@ public Builder setAutoscalingLimits(com.google.bigtable.admin.v2.AutoscalingLimi throw new NullPointerException(); } autoscalingLimits_ = value; - onChanged(); } else { autoscalingLimitsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -1156,11 +1187,11 @@ public Builder setAutoscalingLimits( com.google.bigtable.admin.v2.AutoscalingLimits.Builder builderForValue) { if (autoscalingLimitsBuilder_ == null) { autoscalingLimits_ = builderForValue.build(); - onChanged(); } else { autoscalingLimitsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -1176,19 +1207,21 @@ public Builder setAutoscalingLimits( */ public Builder mergeAutoscalingLimits(com.google.bigtable.admin.v2.AutoscalingLimits value) { if (autoscalingLimitsBuilder_ == null) { - if (autoscalingLimits_ != null) { - autoscalingLimits_ = - com.google.bigtable.admin.v2.AutoscalingLimits.newBuilder(autoscalingLimits_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && autoscalingLimits_ != null + && autoscalingLimits_ + != com.google.bigtable.admin.v2.AutoscalingLimits.getDefaultInstance()) { + getAutoscalingLimitsBuilder().mergeFrom(value); } else { autoscalingLimits_ = value; } - onChanged(); } else { autoscalingLimitsBuilder_.mergeFrom(value); } - + if (autoscalingLimits_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } /** @@ -1203,14 +1236,13 @@ public Builder mergeAutoscalingLimits(com.google.bigtable.admin.v2.AutoscalingLi *
    */ public Builder clearAutoscalingLimits() { - if (autoscalingLimitsBuilder_ == null) { - autoscalingLimits_ = null; - onChanged(); - } else { - autoscalingLimits_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + autoscalingLimits_ = null; + if (autoscalingLimitsBuilder_ != null) { + autoscalingLimitsBuilder_.dispose(); autoscalingLimitsBuilder_ = null; } - + onChanged(); return this; } /** @@ -1225,7 +1257,7 @@ public Builder clearAutoscalingLimits() { *
    */ public com.google.bigtable.admin.v2.AutoscalingLimits.Builder getAutoscalingLimitsBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getAutoscalingLimitsFieldBuilder().getBuilder(); } @@ -1298,7 +1330,7 @@ public com.google.bigtable.admin.v2.AutoscalingLimits.Builder getAutoscalingLimi * @return Whether the autoscalingTargets field is set. */ public boolean hasAutoscalingTargets() { - return autoscalingTargetsBuilder_ != null || autoscalingTargets_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -1339,11 +1371,11 @@ public Builder setAutoscalingTargets(com.google.bigtable.admin.v2.AutoscalingTar throw new NullPointerException(); } autoscalingTargets_ = value; - onChanged(); } else { autoscalingTargetsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -1361,11 +1393,11 @@ public Builder setAutoscalingTargets( com.google.bigtable.admin.v2.AutoscalingTargets.Builder builderForValue) { if (autoscalingTargetsBuilder_ == null) { autoscalingTargets_ = builderForValue.build(); - onChanged(); } else { autoscalingTargetsBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -1382,19 +1414,21 @@ public Builder setAutoscalingTargets( public Builder mergeAutoscalingTargets( com.google.bigtable.admin.v2.AutoscalingTargets value) { if (autoscalingTargetsBuilder_ == null) { - if (autoscalingTargets_ != null) { - autoscalingTargets_ = - com.google.bigtable.admin.v2.AutoscalingTargets.newBuilder(autoscalingTargets_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000002) != 0) + && autoscalingTargets_ != null + && autoscalingTargets_ + != com.google.bigtable.admin.v2.AutoscalingTargets.getDefaultInstance()) { + getAutoscalingTargetsBuilder().mergeFrom(value); } else { autoscalingTargets_ = value; } - onChanged(); } else { autoscalingTargetsBuilder_.mergeFrom(value); } - + if (autoscalingTargets_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } /** @@ -1409,14 +1443,13 @@ public Builder mergeAutoscalingTargets( * */ public Builder clearAutoscalingTargets() { - if (autoscalingTargetsBuilder_ == null) { - autoscalingTargets_ = null; - onChanged(); - } else { - autoscalingTargets_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + autoscalingTargets_ = null; + if (autoscalingTargetsBuilder_ != null) { + autoscalingTargetsBuilder_.dispose(); autoscalingTargetsBuilder_ = null; } - + onChanged(); return this; } /** @@ -1432,7 +1465,7 @@ public Builder clearAutoscalingTargets() { */ public com.google.bigtable.admin.v2.AutoscalingTargets.Builder getAutoscalingTargetsBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getAutoscalingTargetsFieldBuilder().getBuilder(); } @@ -1520,7 +1553,19 @@ public ClusterAutoscalingConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClusterAutoscalingConfig(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(); } }; @@ -1614,66 +1659,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ClusterConfig(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private ClusterConfig( - 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.ClusterAutoscalingConfig.Builder subBuilder = - null; - if (clusterAutoscalingConfig_ != null) { - subBuilder = clusterAutoscalingConfig_.toBuilder(); - } - clusterAutoscalingConfig_ = - input.readMessage( - com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(clusterAutoscalingConfig_); - clusterAutoscalingConfig_ = 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_ClusterConfig_descriptor; @@ -1689,6 +1674,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; /** @@ -1706,7 +1692,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasClusterAutoscalingConfig() { - return clusterAutoscalingConfig_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -1742,7 +1728,9 @@ public boolean hasClusterAutoscalingConfig() { @java.lang.Override public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfigOrBuilder getClusterAutoscalingConfigOrBuilder() { - return getClusterAutoscalingConfig(); + return clusterAutoscalingConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.getDefaultInstance() + : clusterAutoscalingConfig_; } private byte memoizedIsInitialized = -1; @@ -1759,10 +1747,10 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (clusterAutoscalingConfig_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getClusterAutoscalingConfig()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1771,12 +1759,12 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (clusterAutoscalingConfig_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 1, getClusterAutoscalingConfig()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1797,7 +1785,7 @@ public boolean equals(final java.lang.Object obj) { if (!getClusterAutoscalingConfig().equals(other.getClusterAutoscalingConfig())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1812,7 +1800,7 @@ public int hashCode() { hash = (37 * hash) + CLUSTER_AUTOSCALING_CONFIG_FIELD_NUMBER; hash = (53 * hash) + getClusterAutoscalingConfig().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1953,16 +1941,18 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterAutoscalingConfigFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (clusterAutoscalingConfigBuilder_ == null) { - clusterAutoscalingConfig_ = null; - } else { - clusterAutoscalingConfig_ = null; + bitField0_ = 0; + clusterAutoscalingConfig_ = null; + if (clusterAutoscalingConfigBuilder_ != null) { + clusterAutoscalingConfigBuilder_.dispose(); clusterAutoscalingConfigBuilder_ = null; } return this; @@ -1992,15 +1982,26 @@ public com.google.bigtable.admin.v2.Cluster.ClusterConfig build() { 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 (clusterAutoscalingConfigBuilder_ == null) { - result.clusterAutoscalingConfig_ = clusterAutoscalingConfig_; - } else { - result.clusterAutoscalingConfig_ = clusterAutoscalingConfigBuilder_.build(); + 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 clone() { return super.clone(); @@ -2052,7 +2053,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster.ClusterConfig othe if (other.hasClusterAutoscalingConfig()) { mergeClusterAutoscalingConfig(other.getClusterAutoscalingConfig()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2067,21 +2068,43 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.Cluster.ClusterConfig 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( + getClusterAutoscalingConfigFieldBuilder().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.admin.v2.Cluster.ClusterConfig) 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.ClusterAutoscalingConfig clusterAutoscalingConfig_; private com.google.protobuf.SingleFieldBuilderV3< @@ -2103,7 +2126,7 @@ public Builder mergeFrom( * @return Whether the clusterAutoscalingConfig field is set. */ public boolean hasClusterAutoscalingConfig() { - return clusterAutoscalingConfigBuilder_ != null || clusterAutoscalingConfig_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -2146,11 +2169,11 @@ public Builder setClusterAutoscalingConfig( throw new NullPointerException(); } clusterAutoscalingConfig_ = value; - onChanged(); } else { clusterAutoscalingConfigBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -2168,11 +2191,11 @@ public Builder setClusterAutoscalingConfig( com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder builderForValue) { if (clusterAutoscalingConfigBuilder_ == null) { clusterAutoscalingConfig_ = builderForValue.build(); - onChanged(); } else { clusterAutoscalingConfigBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -2189,20 +2212,22 @@ public Builder setClusterAutoscalingConfig( public Builder mergeClusterAutoscalingConfig( com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig value) { if (clusterAutoscalingConfigBuilder_ == null) { - if (clusterAutoscalingConfig_ != null) { - clusterAutoscalingConfig_ = - com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.newBuilder( - clusterAutoscalingConfig_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000001) != 0) + && clusterAutoscalingConfig_ != null + && clusterAutoscalingConfig_ + != com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig + .getDefaultInstance()) { + getClusterAutoscalingConfigBuilder().mergeFrom(value); } else { clusterAutoscalingConfig_ = value; } - onChanged(); } else { clusterAutoscalingConfigBuilder_.mergeFrom(value); } - + if (clusterAutoscalingConfig_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } /** @@ -2217,14 +2242,13 @@ public Builder mergeClusterAutoscalingConfig( * */ public Builder clearClusterAutoscalingConfig() { - if (clusterAutoscalingConfigBuilder_ == null) { - clusterAutoscalingConfig_ = null; - onChanged(); - } else { - clusterAutoscalingConfig_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + clusterAutoscalingConfig_ = null; + if (clusterAutoscalingConfigBuilder_ != null) { + clusterAutoscalingConfigBuilder_.dispose(); clusterAutoscalingConfigBuilder_ = null; } - + onChanged(); return this; } /** @@ -2240,7 +2264,7 @@ public Builder clearClusterAutoscalingConfig() { */ public com.google.bigtable.admin.v2.Cluster.ClusterAutoscalingConfig.Builder getClusterAutoscalingConfigBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getClusterAutoscalingConfigFieldBuilder().getBuilder(); } @@ -2326,7 +2350,19 @@ public ClusterConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ClusterConfig(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(); } }; @@ -2361,7 +2397,9 @@ public interface EncryptionConfigOrBuilder * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` *
    * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2380,7 +2418,9 @@ public interface EncryptionConfigOrBuilder * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` *
    * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2419,55 +2459,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new EncryptionConfig(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - 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; - } - } - } - } 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_EncryptionConfig_descriptor; @@ -2484,7 +2475,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object kmsKeyName_; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; /** * * @@ -2496,7 +2489,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2526,7 +2521,9 @@ public java.lang.String getKmsKeyName() { * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2563,7 +2560,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2575,7 +2572,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -2592,7 +2589,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) obj; if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -2605,7 +2602,7 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; hash = (53 * hash) + getKmsKeyName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -2738,24 +2735,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.admin.v2.Cluster.EncryptionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + private Builder() {} - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; kmsKeyName_ = ""; - return this; } @@ -2783,11 +2773,20 @@ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig build() { 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_; + 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 clone() { return super.clone(); @@ -2838,9 +2837,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster.EncryptionConfig o return this; if (!other.getKmsKeyName().isEmpty()) { kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000001; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2855,21 +2855,42 @@ 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: + { + 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) { - parsedMessage = - (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private java.lang.Object kmsKeyName_ = ""; /** * @@ -2882,7 +2903,9 @@ public Builder mergeFrom( * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2911,7 +2934,9 @@ public java.lang.String getKmsKeyName() { * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2940,7 +2965,9 @@ public com.google.protobuf.ByteString getKmsKeyNameBytes() { * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2952,8 +2979,8 @@ public Builder setKmsKeyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - kmsKeyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2968,7 +2995,9 @@ public Builder setKmsKeyName(java.lang.String value) { * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -2976,8 +3005,8 @@ public Builder setKmsKeyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearKmsKeyName() { - kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -2992,7 +3021,9 @@ public Builder clearKmsKeyName() { * `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. + * 3) All clusters within an instance must use the same CMEK key. + * Values are of the form + * `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` * * * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } @@ -3005,8 +3036,8 @@ public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - kmsKeyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -3044,7 +3075,19 @@ public EncryptionConfig 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(); } }; @@ -3063,7 +3106,10 @@ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstanceF } } + private int bitField0_; private int configCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object config_; public enum ConfigCase @@ -3108,7 +3154,9 @@ public ConfigCase getConfigCase() { } public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; /** * * @@ -3117,7 +3165,7 @@ public ConfigCase getConfigCase() { * `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. */ @@ -3141,7 +3189,7 @@ public java.lang.String getName() { * `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. */ @@ -3159,19 +3207,22 @@ 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. */ @@ -3191,14 +3242,15 @@ public 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. */ @@ -3216,12 +3268,12 @@ 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.
        * 
    * * @@ -3238,7 +3290,7 @@ public int getStateValue() { * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -3249,14 +3301,13 @@ 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; /** * * @@ -3274,6 +3325,47 @@ 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; /** * @@ -3326,17 +3418,18 @@ public com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder getClusterCon } 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. */ @@ -3348,20 +3441,20 @@ public 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. */ @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; } @@ -3382,7 +3475,7 @@ public com.google.bigtable.admin.v2.StorageType getDefaultStorageType() { */ @java.lang.Override public boolean hasEncryptionConfig() { - return encryptionConfig_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -3417,7 +3510,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; @@ -3450,13 +3545,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()); } if (configCase_ == 7) { output.writeMessage(7, (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_); } - unknownFields.writeTo(output); + if (nodeScalingFactor_ + != com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.NODE_SCALING_FACTOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, nodeScalingFactor_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3481,7 +3581,7 @@ 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()); } if (configCase_ == 7) { @@ -3489,7 +3589,12 @@ public int getSerializedSize() { com.google.protobuf.CodedOutputStream.computeMessageSize( 7, (com.google.bigtable.admin.v2.Cluster.ClusterConfig) config_); } - size += unknownFields.getSerializedSize(); + 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; } @@ -3508,6 +3613,7 @@ 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()) { @@ -3521,7 +3627,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; } @@ -3540,6 +3646,8 @@ 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()) { @@ -3554,7 +3662,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3694,26 +3802,27 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncryptionConfigFieldBuilder(); + } } @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; @@ -3744,28 +3853,51 @@ 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_; - if (configCase_ == 7) { - if (clusterConfigBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = clusterConfigBuilder_.build(); - } - } - result.defaultStorageType_ = defaultStorageType_; - if (encryptionConfigBuilder_ == null) { - result.encryptionConfig_ = encryptionConfig_; - } else { - result.encryptionConfig_ = encryptionConfigBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.configCase_ = configCase_; + 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 clone() { return super.clone(); @@ -3813,10 +3945,12 @@ 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) { @@ -3825,6 +3959,9 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster other) { if (other.getServeNodes() != 0) { setServeNodes(other.getServeNodes()); } + if (other.nodeScalingFactor_ != 0) { + setNodeScalingFactorValue(other.getNodeScalingFactorValue()); + } if (other.defaultStorageType_ != 0) { setDefaultStorageTypeValue(other.getDefaultStorageTypeValue()); } @@ -3842,7 +3979,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3857,17 +3994,80 @@ 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; + 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: + { + 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( + getEncryptionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 50 + case 58: + { + input.readMessage(getClusterConfigFieldBuilder().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) { - parsedMessage = (com.google.bigtable.admin.v2.Cluster) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -3885,6 +4085,8 @@ public Builder clearConfig() { return this; } + private int bitField0_; + private java.lang.Object name_ = ""; /** * @@ -3894,7 +4096,7 @@ public Builder clearConfig() { * `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. */ @@ -3917,7 +4119,7 @@ public java.lang.String getName() { * `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. */ @@ -3940,7 +4142,7 @@ public com.google.protobuf.ByteString getNameBytes() { * `projects/{project}/instances/{instance}/clusters/[a-z][-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. @@ -3949,8 +4151,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -3962,13 +4164,13 @@ public Builder setName(java.lang.String value) { * `projects/{project}/instances/{instance}/clusters/[a-z][-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; } @@ -3980,7 +4182,7 @@ public Builder clearName() { * `projects/{project}/instances/{instance}/clusters/[a-z][-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. @@ -3990,8 +4192,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -4001,14 +4203,15 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { * * *
    -     * (`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. */ @@ -4027,14 +4230,15 @@ public 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. */ @@ -4053,14 +4257,15 @@ public com.google.protobuf.ByteString getLocationBytes() { * * *
    -     * (`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) = { ... } + * * * @param value The location to set. * @return This builder for chaining. @@ -4069,8 +4274,8 @@ public Builder setLocation(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - location_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -4078,20 +4283,21 @@ public Builder setLocation(java.lang.String value) { * * *
    -     * (`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 This builder for chaining. */ public Builder clearLocation() { - location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -4099,14 +4305,15 @@ public Builder clearLocation() { * * *
    -     * (`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) = { ... } + * * * @param value The bytes for location to set. * @return This builder for chaining. @@ -4116,8 +4323,8 @@ public Builder setLocationBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - location_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -4127,7 +4334,7 @@ public Builder setLocationBytes(com.google.protobuf.ByteString value) { * * *
    -     * The current state of the cluster.
    +     * Output only. The current state of the cluster.
          * 
    * * @@ -4144,7 +4351,7 @@ public int getStateValue() { * * *
    -     * The current state of the cluster.
    +     * Output only. The current state of the cluster.
          * 
    * * @@ -4155,8 +4362,8 @@ public int getStateValue() { * @return This builder for chaining. */ public Builder setStateValue(int value) { - state_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -4164,7 +4371,7 @@ public Builder setStateValue(int value) { * * *
    -     * The current state of the cluster.
    +     * Output only. The current state of the cluster.
          * 
    * * @@ -4175,16 +4382,15 @@ public Builder setStateValue(int value) { */ @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; } /** * * *
    -     * The current state of the cluster.
    +     * Output only. The current state of the cluster.
          * 
    * * @@ -4198,7 +4404,7 @@ 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; @@ -4207,7 +4413,7 @@ public Builder setState(com.google.bigtable.admin.v2.Cluster.State value) { * * *
    -     * The current state of the cluster.
    +     * Output only. The current state of the cluster.
          * 
    * * @@ -4217,7 +4423,7 @@ public Builder setState(com.google.bigtable.admin.v2.Cluster.State value) { * @return This builder for chaining. */ public Builder clearState() { - + bitField0_ = (bitField0_ & ~0x00000004); state_ = 0; onChanged(); return this; @@ -4256,6 +4462,7 @@ public int getServeNodes() { public Builder setServeNodes(int value) { serveNodes_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -4272,12 +4479,115 @@ public Builder setServeNodes(int value) { * @return This builder for chaining. */ public Builder clearServeNodes() { - + bitField0_ = (bitField0_ & ~0x00000008); serveNodes_ = 0; onChanged(); return this; } + private int nodeScalingFactor_ = 0; + /** + * + * + *
    +     * Immutable. The node scaling factor of this cluster.
    +     * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeScalingFactor. + */ + @java.lang.Override + public int getNodeScalingFactorValue() { + return nodeScalingFactor_; + } + /** + * + * + *
    +     * Immutable. The node scaling factor of this cluster.
    +     * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for nodeScalingFactor to set. + * @return This builder for chaining. + */ + public Builder setNodeScalingFactorValue(int value) { + nodeScalingFactor_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
    +     * Immutable. The node scaling factor of this cluster.
    +     * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeScalingFactor. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.NodeScalingFactor getNodeScalingFactor() { + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor result = + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.forNumber(nodeScalingFactor_); + return result == null + ? com.google.bigtable.admin.v2.Cluster.NodeScalingFactor.UNRECOGNIZED + : result; + } + /** + * + * + *
    +     * Immutable. The node scaling factor of this cluster.
    +     * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nodeScalingFactor to set. + * @return This builder for chaining. + */ + public Builder setNodeScalingFactor( + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + nodeScalingFactor_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
    +     * Immutable. The node scaling factor of this cluster.
    +     * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNodeScalingFactor() { + bitField0_ = (bitField0_ & ~0x00000010); + nodeScalingFactor_ = 0; + onChanged(); + return this; + } + private com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.Cluster.ClusterConfig, com.google.bigtable.admin.v2.Cluster.ClusterConfig.Builder, @@ -4390,8 +4700,9 @@ public Builder mergeClusterConfig(com.google.bigtable.admin.v2.Cluster.ClusterCo } else { if (configCase_ == 7) { clusterConfigBuilder_.mergeFrom(value); + } else { + clusterConfigBuilder_.setMessage(value); } - clusterConfigBuilder_.setMessage(value); } configCase_ = 7; return this; @@ -4483,7 +4794,6 @@ public com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder getClusterCon } configCase_ = 7; onChanged(); - ; return clusterConfigBuilder_; } @@ -4492,12 +4802,13 @@ public com.google.bigtable.admin.v2.Cluster.ClusterConfigOrBuilder getClusterCon * * *
    -     * (`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. */ @@ -4509,19 +4820,20 @@ public 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]; + * * * @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; } @@ -4529,32 +4841,33 @@ public Builder setDefaultStorageTypeValue(int value) { * * *
    -     * (`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. @@ -4563,7 +4876,7 @@ public Builder setDefaultStorageType(com.google.bigtable.admin.v2.StorageType va if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000040; defaultStorageType_ = value.getNumber(); onChanged(); return this; @@ -4572,17 +4885,18 @@ public Builder setDefaultStorageType(com.google.bigtable.admin.v2.StorageType va * * *
    -     * (`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; @@ -4608,7 +4922,7 @@ public Builder clearDefaultStorageType() { * @return Whether the encryptionConfig field is set. */ public boolean hasEncryptionConfig() { - return encryptionConfigBuilder_ != null || encryptionConfig_ != null; + return ((bitField0_ & 0x00000080) != 0); } /** * @@ -4650,11 +4964,11 @@ public Builder setEncryptionConfig( throw new NullPointerException(); } encryptionConfig_ = value; - onChanged(); } else { encryptionConfigBuilder_.setMessage(value); } - + bitField0_ |= 0x00000080; + onChanged(); return this; } /** @@ -4672,11 +4986,11 @@ 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; } /** @@ -4693,19 +5007,21 @@ 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; } /** @@ -4720,14 +5036,13 @@ 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; } /** @@ -4743,7 +5058,7 @@ public Builder clearEncryptionConfig() { */ public com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder getEncryptionConfigBuilder() { - + bitField0_ |= 0x00000080; onChanged(); return getEncryptionConfigFieldBuilder().getBuilder(); } @@ -4828,7 +5143,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 006e1bbb0b..1b19c7d04f 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 2021 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. @@ -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) 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 cdebe46b9c..fff1fad9fb 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ClusterOrBuilder @@ -31,7 +32,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 name. */ @@ -44,7 +45,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,14 +55,15 @@ 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. */ @@ -70,14 +72,15 @@ 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 bytes for location. */ @@ -87,7 +90,7 @@ public interface ClusterOrBuilder * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -101,7 +104,7 @@ public interface ClusterOrBuilder * * *
    -   * The current state of the cluster.
    +   * Output only. The current state of the cluster.
        * 
    * * @@ -126,6 +129,35 @@ public interface ClusterOrBuilder */ int getServeNodes(); + /** + * + * + *
    +   * Immutable. The node scaling factor of this cluster.
    +   * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeScalingFactor. + */ + int getNodeScalingFactorValue(); + /** + * + * + *
    +   * Immutable. The node scaling factor of this cluster.
    +   * 
    + * + * + * .google.bigtable.admin.v2.Cluster.NodeScalingFactor node_scaling_factor = 9 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeScalingFactor. + */ + com.google.bigtable.admin.v2.Cluster.NodeScalingFactor getNodeScalingFactor(); + /** * * @@ -165,12 +197,13 @@ public interface ClusterOrBuilder * * *
    -   * (`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. */ @@ -179,12 +212,13 @@ public interface ClusterOrBuilder * * *
    -   * (`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. */ @@ -231,5 +265,5 @@ public interface ClusterOrBuilder */ com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); - public com.google.bigtable.admin.v2.Cluster.ConfigCase getConfigCase(); + 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..81095bf614 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,64 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ColumnFamily(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.TableProto .internal_static_google_bigtable_admin_v2_ColumnFamily_descriptor; @@ -118,6 +61,7 @@ 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_; /** @@ -126,6 +70,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
        * 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,7 +82,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        */
       @java.lang.Override
       public boolean hasGcRule() {
    -    return gcRule_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
       /**
        *
    @@ -145,6 +90,7 @@ public 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.
    @@ -164,6 +110,7 @@ public 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.
    @@ -173,7 +120,80 @@ 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 +210,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 +225,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 +251,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 +270,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; } @@ -379,18 +413,26 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getGcRuleFieldBuilder(); + getValueTypeFieldBuilder(); + } } @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,15 +460,27 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.ColumnFamily result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.gcRule_ = gcRuleBuilder_ == null ? gcRule_ : gcRuleBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.valueType_ = valueTypeBuilder_ == null ? valueType_ : valueTypeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -475,7 +529,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,20 +547,48 @@ 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(getGcRuleFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + input.readMessage(getValueTypeFieldBuilder().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< com.google.bigtable.admin.v2.GcRule, @@ -516,6 +601,7 @@ public Builder mergeFrom( *
          * 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,7 +612,7 @@ public Builder mergeFrom(
          * @return Whether the gcRule field is set.
          */
         public boolean hasGcRule() {
    -      return gcRuleBuilder_ != null || gcRule_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
         /**
          *
    @@ -534,6 +620,7 @@ public 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.
    @@ -556,6 +643,7 @@ public 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.
    @@ -569,11 +657,11 @@ 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;
         }
         /**
    @@ -582,6 +670,7 @@ public Builder setGcRule(com.google.bigtable.admin.v2.GcRule value) {
          * 
          * 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,11 +681,11 @@ 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;
         }
         /**
    @@ -605,6 +694,7 @@ public Builder setGcRule(com.google.bigtable.admin.v2.GcRule.Builder builderForV
          * 
          * 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,19 +704,20 @@ 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;
         }
         /**
    @@ -635,6 +726,7 @@ public Builder mergeGcRule(com.google.bigtable.admin.v2.GcRule value) {
          * 
          * 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,14 +735,13 @@ 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;
         }
         /**
    @@ -659,6 +750,7 @@ public Builder clearGcRule() {
          * 
          * 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,7 +759,7 @@ 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();
         }
    @@ -677,6 +769,7 @@ public com.google.bigtable.admin.v2.GcRule.Builder getGcRuleBuilder() {
          * 
          * 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.
    @@ -697,6 +790,7 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() {
          * 
          * 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.
    @@ -721,6 +815,272 @@ public com.google.bigtable.admin.v2.GcRuleOrBuilder getGcRuleOrBuilder() {
           return gcRuleBuilder_;
         }
     
    +    private com.google.bigtable.admin.v2.Type valueType_;
    +    private com.google.protobuf.SingleFieldBuilderV3<
    +            com.google.bigtable.admin.v2.Type,
    +            com.google.bigtable.admin.v2.Type.Builder,
    +            com.google.bigtable.admin.v2.TypeOrBuilder>
    +        valueTypeBuilder_;
    +    /**
    +     *
    +     *
    +     * 
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return Whether the valueType field is set. + */ + public boolean hasValueType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + * + * @return The valueType. + */ + public com.google.bigtable.admin.v2.Type getValueType() { + if (valueTypeBuilder_ == null) { + return valueType_ == null + ? com.google.bigtable.admin.v2.Type.getDefaultInstance() + : valueType_; + } else { + return valueTypeBuilder_.getMessage(); + } + } + /** + * + * + *
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder setValueType(com.google.bigtable.admin.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + valueType_ = value; + } else { + valueTypeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder setValueType(com.google.bigtable.admin.v2.Type.Builder builderForValue) { + if (valueTypeBuilder_ == null) { + valueType_ = builderForValue.build(); + } else { + valueTypeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder mergeValueType(com.google.bigtable.admin.v2.Type value) { + if (valueTypeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && valueType_ != null + && valueType_ != com.google.bigtable.admin.v2.Type.getDefaultInstance()) { + getValueTypeBuilder().mergeFrom(value); + } else { + valueType_ = value; + } + } else { + valueTypeBuilder_.mergeFrom(value); + } + if (valueType_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public Builder clearValueType() { + bitField0_ = (bitField0_ & ~0x00000002); + valueType_ = null; + if (valueTypeBuilder_ != null) { + valueTypeBuilder_.dispose(); + valueTypeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
    +     * The type of data stored in each of this family's cell values, including its
    +     * full encoding. If omitted, the family only serves raw untyped bytes.
    +     *
    +     * For now, only the `Aggregate` type is supported.
    +     *
    +     * `Aggregate` can only be set at family creation and is immutable afterwards.
    +     *
    +     *
    +     * If `value_type` is `Aggregate`, written data must be compatible with:
    +     *  * `value_type.input_type` for `AddInput` mutations
    +     * 
    + * + * .google.bigtable.admin.v2.Type value_type = 3; + */ + public com.google.bigtable.admin.v2.Type.Builder getValueTypeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getValueTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getValueTypeFieldBuilder() { + if (valueTypeBuilder_ == null) { + valueTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -753,7 +1113,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..0a12edd982 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ColumnFamilyOrBuilder @@ -29,6 +30,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.
    @@ -45,6 +47,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.
    @@ -61,6 +64,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.
    @@ -69,4 +73,66 @@ 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 0f02931c76..2fe819ff7c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public final class CommonProto { @@ -42,25 +43,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n%google/bigtable/admin/v2/common.proto\022" + "\030google.bigtable.admin.v2\032\037google/protob" - + "uf/timestamp.proto\032\034google/api/annotatio" - + "ns.proto\"\213\001\n\021OperationProgress\022\030\n\020progre" - + "ss_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.g" - + "oogle.protobuf.Timestamp\022,\n\010end_time\030\003 \001" - + "(\0132\032.google.protobuf.Timestamp*=\n\013Storag" - + "eType\022\034\n\030STORAGE_TYPE_UNSPECIFIED\020\000\022\007\n\003S" - + "SD\020\001\022\007\n\003HDD\020\002B\323\001\n\034com.google.bigtable.ad" - + "min.v2B\013CommonProtoP\001Z=google.golang.org" - + "/genproto/googleapis/bigtable/admin/v2;a" - + "dmin\252\002\036Google.Cloud.Bigtable.Admin.V2\312\002\036" - + "Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Google:" - + ":Cloud::Bigtable::Admin::V2b\006proto3" + + "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\316\001\n\034com.google.b" + + "igtable.admin.v2B\013CommonProtoP\001Z8cloud.g" + + "oogle.com/go/bigtable/admin/apiv2/adminp" + + "b;adminpb\252\002\036Google.Cloud.Bigtable.Admin." + + "V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Go" + + "ogle::Cloud::Bigtable::Admin::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_bigtable_admin_v2_OperationProgress_descriptor = getDescriptor().getMessageTypes().get(0); @@ -71,7 +70,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ProgressPercent", "StartTime", "EndTime", }); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) 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..4e3ef5ae4a --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadata.java @@ -0,0 +1,1216 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class CopyBackupMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CopyBackupMetadata) + CopyBackupMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CopyBackupMetadata.newBuilder() to construct. + private CopyBackupMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CopyBackupMetadata() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CopyBackupMetadata(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSourceBackupInfoFieldBuilder(); + getProgressFieldBuilder(); + } + } + + @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 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.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( + getSourceBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getProgressFieldBuilder().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.SingleFieldBuilderV3< + 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 getSourceBackupInfoFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.BackupInfo, + com.google.bigtable.admin.v2.BackupInfo.Builder, + com.google.bigtable.admin.v2.BackupInfoOrBuilder> + getSourceBackupInfoFieldBuilder() { + if (sourceBackupInfoBuilder_ == null) { + sourceBackupInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getProgressFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.OperationProgress, + com.google.bigtable.admin.v2.OperationProgress.Builder, + com.google.bigtable.admin.v2.OperationProgressOrBuilder> + getProgressFieldBuilder() { + if (progressBuilder_ == null) { + progressBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..184ff1434d --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupMetadataOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..1727f002fe --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequest.java @@ -0,0 +1,1444 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * The request for
    + * [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.CopyBackupRequest} + */ +public final class CopyBackupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CopyBackupRequest) + CopyBackupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CopyBackupRequest.newBuilder() to construct. + private CopyBackupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CopyBackupRequest() { + parent_ = ""; + backupId_ = ""; + sourceBackup_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CopyBackupRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceBackup_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, backupId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceBackup_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExpireTimeFieldBuilder(); + } + } + + @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 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.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(getExpireTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 getExpireTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getExpireTimeFieldBuilder() { + if (expireTimeBuilder_ == null) { + expireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getExpireTime(), getParentForChildren(), isClean()); + expireTime_ = null; + } + return expireTimeBuilder_; + } + + @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.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..31711f4737 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CopyBackupRequestOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 a4fad3fe82..25295e84c9 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -48,83 +49,6 @@ 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; @@ -140,15 +64,17 @@ 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}`.
        * 
    * * @@ -173,9 +99,8 @@ public 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}`.
        * 
    * * @@ -198,13 +123,15 @@ 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`.
        * 
    * @@ -228,8 +155,8 @@ public 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`.
        * 
    * @@ -268,7 +195,7 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { */ @java.lang.Override public boolean hasAppProfile() { - return appProfile_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -304,11 +231,13 @@ 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; /** * * @@ -345,13 +274,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.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 @@ -366,13 +295,13 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.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 +324,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 +345,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; } @@ -555,24 +484,23 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAppProfileFieldBuilder(); + } } @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,18 +528,32 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateAppProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.appProfileId_ = appProfileId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.appProfile_ = appProfileBuilder_ == null ? appProfile_ : appProfileBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -660,10 +602,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 +616,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 +631,67 @@ 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(getAppProfileFieldBuilder().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}`.
          * 
    * * @@ -733,9 +715,8 @@ public 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}`.
          * 
    * * @@ -759,9 +740,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * 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,8 +755,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -784,9 +764,8 @@ public Builder setParent(java.lang.String value) { * * *
    -     * 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,8 +775,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -805,9 +784,8 @@ public Builder clearParent() { * * *
    -     * 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,8 +800,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -833,8 +811,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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`.
          * 
    * @@ -857,8 +835,8 @@ public 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`.
          * 
    * @@ -881,8 +859,8 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { * * *
    -     * 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,8 +873,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -904,8 +882,8 @@ public Builder setAppProfileId(java.lang.String value) { * * *
    -     * 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,8 +892,8 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -923,8 +901,8 @@ public Builder clearAppProfileId() { * * *
    -     * 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,8 +916,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -965,7 +943,7 @@ 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); } /** * @@ -1008,11 +986,11 @@ 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,11 +1008,11 @@ 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,19 +1029,20 @@ 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,14 +1058,13 @@ 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,7 +1080,7 @@ public Builder clearAppProfile() { *
    */ public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfileBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getAppProfileFieldBuilder().getBuilder(); } @@ -1187,6 +1165,7 @@ public boolean getIgnoreWarnings() { public Builder setIgnoreWarnings(boolean value) { ignoreWarnings_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1202,7 +1181,7 @@ public Builder setIgnoreWarnings(boolean value) { * @return This builder for chaining. */ public Builder clearIgnoreWarnings() { - + bitField0_ = (bitField0_ & ~0x00000008); ignoreWarnings_ = false; onChanged(); return this; @@ -1240,7 +1219,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..2ca9632a31 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateAppProfileRequestOrBuilder @@ -27,9 +28,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}`.
        * 
    * * @@ -43,9 +43,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}`.
        * 
    * * @@ -60,8 +59,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`.
        * 
    * @@ -74,8 +73,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`.
        * 
    * 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..6865802cdb --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadata.java @@ -0,0 +1,1259 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * The metadata for the Operation returned by CreateAuthorizedView.
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.CreateAuthorizedViewMetadata} + */ +public final class CreateAuthorizedViewMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateAuthorizedViewMetadata) + CreateAuthorizedViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAuthorizedViewMetadata.newBuilder() to construct. + private CreateAuthorizedViewMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAuthorizedViewMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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 CreateInstance 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 CreateInstance 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 CreateInstance 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOriginalRequestFieldBuilder(); + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + } + } + + @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 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.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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getFinishTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 CreateInstance 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 CreateInstance 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 CreateInstance 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 CreateInstance 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 CreateInstance 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 CreateInstance 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 CreateInstance operation.
    +     * 
    + * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + public com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder + getOriginalRequestBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getOriginalRequestFieldBuilder().getBuilder(); + } + /** + * + * + *
    +     * The request that prompted the initiation of this CreateInstance 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 CreateInstance operation.
    +     * 
    + * + * .google.bigtable.admin.v2.CreateAuthorizedViewRequest original_request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.CreateAuthorizedViewRequestOrBuilder> + getOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getRequestTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getFinishTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + 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.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..ee06fccde7 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewMetadataOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 CreateInstance 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 CreateInstance 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 CreateInstance 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..9514e9f1ad --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequest.java @@ -0,0 +1,1165 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * The request for
    + * [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.CreateAuthorizedViewRequest} + */ +public final class CreateAuthorizedViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateAuthorizedViewRequest) + CreateAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAuthorizedViewRequest.newBuilder() to construct. + private CreateAuthorizedViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAuthorizedViewRequest() { + parent_ = ""; + authorizedViewId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateAuthorizedViewRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewId_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewId_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAuthorizedViewFieldBuilder(); + } + } + + @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 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.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(getAuthorizedViewFieldBuilder().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.SingleFieldBuilderV3< + 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 getAuthorizedViewFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + getAuthorizedViewFieldBuilder() { + if (authorizedViewBuilder_ == null) { + authorizedViewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..5a6fbf0548 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 3bbebb9b36..d44914b5f2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -49,92 +50,6 @@ 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; @@ -150,8 +65,11 @@ 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_ = ""; /** * * @@ -200,7 +118,9 @@ 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_ = ""; /** * * @@ -263,7 +183,7 @@ public com.google.protobuf.ByteString getSourceTableBytes() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -291,7 +211,7 @@ 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; @@ -309,7 +229,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -337,7 +257,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; @@ -360,13 +280,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceTable_)) { com.google.protobuf.GeneratedMessageV3.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 @@ -381,13 +301,13 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceTable_)) { size += com.google.protobuf.GeneratedMessageV3.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 +333,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 +356,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; } @@ -576,26 +496,26 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } } @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,22 +545,33 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateBackupMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceTable_ = sourceTable_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -689,10 +620,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 +634,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,21 +649,60 @@ 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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getEndTimeFieldBuilder().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_ = ""; /** * @@ -792,8 +764,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -809,8 +781,8 @@ 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,8 +803,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -898,8 +870,8 @@ public Builder setSourceTable(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceTable_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -915,8 +887,8 @@ 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,8 +909,8 @@ public Builder setSourceTableBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sourceTable_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -961,7 +933,7 @@ 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); } /** * @@ -996,11 +968,11 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1015,11 +987,11 @@ 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,17 +1005,20 @@ 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,14 +1031,13 @@ 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,7 +1050,7 @@ public Builder clearStartTime() { * .google.protobuf.Timestamp start_time = 3; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getStartTimeFieldBuilder().getBuilder(); } @@ -1140,7 +1114,7 @@ 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); } /** * @@ -1175,11 +1149,11 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } /** @@ -1194,11 +1168,11 @@ 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,17 +1186,20 @@ 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,14 +1212,13 @@ 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,7 +1231,7 @@ public Builder clearEndTime() { * .google.protobuf.Timestamp end_time = 4; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000008; onChanged(); return getEndTimeFieldBuilder().getBuilder(); } @@ -1333,7 +1309,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..d4b3d11fc9 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateBackupMetadataOrBuilder 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 041b5c2921..83eda80a15 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 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. @@ -16,13 +16,15 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** * * *
    - * 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} @@ -48,78 +50,6 @@ 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; @@ -135,8 +65,11 @@ 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_ = ""; /** * * @@ -193,7 +126,9 @@ 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_ = ""; /** * * @@ -267,7 +202,7 @@ public com.google.protobuf.ByteString getBackupIdBytes() { */ @java.lang.Override public boolean hasBackup() { - return backup_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -297,7 +232,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; @@ -320,10 +255,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, backupId_); } - if (backup_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getBackup()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -338,10 +273,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(backupId_)) { size += com.google.protobuf.GeneratedMessageV3.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 +298,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 +317,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; } @@ -486,7 +421,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
    -   * 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} @@ -521,20 +457,20 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupFieldBuilder(); + } } @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,17 +500,29 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.backupId_ = backupId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -623,16 +571,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,20 +597,54 @@ 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(getBackupFieldBuilder().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_ = ""; /** * @@ -734,8 +718,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -755,8 +739,8 @@ 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,8 +765,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -863,8 +847,8 @@ public Builder setBackupId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - backupId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -885,8 +869,8 @@ 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,8 +896,8 @@ public Builder setBackupIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - backupId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -937,7 +921,7 @@ 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); } /** * @@ -974,11 +958,11 @@ 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,11 +978,11 @@ 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,19 +997,20 @@ 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,14 +1024,13 @@ 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,7 +1044,7 @@ public Builder clearBackup() { *
    */ public com.google.bigtable.admin.v2.Backup.Builder getBackupBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getBackupFieldBuilder().getBuilder(); } @@ -1140,7 +1124,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..50aab918fe 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateBackupRequestOrBuilder 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..7b0940d10d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,110 +46,1016 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new 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 - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetTables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } } - 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) { + @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); + } + + 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) + TableProgressOrBuilder { + private static final long serialVersionUID = 0L; + // Use TableProgress.newBuilder() to construct. + private TableProgress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TableProgress() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TableProgress(); + } + + 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.GeneratedMessageV3.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), + ; + + /** 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 final 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; } - } 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(); + /** + * .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; + } + + @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.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,7 +1071,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -194,7 +1101,9 @@ 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; @@ -212,7 +1121,7 @@ public com.google.bigtable.admin.v2.CreateClusterRequestOrBuilder getOriginalReq */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -240,7 +1149,7 @@ 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; @@ -258,7 +1167,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -286,7 +1195,165 @@ 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_; + } + + public static final int TABLES_FIELD_NUMBER = 4; + + private static final class TablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.bigtable.admin.v2.BigtableInstanceAdminProto + .internal_static_google_bigtable_admin_v2_CreateClusterMetadata_TablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + .getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + tables_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + internalGetTables() { + if (tables_ == null) { + return com.google.protobuf.MapField.emptyMapField(TablesDefaultEntryHolder.defaultEntry); + } + return tables_; + } + + public int getTablesCount() { + return internalGetTables().getMap().size(); + } + /** + * + * + *
    +   * Keys: the full `name` of each table that existed in the instance when
    +   * CreateCluster was first called, i.e.
    +   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +   * to the instance by a later API call will be created in the new cluster by
    +   * that API call, not this one.
    +   *
    +   * Values: information on how much of a table's data has been copied to the
    +   * newly-created cluster so far.
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public boolean containsTables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetTables().getMap().containsKey(key); + } + /** Use {@link #getTablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getTables() { + return getTablesMap(); + } + /** + * + * + *
    +   * Keys: the full `name` of each table that existed in the instance when
    +   * CreateCluster was first called, i.e.
    +   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +   * to the instance by a later API call will be created in the new cluster by
    +   * that API call, not this one.
    +   *
    +   * Values: information on how much of a table's data has been copied to the
    +   * newly-created cluster so far.
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getTablesMap() { + return internalGetTables().getMap(); + } + /** + * + * + *
    +   * Keys: the full `name` of each table that existed in the instance when
    +   * CreateCluster was first called, i.e.
    +   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +   * to the instance by a later API call will be created in the new cluster by
    +   * that API call, not this one.
    +   *
    +   * Values: information on how much of a table's data has been copied to the
    +   * newly-created cluster so far.
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + getTablesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + map = internalGetTables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
    +   * Keys: the full `name` of each table that existed in the instance when
    +   * CreateCluster was first called, i.e.
    +   * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +   * to the instance by a later API call will be created in the new cluster by
    +   * that API call, not this one.
    +   *
    +   * Values: information on how much of a table's data has been copied to the
    +   * newly-created cluster so far.
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress getTablesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + map = internalGetTables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); } private byte memoizedIsInitialized = -1; @@ -303,16 +1370,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.GeneratedMessageV3.serializeStringMapTo( + output, internalGetTables(), TablesDefaultEntryHolder.defaultEntry, 4); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -321,16 +1390,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 +1440,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 +1464,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; } @@ -499,6 +1586,28 @@ 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 internalGetFieldAccessorTable() { @@ -520,30 +1629,33 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOriginalRequestFieldBuilder(); + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + } } @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,25 +1683,36 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateClusterMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.tables_ = internalGetTables().build(TablesDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -645,7 +1768,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,21 +1785,69 @@ 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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getFinishTimeFieldBuilder().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< com.google.bigtable.admin.v2.CreateClusterRequest, @@ -693,7 +1866,7 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -730,11 +1903,11 @@ 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,11 +1923,11 @@ 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,19 +1941,21 @@ 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,14 +1968,13 @@ 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,7 +1987,7 @@ 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(); } @@ -880,7 +2054,7 @@ 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); } /** * @@ -917,11 +2091,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -936,11 +2110,11 @@ 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,19 +2128,20 @@ 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,14 +2154,13 @@ 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,7 +2173,7 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getRequestTimeFieldBuilder().getBuilder(); } @@ -1065,7 +2239,7 @@ 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); } /** * @@ -1102,11 +2276,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1121,11 +2295,11 @@ 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,17 +2313,20 @@ 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,14 +2339,13 @@ 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,7 +2358,7 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getFinishTimeFieldBuilder().getBuilder(); } @@ -1230,6 +2406,331 @@ 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 /* nullable */ com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress + getTablesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder> + map = internalGetMutableTables().ensureBuilderMap(); + return map.containsKey(key) ? tablesConverter.build(map.get(key)) : defaultValue; + } + /** + * + * + *
    +     * Keys: the full `name` of each table that existed in the instance when
    +     * CreateCluster was first called, i.e.
    +     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +     * to the instance by a later API call will be created in the new cluster by
    +     * that API call, not this one.
    +     *
    +     * Values: information on how much of a table's data has been copied to the
    +     * newly-created cluster so far.
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress getTablesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder> + map = internalGetMutableTables().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return tablesConverter.build(map.get(key)); + } + + public Builder clearTables() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableTables().clear(); + return this; + } + /** + * + * + *
    +     * Keys: the full `name` of each table that existed in the instance when
    +     * CreateCluster was first called, i.e.
    +     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +     * to the instance by a later API call will be created in the new cluster by
    +     * that API call, not this one.
    +     *
    +     * Values: information on how much of a table's data has been copied to the
    +     * newly-created cluster so far.
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public Builder removeTables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableTables().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + getMutableTables() { + bitField0_ |= 0x00000008; + return internalGetMutableTables().ensureMessageMap(); + } + /** + * + * + *
    +     * Keys: the full `name` of each table that existed in the instance when
    +     * CreateCluster was first called, i.e.
    +     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +     * to the instance by a later API call will be created in the new cluster by
    +     * that API call, not this one.
    +     *
    +     * Values: information on how much of a table's data has been copied to the
    +     * newly-created cluster so far.
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public Builder putTables( + java.lang.String key, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableTables().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
    +     * Keys: the full `name` of each table that existed in the instance when
    +     * CreateCluster was first called, i.e.
    +     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +     * to the instance by a later API call will be created in the new cluster by
    +     * that API call, not this one.
    +     *
    +     * Values: information on how much of a table's data has been copied to the
    +     * newly-created cluster so far.
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public Builder putAllTables( + java.util.Map< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + values) { + for (java.util.Map.Entry< + java.lang.String, com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableTables().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
    +     * Keys: the full `name` of each table that existed in the instance when
    +     * CreateCluster was first called, i.e.
    +     * `projects/<project>/instances/<instance>/tables/<table>`. Any table added
    +     * to the instance by a later API call will be created in the new cluster by
    +     * that API call, not this one.
    +     *
    +     * Values: information on how much of a table's data has been copied to the
    +     * newly-created cluster so far.
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.CreateClusterMetadata.TableProgress> tables = 4; + * + */ + public com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder + putTablesBuilderIfAbsent(java.lang.String key) { + java.util.Map< + java.lang.String, + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder> + builderMap = internalGetMutableTables().ensureBuilderMap(); + com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgressOrBuilder entry = + builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) { + entry = + ((com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.Builder) entry; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -1262,7 +2763,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..cc89a81e8b 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateClusterMetadataOrBuilder @@ -127,4 +128,110 @@ 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 016c5ef19e..1162f9998c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -48,78 +49,6 @@ 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; @@ -135,15 +64,17 @@ 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}`.
        * 
    * * @@ -168,9 +99,8 @@ public 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}`.
        * 
    * * @@ -193,13 +123,15 @@ 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`.
        * 
    * @@ -223,8 +155,8 @@ public 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`.
        * 
    * @@ -262,7 +194,7 @@ public com.google.protobuf.ByteString getClusterIdBytes() { */ @java.lang.Override public boolean hasCluster() { - return cluster_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -294,7 +226,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; @@ -317,10 +249,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); } - if (cluster_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getCluster()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -335,10 +267,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) { size += com.google.protobuf.GeneratedMessageV3.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 +292,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 +311,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; } @@ -518,20 +450,20 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterFieldBuilder(); + } } @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,17 +493,29 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.clusterId_ = clusterId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.cluster_ = clusterBuilder_ == null ? cluster_ : clusterBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -620,16 +564,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 +590,61 @@ 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(getClusterFieldBuilder().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}`.
          * 
    * * @@ -690,9 +668,8 @@ public 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}`.
          * 
    * * @@ -716,9 +693,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * 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,8 +708,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -741,9 +717,8 @@ public Builder setParent(java.lang.String value) { * * *
    -     * 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,8 +728,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -762,9 +737,8 @@ public Builder clearParent() { * * *
    -     * 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,8 +753,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -790,8 +764,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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`.
          * 
    * @@ -814,8 +788,8 @@ public 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`.
          * 
    * @@ -838,8 +812,8 @@ public com.google.protobuf.ByteString getClusterIdBytes() { * * *
    -     * 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,8 +826,8 @@ public Builder setClusterId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - clusterId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -861,8 +835,8 @@ public Builder setClusterId(java.lang.String value) { * * *
    -     * 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,8 +845,8 @@ public Builder setClusterId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearClusterId() { - clusterId_ = getDefaultInstance().getClusterId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -880,8 +854,8 @@ public Builder clearClusterId() { * * *
    -     * 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,8 +869,8 @@ public Builder setClusterIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - clusterId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -922,7 +896,7 @@ 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); } /** * @@ -965,11 +939,11 @@ 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,11 +961,11 @@ 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,19 +982,20 @@ 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,14 +1011,13 @@ 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,7 +1033,7 @@ public Builder clearCluster() { *
    */ public com.google.bigtable.admin.v2.Cluster.Builder getClusterBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getClusterFieldBuilder().getBuilder(); } @@ -1145,7 +1119,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..d590fc6df0 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateClusterRequestOrBuilder @@ -27,9 +28,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}`.
        * 
    * * @@ -43,9 +43,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}`.
        * 
    * * @@ -60,8 +59,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`.
        * 
    * @@ -74,8 +73,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`.
        * 
    * 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..6d859762d4 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,95 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new CreateInstanceMetadata(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_CreateInstanceMetadata_descriptor; @@ -149,6 +61,7 @@ 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,7 +77,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -194,7 +107,9 @@ 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; @@ -212,7 +127,7 @@ public com.google.bigtable.admin.v2.CreateInstanceRequestOrBuilder getOriginalRe */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -240,7 +155,7 @@ 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; @@ -258,7 +173,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -286,7 +201,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 +218,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 +236,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 +273,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 +296,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; } @@ -520,28 +435,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOriginalRequestFieldBuilder(); + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + } } @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,25 +488,33 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateInstanceMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -645,7 +570,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,21 +585,54 @@ 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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getFinishTimeFieldBuilder().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< com.google.bigtable.admin.v2.CreateInstanceRequest, @@ -693,7 +651,7 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -730,11 +688,11 @@ 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,11 +708,11 @@ 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,19 +726,21 @@ 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,14 +753,13 @@ 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,7 +772,7 @@ 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(); } @@ -880,7 +839,7 @@ 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); } /** * @@ -917,11 +876,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -936,11 +895,11 @@ 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,19 +913,20 @@ 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,14 +939,13 @@ 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,7 +958,7 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getRequestTimeFieldBuilder().getBuilder(); } @@ -1065,7 +1024,7 @@ 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); } /** * @@ -1102,11 +1061,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1121,11 +1080,11 @@ 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,17 +1098,20 @@ 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,14 +1124,13 @@ 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,7 +1143,7 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getFinishTimeFieldBuilder().getBuilder(); } @@ -1262,7 +1223,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..76b0679ce2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateInstanceMetadataOrBuilder 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 0d73599b13..347864239c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -48,95 +49,6 @@ 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 +56,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(); @@ -163,14 +76,17 @@ 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}`.
        * 
    * * @@ -195,8 +111,8 @@ public 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}`.
        * 
    * * @@ -219,13 +135,15 @@ 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`.
        * 
    * @@ -249,8 +167,8 @@ public 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`.
        * 
    * @@ -289,7 +207,7 @@ public com.google.protobuf.ByteString getInstanceIdBytes() { */ @java.lang.Override public boolean hasInstance() { - return instance_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -325,7 +243,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 +264,7 @@ private static final class ClustersDefaultEntryHolder { com.google.bigtable.admin.v2.Cluster.getDefaultInstance()); } + @SuppressWarnings("serial") private com.google.protobuf.MapField clusters_; @@ -376,7 +297,7 @@ 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); } @@ -421,10 +342,12 @@ 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(); @@ -448,7 +371,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(); @@ -478,12 +401,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); } - if (instance_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(3, getInstance()); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetClusters(), ClustersDefaultEntryHolder.defaultEntry, 4); - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -498,7 +421,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceId_)) { size += com.google.protobuf.GeneratedMessageV3.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 +435,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 +458,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 +481,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; } @@ -677,7 +600,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 +611,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(); @@ -717,20 +642,20 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstanceFieldBuilder(); + } } @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,20 +686,32 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.clusters_ = internalGetClusters().build(ClustersDefaultEntryHolder.defaultEntry); + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -823,17 +760,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,18 +788,62 @@ 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(getInstanceFieldBuilder().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; } @@ -870,8 +854,8 @@ public Builder mergeFrom( * * *
    -     * 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}`.
          * 
    * * @@ -895,8 +879,8 @@ public 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}`.
          * 
    * * @@ -920,8 +904,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * 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,8 +919,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -944,8 +928,8 @@ public Builder setParent(java.lang.String value) { * * *
    -     * 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,8 +939,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -964,8 +948,8 @@ public Builder clearParent() { * * *
    -     * 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,8 +964,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -991,8 +975,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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`.
          * 
    * @@ -1015,8 +999,8 @@ public 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`.
          * 
    * @@ -1039,8 +1023,8 @@ public com.google.protobuf.ByteString getInstanceIdBytes() { * * *
    -     * 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,8 +1037,8 @@ public Builder setInstanceId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - instanceId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1062,8 +1046,8 @@ public Builder setInstanceId(java.lang.String value) { * * *
    -     * 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,8 +1056,8 @@ public Builder setInstanceId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearInstanceId() { - instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -1081,8 +1065,8 @@ public Builder clearInstanceId() { * * *
    -     * 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,8 +1080,8 @@ public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - instanceId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1123,7 +1107,7 @@ 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); } /** * @@ -1166,11 +1150,11 @@ 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,11 +1172,11 @@ 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,19 +1193,20 @@ 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,14 +1222,13 @@ 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,7 +1244,7 @@ public Builder clearInstance() { *
    */ public com.google.bigtable.admin.v2.Instance.Builder getInstanceBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getInstanceFieldBuilder().getBuilder(); } @@ -1314,33 +1298,64 @@ 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(); } /** * @@ -1360,9 +1375,9 @@ 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 @@ -1387,7 +1402,7 @@ public java.util.Map get */ @java.lang.Override public java.util.Map getClustersMap() { - return internalGetClusters().getMap(); + return internalGetClusters().getImmutableMap(); } /** * @@ -1405,14 +1420,16 @@ 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; } /** * @@ -1432,18 +1449,19 @@ 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; } /** @@ -1463,16 +1481,17 @@ 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(); } /** * @@ -1491,12 +1510,13 @@ 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; } /** @@ -1516,9 +1536,46 @@ 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; } + /** + * + * + *
    +     * 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.
    +     * 
    + * + * + * 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; + } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1552,7 +1609,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..347f3cc000 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateInstanceRequestOrBuilder @@ -27,8 +28,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}`.
        * 
    * * @@ -42,8 +43,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}`.
        * 
    * * @@ -58,8 +59,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`.
        * 
    * @@ -72,8 +73,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`.
        * 
    * @@ -193,8 +194,11 @@ public interface CreateInstanceRequestOrBuilder * 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); /** * * 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..047fdd124f 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -23,6 +24,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
    @@ -50,95 +52,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
         return new CreateTableFromSnapshotMetadata();
       }
     
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  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();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_CreateTableFromSnapshotMetadata_descriptor;
    @@ -154,6 +67,7 @@ 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,7 +84,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        */
       @java.lang.Override
       public boolean hasOriginalRequest() {
    -    return originalRequest_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
       /**
        *
    @@ -203,7 +117,9 @@ 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;
    @@ -221,7 +137,7 @@ public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest getOriginalRe
        */
       @java.lang.Override
       public boolean hasRequestTime() {
    -    return requestTime_ != null;
    +    return ((bitField0_ & 0x00000002) != 0);
       }
       /**
        *
    @@ -249,7 +165,7 @@ 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;
    @@ -267,7 +183,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
        */
       @java.lang.Override
       public boolean hasFinishTime() {
    -    return finishTime_ != null;
    +    return ((bitField0_ & 0x00000004) != 0);
       }
       /**
        *
    @@ -295,7 +211,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 +228,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 +246,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 +283,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 +306,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;
       }
    @@ -496,6 +412,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * 
        * 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
    @@ -534,28 +451,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    +        getOriginalRequestFieldBuilder();
    +        getRequestTimeFieldBuilder();
    +        getFinishTimeFieldBuilder();
    +      }
         }
     
         @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,25 +505,34 @@ 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;
         }
     
    +    private void buildPartial0(
    +        com.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata result) {
    +      int from_bitField0_ = bitField0_;
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.originalRequest_ =
    +            originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.requestTime_ =
    +            requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build();
    +        to_bitField0_ |= 0x00000002;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build();
    +        to_bitField0_ |= 0x00000004;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -661,7 +589,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,21 +604,54 @@ 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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry);
    +                bitField0_ |= 0x00000001;
    +                break;
    +              } // case 10
    +            case 18:
    +              {
    +                input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry);
    +                bitField0_ |= 0x00000002;
    +                break;
    +              } // case 18
    +            case 26:
    +              {
    +                input.readMessage(getFinishTimeFieldBuilder().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<
                 com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest,
    @@ -710,7 +671,7 @@ public Builder mergeFrom(
          * @return Whether the originalRequest field is set.
          */
         public boolean hasOriginalRequest() {
    -      return originalRequestBuilder_ != null || originalRequest_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
         /**
          *
    @@ -750,11 +711,11 @@ public Builder setOriginalRequest(
               throw new NullPointerException();
             }
             originalRequest_ = value;
    -        onChanged();
           } else {
             originalRequestBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000001;
    +      onChanged();
           return this;
         }
         /**
    @@ -771,11 +732,11 @@ 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,20 +752,22 @@ 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,14 +781,13 @@ 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,7 +802,7 @@ public Builder clearOriginalRequest() {
          */
         public com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest.Builder
             getOriginalRequestBuilder() {
    -
    +      bitField0_ |= 0x00000001;
           onChanged();
           return getOriginalRequestFieldBuilder().getBuilder();
         }
    @@ -909,7 +871,7 @@ public Builder clearOriginalRequest() {
          * @return Whether the requestTime field is set.
          */
         public boolean hasRequestTime() {
    -      return requestTimeBuilder_ != null || requestTime_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
         /**
          *
    @@ -946,11 +908,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             requestTime_ = value;
    -        onChanged();
           } else {
             requestTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
         /**
    @@ -965,11 +927,11 @@ 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,19 +945,20 @@ 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,14 +971,13 @@ 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,7 +990,7 @@ public Builder clearRequestTime() {
          * .google.protobuf.Timestamp request_time = 2;
          */
         public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() {
    -
    +      bitField0_ |= 0x00000002;
           onChanged();
           return getRequestTimeFieldBuilder().getBuilder();
         }
    @@ -1094,7 +1056,7 @@ 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);
         }
         /**
          *
    @@ -1131,11 +1093,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             finishTime_ = value;
    -        onChanged();
           } else {
             finishTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000004;
    +      onChanged();
           return this;
         }
         /**
    @@ -1150,11 +1112,11 @@ 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,17 +1130,20 @@ 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,14 +1156,13 @@ 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,7 +1175,7 @@ public Builder clearFinishTime() {
          * .google.protobuf.Timestamp finish_time = 3;
          */
         public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() {
    -
    +      bitField0_ |= 0x00000004;
           onChanged();
           return getFinishTimeFieldBuilder().getBuilder();
         }
    @@ -1292,7 +1256,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..283e77a999 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface CreateTableFromSnapshotMetadataOrBuilder
    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 24571aa7f0..5cc5de7956 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -24,6 +25,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
    @@ -55,69 +57,6 @@ 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;
    @@ -134,7 +73,9 @@ 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_ = "";
       /**
        *
        *
    @@ -189,13 +130,15 @@ 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]; @@ -218,8 +161,8 @@ public 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]; @@ -240,14 +183,16 @@ 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}`.
        * 
    * @@ -273,9 +218,9 @@ public 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}`.
        * 
    * @@ -321,7 +266,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceSnapshot_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceSnapshot_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -339,7 +284,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceSnapshot_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceSnapshot_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -358,7 +303,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 +320,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; } @@ -482,6 +427,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
        * 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
    @@ -510,28 +456,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) {
           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,13 +496,26 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.CreateTableFromSnapshotRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.parent_ = parent_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.tableId_ = tableId_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.sourceSnapshot_ = sourceSnapshot_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -614,17 +564,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,21 +592,54 @@ 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_ = "";
         /**
          *
    @@ -724,8 +710,8 @@ public Builder setParent(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -744,8 +730,8 @@ 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,8 +755,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -780,8 +766,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
          *
          *
          * 
    -     * 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]; @@ -803,8 +789,8 @@ public 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]; @@ -826,8 +812,8 @@ public com.google.protobuf.ByteString getTableIdBytes() { * * *
    -     * 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,8 +825,8 @@ public Builder setTableId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -848,8 +834,8 @@ public Builder setTableId(java.lang.String value) { * * *
    -     * 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,8 +843,8 @@ public Builder setTableId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearTableId() { - tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -866,8 +852,8 @@ public Builder clearTableId() { * * *
    -     * 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,8 +866,8 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -891,9 +877,9 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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}`.
          * 
    * @@ -918,9 +904,9 @@ public 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}`.
          * 
    * @@ -945,9 +931,9 @@ public com.google.protobuf.ByteString getSourceSnapshotBytes() { * * *
    -     * 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,8 +948,8 @@ public Builder setSourceSnapshot(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - sourceSnapshot_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -971,9 +957,9 @@ public Builder setSourceSnapshot(java.lang.String value) { * * *
    -     * 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,8 +970,8 @@ public Builder setSourceSnapshot(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSourceSnapshot() { - sourceSnapshot_ = getDefaultInstance().getSourceSnapshot(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -993,9 +979,9 @@ public Builder clearSourceSnapshot() { * * *
    -     * 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,8 +997,8 @@ public Builder setSourceSnapshotBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - sourceSnapshot_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1049,7 +1035,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..3fabb5ff0c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateTableFromSnapshotRequestOrBuilder @@ -58,8 +59,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]; @@ -71,8 +72,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]; @@ -85,9 +86,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}`.
        * 
    * @@ -102,9 +103,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}`.
        * 
    * 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 4b967ec84e..92c0023f94 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -50,95 +51,6 @@ 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; @@ -201,53 +113,6 @@ 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; @@ -264,7 +129,7 @@ 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 +163,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 +175,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 +192,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 +205,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; } @@ -472,24 +337,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) { 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,11 +375,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.CreateTableRequest.Split result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -573,7 +440,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest.Split o if (other.getKey() != com.google.protobuf.ByteString.EMPTY) { setKey(other.getKey()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -588,21 +455,42 @@ 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; /** * @@ -635,8 +523,8 @@ public Builder setKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -652,7 +540,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; @@ -691,7 +579,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 +610,11 @@ 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_ = ""; /** * * @@ -766,13 +669,15 @@ 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.
        * 
    * @@ -796,8 +701,8 @@ public 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.
        * 
    * @@ -834,7 +739,7 @@ public com.google.protobuf.ByteString getTableIdBytes() { */ @java.lang.Override public boolean hasTable() { - return table_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -864,10 +769,12 @@ 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,7 +784,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -904,7 +813,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -931,7 +842,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -957,7 +870,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -983,7 +898,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -1023,13 +940,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { com.google.protobuf.GeneratedMessageV3.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 @@ -1044,13 +961,13 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableId_)) { size += com.google.protobuf.GeneratedMessageV3.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 +990,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 +1013,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; } @@ -1237,6 +1154,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTableFieldBuilder(); getInitialSplitsFieldBuilder(); } } @@ -1244,22 +1162,21 @@ private void maybeForceBuilderInitialization() { @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,25 +1204,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; + } + + 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 +1289,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 +1304,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,7 +1317,7 @@ 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() @@ -1392,7 +1327,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.CreateTableRequest other) } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1407,17 +1342,63 @@ 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(getTableFieldBuilder().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; } @@ -1493,8 +1474,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1513,8 +1494,8 @@ 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,8 +1519,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1549,8 +1530,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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.
          * 
    * @@ -1573,8 +1554,8 @@ public 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.
          * 
    * @@ -1597,8 +1578,8 @@ public com.google.protobuf.ByteString getTableIdBytes() { * * *
    -     * 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,8 +1592,8 @@ public Builder setTableId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1620,8 +1601,8 @@ public Builder setTableId(java.lang.String value) { * * *
    -     * 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,8 +1611,8 @@ public Builder setTableId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearTableId() { - tableId_ = getDefaultInstance().getTableId(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -1639,8 +1620,8 @@ public Builder clearTableId() { * * *
    -     * 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,8 +1635,8 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1679,7 +1660,7 @@ 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); } /** * @@ -1716,11 +1697,11 @@ 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,11 +1717,11 @@ 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,17 +1736,20 @@ 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,14 +1763,13 @@ 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,7 +1783,7 @@ public Builder clearTable() { * */ public com.google.bigtable.admin.v2.Table.Builder getTableBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getTableFieldBuilder().getBuilder(); } @@ -1852,11 +1835,11 @@ 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; } } @@ -1874,7 +1857,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -1904,7 +1889,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -1933,7 +1920,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -1962,7 +1951,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -1998,7 +1989,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2031,7 +2024,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2066,7 +2061,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2102,7 +2099,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2135,7 +2134,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2168,7 +2169,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2202,7 +2205,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2219,7 +2224,7 @@ public Builder addAllInitialSplits( public Builder clearInitialSplits() { if (initialSplitsBuilder_ == null) { initialSplits_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { initialSplitsBuilder_.clear(); @@ -2234,7 +2239,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2266,7 +2273,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2292,7 +2301,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2322,7 +2333,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2352,7 +2365,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2378,7 +2393,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2406,7 +2423,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -2437,7 +2456,7 @@ public com.google.bigtable.admin.v2.CreateTableRequest.Split.Builder addInitialS 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; @@ -2477,7 +2496,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..97c2f95b6b 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface CreateTableRequestOrBuilder @@ -58,8 +59,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.
        * 
    * @@ -72,8 +73,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.
        * 
    * @@ -129,7 +130,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -152,7 +155,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -175,7 +180,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -198,7 +205,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` @@ -222,7 +231,9 @@ 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"]` * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` 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..c8593496f0 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWrites.java @@ -0,0 +1,435 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class DataBoostReadLocalWrites extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DataBoostReadLocalWrites) + DataBoostReadLocalWritesOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataBoostReadLocalWrites.newBuilder() to construct. + private DataBoostReadLocalWrites(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataBoostReadLocalWrites() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..c7508523b4 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DataBoostReadLocalWritesOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 b53170a69e..38e8af741e 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,60 +48,6 @@ 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; @@ -117,12 +64,15 @@ 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}`.
        * 
    * @@ -148,7 +98,8 @@ public 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}`.
        * 
    * @@ -172,7 +123,7 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int IGNORE_WARNINGS_FIELD_NUMBER = 2; - private boolean ignoreWarnings_; + private boolean ignoreWarnings_ = false; /** * * @@ -209,7 +160,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (ignoreWarnings_ != false) { output.writeBool(2, ignoreWarnings_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -224,7 +175,7 @@ public int getSerializedSize() { if (ignoreWarnings_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, ignoreWarnings_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -242,7 +193,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 +208,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; } @@ -386,26 +337,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) { 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,12 +376,23 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.DeleteAppProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -487,12 +441,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 +462,55 @@ 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}`.
          * 
    * @@ -552,7 +535,8 @@ public 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}`.
          * 
    * @@ -577,7 +561,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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,8 +577,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -601,7 +586,8 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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,8 +598,8 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -621,7 +607,8 @@ public Builder clearName() { * * *
    -     * 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,8 +624,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -674,6 +661,7 @@ public boolean getIgnoreWarnings() { public Builder setIgnoreWarnings(boolean value) { ignoreWarnings_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -689,7 +677,7 @@ public Builder setIgnoreWarnings(boolean value) { * @return This builder for chaining. */ public Builder clearIgnoreWarnings() { - + bitField0_ = (bitField0_ & ~0x00000002); ignoreWarnings_ = false; onChanged(); return this; @@ -727,7 +715,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..2a4eab6e17 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface DeleteAppProfileRequestOrBuilder @@ -27,7 +28,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}`.
        * 
    * @@ -42,7 +44,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}`.
        * 
    * 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..d1ba1622ee --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequest.java @@ -0,0 +1,859 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class DeleteAuthorizedViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.DeleteAuthorizedViewRequest) + DeleteAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteAuthorizedViewRequest.newBuilder() to construct. + private DeleteAuthorizedViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteAuthorizedViewRequest() { + name_ = ""; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteAuthorizedViewRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..d7817ba36f --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 11f4d46bcc..c1e8a3dd02 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 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. @@ -16,13 +16,15 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** * * *
    - * 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} @@ -47,55 +49,6 @@ 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; @@ -112,7 +65,9 @@ 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_ = ""; /** * * @@ -185,7 +140,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -197,7 +152,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +169,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 +182,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; } @@ -331,7 +286,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
    -   * 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} @@ -356,24 +312,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) { 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,11 +350,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.DeleteBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -454,9 +412,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,20 +430,42 @@ 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_ = ""; /** * @@ -558,8 +539,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -579,8 +560,8 @@ 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,8 +586,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -643,7 +624,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..b587c6e130 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface DeleteBackupRequestOrBuilder 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 effff5f63b..5856e1148c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,55 +48,6 @@ 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; @@ -112,13 +64,15 @@ 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}`.
        * 
    * * @@ -143,8 +97,8 @@ public 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}`.
        * 
    * * @@ -183,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -195,7 +149,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +166,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 +179,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; } @@ -354,24 +308,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) { 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,11 +346,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -452,9 +408,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 +426,49 @@ 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}`.
          * 
    * * @@ -514,8 +492,8 @@ public 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}`.
          * 
    * * @@ -539,8 +517,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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,8 +532,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -563,8 +541,8 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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,8 +552,8 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -583,8 +561,8 @@ public Builder clearName() { * * *
    -     * 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,8 +577,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -637,7 +615,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..12658a36c6 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface DeleteClusterRequestOrBuilder @@ -27,8 +28,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}`.
        * 
    * * @@ -42,8 +43,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}`.
        * 
    * * 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 1130c9b4b3..67aeb51ed2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,55 +48,6 @@ 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; @@ -112,7 +64,9 @@ 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_ = ""; /** * * @@ -183,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -195,7 +149,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +166,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 +179,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; } @@ -354,24 +308,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) { 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,11 +346,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.DeleteInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -452,9 +408,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,21 +426,42 @@ 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_ = ""; /** * @@ -554,8 +532,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -574,8 +552,8 @@ 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,8 +577,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -637,7 +615,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..1a79662345 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface DeleteInstanceRequestOrBuilder 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 c9a34bcc6a..de758cb272 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -24,6 +25,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
    @@ -52,55 +54,6 @@ 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;
    @@ -117,7 +70,9 @@ 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_ = "";
       /**
        *
        *
    @@ -190,7 +145,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -202,7 +157,7 @@ public int getSerializedSize() {
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -219,7 +174,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 +187,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;
       }
    @@ -338,6 +293,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        * 
        * 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
    @@ -366,24 +322,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) {
           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,11 +360,20 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.DeleteSnapshotRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -464,9 +422,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,21 +440,42 @@ 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_ = "";
         /**
          *
    @@ -569,8 +549,8 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -590,8 +570,8 @@ 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,8 +596,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -654,7 +634,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..e25724da64 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface DeleteSnapshotRequestOrBuilder
    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 545a2d314c..94c5e15ef9 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -48,55 +49,6 @@ 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;
    @@ -113,7 +65,9 @@ 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_ = "";
       /**
        *
        *
    @@ -186,7 +140,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -198,7 +152,7 @@ public int getSerializedSize() {
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -215,7 +169,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 +182,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;
       }
    @@ -358,24 +312,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) {
           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,11 +350,20 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.DeleteTableRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -456,9 +412,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,20 +430,42 @@ 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_ = "";
         /**
          *
    @@ -560,8 +539,8 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -581,8 +560,8 @@ 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,8 +586,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -645,7 +624,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..6c7e355430 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface DeleteTableRequestOrBuilder
    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 3eeb789928..a11c50e028 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -48,67 +49,6 @@ 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;
    @@ -125,6 +65,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       private int targetCase_ = 0;
    +
    +  @SuppressWarnings("serial")
       private java.lang.Object target_;
     
       public enum TargetCase
    @@ -172,7 +114,9 @@ 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_ = "";
       /**
        *
        *
    @@ -323,7 +267,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
    @@ -345,7 +289,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 +317,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 +342,7 @@ public int hashCode() {
           case 0:
           default:
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -528,24 +472,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) {
           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,18 +512,26 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.DropRowRangeRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +    }
    +
    +    private void buildPartialOneofs(com.google.bigtable.admin.v2.DropRowRangeRequest result) {
    +      result.targetCase_ = targetCase_;
    +      result.target_ = this.target_;
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -635,6 +580,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 +599,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 +614,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,6 +674,8 @@ public Builder clearTarget() {
           return this;
         }
     
    +    private int bitField0_;
    +
         private java.lang.Object name_ = "";
         /**
          *
    @@ -769,8 +749,8 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -790,8 +770,8 @@ 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 +796,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -942,6 +922,7 @@ public boolean getDeleteAllDataFromTable() {
          * @return This builder for chaining.
          */
         public Builder setDeleteAllDataFromTable(boolean value) {
    +
           targetCase_ = 3;
           target_ = value;
           onChanged();
    @@ -999,7 +980,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..9a451cd595 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface DropRowRangeRequestOrBuilder
    @@ -108,5 +109,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 3b396ec533..9eaf2875e9 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/table.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -51,77 +52,6 @@ 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;
    @@ -310,8 +240,9 @@ 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;
       /**
        *
        *
    @@ -344,9 +275,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;
    @@ -370,7 +300,7 @@ public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionT
        */
       @java.lang.Override
       public boolean hasEncryptionStatus() {
    -    return encryptionStatus_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
       /**
        *
    @@ -406,11 +336,15 @@ 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_ = "";
       /**
        *
        *
    @@ -486,10 +420,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
                 .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
    @@ -506,10 +440,10 @@ public int getSerializedSize() {
                 .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 +465,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 +484,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;
       }
    @@ -692,22 +626,22 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    +        getEncryptionStatusFieldBuilder();
    +      }
         }
     
         @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,17 +669,30 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.EncryptionInfo result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.encryptionType_ = encryptionType_;
    +      }
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.encryptionStatus_ =
    +            encryptionStatusBuilder_ == null ? encryptionStatus_ : encryptionStatusBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.kmsKeyVersion_ = kmsKeyVersion_;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -799,9 +746,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,20 +764,55 @@ 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(
    +                    getEncryptionStatusFieldBuilder().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;
         /**
          *
    @@ -863,8 +846,8 @@ public int getEncryptionTypeValue() {
          * @return This builder for chaining.
          */
         public Builder setEncryptionTypeValue(int value) {
    -
           encryptionType_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -883,9 +866,8 @@ 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,7 +891,7 @@ public Builder setEncryptionType(
           if (value == null) {
             throw new NullPointerException();
           }
    -
    +      bitField0_ |= 0x00000001;
           encryptionType_ = value.getNumber();
           onChanged();
           return this;
    @@ -928,7 +910,7 @@ public Builder setEncryptionType(
          * @return This builder for chaining.
          */
         public Builder clearEncryptionType() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000001);
           encryptionType_ = 0;
           onChanged();
           return this;
    @@ -953,7 +935,7 @@ public Builder clearEncryptionType() {
          * @return Whether the encryptionStatus field is set.
          */
         public boolean hasEncryptionStatus() {
    -      return encryptionStatusBuilder_ != null || encryptionStatus_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
         /**
          *
    @@ -996,11 +978,11 @@ public Builder setEncryptionStatus(com.google.rpc.Status value) {
               throw new NullPointerException();
             }
             encryptionStatus_ = value;
    -        onChanged();
           } else {
             encryptionStatusBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
         /**
    @@ -1018,11 +1000,11 @@ 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,17 +1021,20 @@ 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,14 +1050,13 @@ 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,7 +1072,7 @@ public Builder clearEncryptionStatus() {
          * 
          */
         public com.google.rpc.Status.Builder getEncryptionStatusBuilder() {
    -
    +      bitField0_ |= 0x00000002;
           onChanged();
           return getEncryptionStatusFieldBuilder().getBuilder();
         }
    @@ -1210,8 +1194,8 @@ public Builder setKmsKeyVersion(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           kmsKeyVersion_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -1230,8 +1214,8 @@ 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,8 +1239,8 @@ public Builder setKmsKeyVersionBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           kmsKeyVersion_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -1293,7 +1277,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..3edfe69c34 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/table.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface EncryptionInfoOrBuilder
    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..602f940030 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/table.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -45,100 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
         return new GcRule();
       }
     
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  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();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.TableProto
             .internal_static_google_bigtable_admin_v2_GcRule_descriptor;
    @@ -239,63 +146,6 @@ 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;
    @@ -312,6 +162,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         public static final int RULES_FIELD_NUMBER = 1;
    +
    +    @SuppressWarnings("serial")
         private java.util.List rules_;
         /**
          *
    @@ -397,7 +249,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 +261,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 +278,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 +293,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;
         }
    @@ -572,30 +424,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) {
             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 +468,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,8 +487,10 @@ public com.google.bigtable.admin.v2.GcRule.Intersection buildPartial() {
             } else {
               result.rules_ = rulesBuilder_.build();
             }
    -        onBuilt();
    -        return result;
    +      }
    +
    +      private void buildPartial0(com.google.bigtable.admin.v2.GcRule.Intersection result) {
    +        int from_bitField0_ = bitField0_;
           }
     
           @java.lang.Override
    @@ -712,7 +568,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule.Intersection other)
                 }
               }
             }
    -        this.mergeUnknownFields(other.unknownFields);
    +        this.mergeUnknownFields(other.getUnknownFields());
             onChanged();
             return this;
           }
    @@ -727,18 +583,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;
           }
     
    @@ -1125,7 +1007,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();
               }
             };
     
    @@ -1229,63 +1123,6 @@ 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;
    @@ -1302,6 +1139,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         }
     
         public static final int RULES_FIELD_NUMBER = 1;
    +
    +    @SuppressWarnings("serial")
         private java.util.List rules_;
         /**
          *
    @@ -1387,7 +1226,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 +1238,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 +1255,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 +1270,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;
         }
    @@ -1562,30 +1401,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) {
             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 +1445,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,8 +1463,10 @@ public com.google.bigtable.admin.v2.GcRule.Union buildPartial() {
             } else {
               result.rules_ = rulesBuilder_.build();
             }
    -        onBuilt();
    -        return result;
    +      }
    +
    +      private void buildPartial0(com.google.bigtable.admin.v2.GcRule.Union result) {
    +        int from_bitField0_ = bitField0_;
           }
     
           @java.lang.Override
    @@ -1701,7 +1543,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.GcRule.Union other) {
                 }
               }
             }
    -        this.mergeUnknownFields(other.unknownFields);
    +        this.mergeUnknownFields(other.getUnknownFields());
             onChanged();
             return this;
           }
    @@ -1716,17 +1558,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;
           }
     
    @@ -2113,7 +1982,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 +2014,8 @@ public com.google.bigtable.admin.v2.GcRule.Union getDefaultInstanceForType() {
       }
     
       private int ruleCase_ = 0;
    +
    +  @SuppressWarnings("serial")
       private java.lang.Object rule_;
     
       public enum RuleCase
    @@ -2405,7 +2288,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 +2317,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 +2349,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 +2380,7 @@ public int hashCode() {
           case 0:
           default:
         }
    -    hash = (29 * hash) + unknownFields.hashCode();
    +    hash = (29 * hash) + getUnknownFields().hashCode();
         memoizedHashCode = hash;
         return hash;
       }
    @@ -2625,22 +2508,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) {
           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,33 +2555,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 (bitField0_ != 0) {
    +        buildPartial0(result);
           }
    -      if (ruleCase_ == 2) {
    -        if (maxAgeBuilder_ == null) {
    -          result.rule_ = rule_;
    -        } else {
    -          result.rule_ = maxAgeBuilder_.build();
    -        }
    +      buildPartialOneofs(result);
    +      onBuilt();
    +      return result;
    +    }
    +
    +    private void buildPartial0(com.google.bigtable.admin.v2.GcRule result) {
    +      int from_bitField0_ = bitField0_;
    +    }
    +
    +    private void buildPartialOneofs(com.google.bigtable.admin.v2.GcRule result) {
    +      result.ruleCase_ = ruleCase_;
    +      result.rule_ = this.rule_;
    +      if (ruleCase_ == 2 && maxAgeBuilder_ != null) {
    +        result.rule_ = maxAgeBuilder_.build();
           }
    -      if (ruleCase_ == 3) {
    -        if (intersectionBuilder_ == null) {
    -          result.rule_ = rule_;
    -        } else {
    -          result.rule_ = intersectionBuilder_.build();
    -        }
    +      if (ruleCase_ == 3 && intersectionBuilder_ != null) {
    +        result.rule_ = intersectionBuilder_.build();
           }
    -      if (ruleCase_ == 4) {
    -        if (unionBuilder_ == null) {
    -          result.rule_ = rule_;
    -        } else {
    -          result.rule_ = unionBuilder_.build();
    -        }
    +      if (ruleCase_ == 4 && unionBuilder_ != null) {
    +        result.rule_ = unionBuilder_.build();
           }
    -      result.ruleCase_ = ruleCase_;
    -      onBuilt();
    -      return result;
         }
     
         @java.lang.Override
    @@ -2769,7 +2652,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 +2667,55 @@ 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(getMaxAgeFieldBuilder().getBuilder(), extensionRegistry);
    +                ruleCase_ = 2;
    +                break;
    +              } // case 18
    +            case 26:
    +              {
    +                input.readMessage(getIntersectionFieldBuilder().getBuilder(), extensionRegistry);
    +                ruleCase_ = 3;
    +                break;
    +              } // case 26
    +            case 34:
    +              {
    +                input.readMessage(getUnionFieldBuilder().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 +2733,8 @@ public Builder clearRule() {
           return this;
         }
     
    +    private int bitField0_;
    +
         /**
          *
          *
    @@ -2856,6 +2779,7 @@ public int getMaxNumVersions() {
          * @return This builder for chaining.
          */
         public Builder setMaxNumVersions(int value) {
    +
           ruleCase_ = 1;
           rule_ = value;
           onChanged();
    @@ -3000,8 +2924,9 @@ 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;
    @@ -3099,7 +3024,6 @@ public com.google.protobuf.DurationOrBuilder getMaxAgeOrBuilder() {
           }
           ruleCase_ = 2;
           onChanged();
    -      ;
           return maxAgeBuilder_;
         }
     
    @@ -3215,8 +3139,9 @@ 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;
    @@ -3308,7 +3233,6 @@ public com.google.bigtable.admin.v2.GcRule.IntersectionOrBuilder getIntersection
           }
           ruleCase_ = 3;
           onChanged();
    -      ;
           return intersectionBuilder_;
         }
     
    @@ -3423,8 +3347,9 @@ 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;
    @@ -3516,7 +3441,6 @@ public com.google.bigtable.admin.v2.GcRule.UnionOrBuilder getUnionOrBuilder() {
           }
           ruleCase_ = 4;
           onChanged();
    -      ;
           return unionBuilder_;
         }
     
    @@ -3552,7 +3476,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..aabc299b1d 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/table.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface GcRuleOrBuilder
    @@ -159,5 +160,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 71ac0bd158..084893760a 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -49,55 +50,6 @@ 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;
    @@ -114,13 +66,15 @@ 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}`.
        * 
    * @@ -146,8 +100,8 @@ public 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}`.
        * 
    * @@ -187,7 +141,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -199,7 +153,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -216,7 +170,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 +183,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; } @@ -360,24 +314,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) { 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,11 +353,21 @@ 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; } + private void buildPartial0( + com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -460,9 +417,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 +435,49 @@ 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}`.
          * 
    * @@ -523,8 +502,8 @@ public 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}`.
          * 
    * @@ -549,8 +528,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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,8 +544,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -574,8 +553,8 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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,8 +565,8 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -595,8 +574,8 @@ public Builder clearName() { * * *
    -     * 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,8 +591,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -651,7 +630,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..95aa4b7a85 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface GenerateConsistencyTokenRequestOrBuilder @@ -27,8 +28,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}`.
        * 
    * @@ -43,8 +44,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}`.
        * 
    * 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 e18a65c5f8..f98e94c1eb 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -49,55 +50,6 @@ 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; @@ -114,7 +66,9 @@ 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_ = ""; /** * * @@ -179,7 +133,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(consistencyToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, consistencyToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -191,7 +145,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(consistencyToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, consistencyToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -208,7 +162,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 +175,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; } @@ -352,24 +306,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) { 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,11 +345,21 @@ 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; } + private void buildPartial0( + com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.consistencyToken_ = consistencyToken_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -452,9 +409,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,22 +427,42 @@ 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_ = ""; /** * @@ -546,8 +524,8 @@ public Builder setConsistencyToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - consistencyToken_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -563,8 +541,8 @@ 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,8 +563,8 @@ public Builder setConsistencyTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - consistencyToken_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -624,7 +602,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..835f1ce7ee 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface GenerateConsistencyTokenResponseOrBuilder 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 cadb812b2f..2fa64a79ad 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,55 +48,6 @@ 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; @@ -112,13 +64,15 @@ 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}`.
        * 
    * * @@ -143,8 +97,8 @@ public 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}`.
        * 
    * * @@ -183,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -195,7 +149,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +166,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 +179,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; } @@ -354,24 +308,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) { 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,11 +346,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.GetAppProfileRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -452,9 +408,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 +426,49 @@ 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}`.
          * 
    * * @@ -514,8 +492,8 @@ public 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}`.
          * 
    * * @@ -539,8 +517,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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,8 +532,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -563,8 +541,8 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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,8 +552,8 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -583,8 +561,8 @@ public Builder clearName() { * * *
    -     * 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,8 +577,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -637,7 +615,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..eae1526717 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface GetAppProfileRequestOrBuilder @@ -27,8 +28,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}`.
        * 
    * * @@ -42,8 +43,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}`.
        * 
    * * 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..8c97ab9724 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequest.java @@ -0,0 +1,833 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class GetAuthorizedViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.GetAuthorizedViewRequest) + GetAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetAuthorizedViewRequest.newBuilder() to construct. + private GetAuthorizedViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetAuthorizedViewRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetAuthorizedViewRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..1d1a9beba8 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GetAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 336ff44107..4d463dd57a 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 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. @@ -16,13 +16,15 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** * * *
    - * 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} @@ -47,55 +49,6 @@ 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; @@ -112,7 +65,9 @@ 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_ = ""; /** * * @@ -185,7 +140,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -197,7 +152,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -214,7 +169,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 +182,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; } @@ -331,7 +286,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
    -   * 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} @@ -356,24 +312,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) { 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,11 +350,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.GetBackupRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -453,9 +411,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,20 +429,42 @@ 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_ = ""; /** * @@ -557,8 +538,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -578,8 +559,8 @@ 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,8 +585,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -642,7 +623,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..9cae714e95 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface GetBackupRequestOrBuilder 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 1d47f49619..101c34028f 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,55 +48,6 @@ 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; @@ -112,7 +64,9 @@ 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_ = ""; /** * * @@ -183,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -195,7 +149,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +166,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 +179,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; } @@ -354,24 +308,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) { 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,11 +346,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.GetClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -451,9 +407,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,20 +425,42 @@ 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_ = ""; /** * @@ -552,8 +531,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -572,8 +551,8 @@ 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,8 +576,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -635,7 +614,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..2c58871fec 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface GetClusterRequestOrBuilder 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 b087686ec6..f71e880269 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,55 +48,6 @@ 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; @@ -112,7 +64,9 @@ 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_ = ""; /** * * @@ -183,7 +137,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -195,7 +149,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -212,7 +166,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 +179,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; } @@ -354,24 +308,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) { 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,11 +346,20 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.GetInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -452,9 +408,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,20 +426,42 @@ 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_ = ""; /** * @@ -553,8 +532,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -573,8 +552,8 @@ 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,8 +577,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -636,7 +615,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..faf9704fe0 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface GetInstanceRequestOrBuilder 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 becfdcb4c9..a28a0ca445 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -24,6 +25,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
    @@ -52,55 +54,6 @@ 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;
    @@ -117,7 +70,9 @@ 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_ = "";
       /**
        *
        *
    @@ -190,7 +145,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -202,7 +157,7 @@ public int getSerializedSize() {
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -219,7 +174,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 +187,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;
       }
    @@ -338,6 +293,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        * 
        * 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
    @@ -366,24 +322,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) {
           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,11 +360,20 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.GetSnapshotRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -464,9 +422,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,20 +440,42 @@ 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_ = "";
         /**
          *
    @@ -568,8 +549,8 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -589,8 +570,8 @@ 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,8 +596,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -653,7 +634,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..08dee78166 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface GetSnapshotRequestOrBuilder
    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 330519453e..dc5ec04629 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -49,62 +50,6 @@ 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;
    @@ -121,7 +66,9 @@ 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_ = "";
       /**
        *
        *
    @@ -178,7 +125,7 @@ public com.google.protobuf.ByteString getNameBytes() {
       }
     
       public static final int VIEW_FIELD_NUMBER = 2;
    -  private int view_;
    +  private int view_ = 0;
       /**
        *
        *
    @@ -209,9 +156,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;
       }
     
    @@ -235,7 +181,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         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
    @@ -250,7 +196,7 @@ public int getSerializedSize() {
         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 +214,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 +229,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;
       }
    @@ -413,26 +359,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) {
           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,12 +398,23 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.GetTableRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.view_ = view_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -513,12 +462,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,20 +483,48 @@ 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_ = "";
         /**
          *
    @@ -620,8 +598,8 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -641,8 +619,8 @@ 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,8 +645,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -704,8 +682,8 @@ public int getViewValue() {
          * @return This builder for chaining.
          */
         public Builder setViewValue(int value) {
    -
           view_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -723,9 +701,8 @@ 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,7 +722,7 @@ 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,7 +740,7 @@ 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;
    @@ -801,7 +778,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..e418e715af 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface GetTableRequestOrBuilder
    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..75ed4ebd78
    --- /dev/null
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTablet.java
    @@ -0,0 +1,1852 @@
    +/*
    + * 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.
    + */
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// source: google/bigtable/admin/v2/instance.proto
    +
    +// Protobuf Java Version: 3.25.5
    +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} + */ +public final class HotTablet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.HotTablet) + HotTabletOrBuilder { + private static final long serialVersionUID = 0L; + // Use HotTablet.newBuilder() to construct. + private HotTablet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HotTablet() { + name_ = ""; + tableName_ = ""; + startKey_ = ""; + endKey_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HotTablet(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(startKey_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, startKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endKey_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(startKey_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, startKey_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(endKey_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @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 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.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 (other.getNodeCpuUsagePercent() != 0F) { + 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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 getStartTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; + } + + @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.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..6b32140615 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/HotTabletOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/instance.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 dec50fb9b7..445ec100ad 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -53,105 +54,6 @@ 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; - } - case 58: - { - 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; - } - 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; @@ -159,7 +61,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 5: return internalGetLabels(); @@ -376,13 +279,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; @@ -418,13 +316,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; @@ -514,8 +407,11 @@ 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_ = ""; /** * * @@ -524,7 +420,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. */ @@ -548,7 +444,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. */ @@ -566,7 +462,9 @@ 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_ = ""; /** * * @@ -619,7 +517,7 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { } public static final int STATE_FIELD_NUMBER = 3; - private int state_; + private int state_ = 0; /** * * @@ -650,14 +548,13 @@ public int getStateValue() { */ @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; /** * * @@ -686,9 +583,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; } @@ -705,6 +601,7 @@ private static final class LabelsDefaultEntryHolder { ""); } + @SuppressWarnings("serial") private com.google.protobuf.MapField labels_; private com.google.protobuf.MapField internalGetLabels() { @@ -725,6 +622,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -738,7 +636,7 @@ 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); } @@ -756,6 +654,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -778,6 +677,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -789,9 +689,12 @@ 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; @@ -804,6 +707,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -817,7 +721,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)) { @@ -832,9 +736,9 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { * * *
    -   * Output only. A server-assigned timestamp representing when this Instance was created.
    -   * For instances created before this field was added (August 2021), this value
    -   * is `seconds: 0, nanos: 1`.
    +   * Output only. A server-assigned 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]; @@ -844,15 +748,15 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { */ @java.lang.Override public boolean hasCreateTime() { - return createTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * * *
    -   * Output only. A server-assigned timestamp representing when this Instance was created.
    -   * For instances created before this field was added (August 2021), this value
    -   * is `seconds: 0, nanos: 1`.
    +   * Output only. A server-assigned 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]; @@ -868,9 +772,9 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
    -   * Output only. A server-assigned timestamp representing when this Instance was created.
    -   * For instances created before this field was added (August 2021), this value
    -   * is `seconds: 0, nanos: 1`.
    +   * Output only. A server-assigned 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]; @@ -878,7 +782,40 @@ public com.google.protobuf.Timestamp getCreateTime() { */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { - return getCreateTime(); + 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_; } private byte memoizedIsInitialized = -1; @@ -909,10 +846,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(7, getCreateTime()); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000002) != 0)) { + output.writeBool(8, satisfiesPzs_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -943,10 +883,13 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, labels__); } - if (createTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getCreateTime()); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, satisfiesPzs_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -970,7 +913,11 @@ public boolean equals(final java.lang.Object obj) { if (hasCreateTime()) { if (!getCreateTime().equals(other.getCreateTime())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (hasSatisfiesPzs() != other.hasSatisfiesPzs()) return false; + if (hasSatisfiesPzs()) { + if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -997,7 +944,11 @@ public int hashCode() { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + if (hasSatisfiesPzs()) { + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); + } + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1118,7 +1069,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 5: return internalGetLabels(); @@ -1128,7 +1080,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 5: return internalGetMutableLabels(); @@ -1158,27 +1111,26 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; name_ = ""; - displayName_ = ""; - state_ = 0; - type_ = 0; - internalGetMutableLabels().clear(); - if (createTimeBuilder_ == null) { - createTime_ = null; - } else { - createTime_ = null; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } + satisfiesPzs_ = false; return this; } @@ -1206,22 +1158,43 @@ 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 (createTimeBuilder_ == null) { - result.createTime_ = createTime_; - } else { - result.createTime_ = createTimeBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } onBuilt(); return result; } + private void buildPartial0(com.google.bigtable.admin.v2.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.displayName_ = displayName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.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; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -1269,10 +1242,12 @@ 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) { @@ -1282,10 +1257,14 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Instance other) { setTypeValue(other.getTypeValue()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000010; if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } - this.mergeUnknownFields(other.unknownFields); + if (other.hasSatisfiesPzs()) { + setSatisfiesPzs(other.getSatisfiesPzs()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1300,17 +1279,79 @@ 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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 58 + case 64: + { + satisfiesPzs_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 64 + default: + { + 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; } @@ -1325,7 +1366,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. */ @@ -1348,7 +1389,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. */ @@ -1371,7 +1412,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. @@ -1380,8 +1421,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1393,13 +1434,13 @@ 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; } @@ -1411,7 +1452,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. @@ -1421,8 +1462,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1494,8 +1535,8 @@ public Builder setDisplayName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - displayName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1513,8 +1554,8 @@ public Builder setDisplayName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDisplayName() { - displayName_ = getDefaultInstance().getDisplayName(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -1537,8 +1578,8 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - displayName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1574,8 +1615,8 @@ public int getStateValue() { * @return This builder for chaining. */ public Builder setStateValue(int value) { - state_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1593,9 +1634,8 @@ public Builder setStateValue(int value) { */ @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; } /** @@ -1615,7 +1655,7 @@ 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; @@ -1633,7 +1673,7 @@ public Builder setState(com.google.bigtable.admin.v2.Instance.State value) { * @return This builder for chaining. */ public Builder clearState() { - + bitField0_ = (bitField0_ & ~0x00000004); state_ = 0; onChanged(); return this; @@ -1668,8 +1708,8 @@ public int getTypeValue() { * @return This builder for chaining. */ public Builder setTypeValue(int value) { - type_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1686,9 +1726,8 @@ 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; } /** @@ -1707,7 +1746,7 @@ 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; @@ -1724,7 +1763,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; @@ -1741,14 +1780,14 @@ 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_; } @@ -1763,6 +1802,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1776,7 +1816,7 @@ 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); } @@ -1794,6 +1834,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1816,6 +1857,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1827,10 +1869,12 @@ 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; @@ -1843,6 +1887,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1856,7 +1901,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)) { @@ -1866,6 +1911,7 @@ public java.lang.String getLabelsOrThrow(java.lang.String key) { } public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000010); internalGetMutableLabels().getMutableMap().clear(); return this; } @@ -1877,6 +1923,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1889,7 +1936,7 @@ 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; @@ -1897,6 +1944,7 @@ public Builder removeLabels(java.lang.String key) { /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000010; return internalGetMutableLabels().getMutableMap(); } /** @@ -1907,6 +1955,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1919,12 +1968,13 @@ 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; } /** @@ -1935,6 +1985,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -1947,6 +1998,7 @@ 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; } @@ -1960,9 +2012,9 @@ public Builder putAllLabels(java.util.Map va * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -1972,15 +2024,15 @@ public Builder putAllLabels(java.util.Map va * @return Whether the createTime field is set. */ public boolean hasCreateTime() { - return createTimeBuilder_ != null || createTime_ != null; + return ((bitField0_ & 0x00000020) != 0); } /** * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2002,9 +2054,9 @@ public com.google.protobuf.Timestamp getCreateTime() { * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2017,20 +2069,20 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } /** * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2040,20 +2092,20 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (createTimeBuilder_ == null) { createTime_ = builderForValue.build(); - onChanged(); } else { createTimeBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000020; + onChanged(); return this; } /** * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2062,26 +2114,29 @@ public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForVal */ 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_ & 0x00000020) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); } else { createTime_ = value; } - onChanged(); } else { createTimeBuilder_.mergeFrom(value); } - + if (createTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } return this; } /** * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2089,23 +2144,22 @@ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { * */ public Builder clearCreateTime() { - if (createTimeBuilder_ == null) { - createTime_ = null; - onChanged(); - } else { - createTime_ = null; + bitField0_ = (bitField0_ & ~0x00000020); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); createTimeBuilder_ = null; } - + onChanged(); return this; } /** * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2113,7 +2167,7 @@ public Builder clearCreateTime() { * */ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { - + bitField0_ |= 0x00000020; onChanged(); return getCreateTimeFieldBuilder().getBuilder(); } @@ -2121,9 +2175,9 @@ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2143,9 +2197,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
    -     * Output only. A server-assigned timestamp representing when this Instance was created.
    -     * For instances created before this field was added (August 2021), this value
    -     * is `seconds: 0, nanos: 1`.
    +     * Output only. A server-assigned timestamp representing when this Instance
    +     * was created. For instances created before this field was added (August
    +     * 2021), this value is `seconds: 0, nanos: 1`.
          * 
    * * @@ -2169,6 +2223,74 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 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; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -2201,7 +2323,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 e7347515a3..16b4648ff0 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 2021 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. @@ -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); 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 6de580202b..9f09ebb418 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface InstanceOrBuilder @@ -31,7 +32,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 name. */ @@ -44,7 +45,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. */ @@ -139,6 +140,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -158,6 +160,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -180,6 +183,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -199,6 +203,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -209,7 +214,11 @@ public interface InstanceOrBuilder * * 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,6 +227,7 @@ 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}`. * * Label values must be between 0 and 63 characters long and must conform to @@ -234,9 +244,9 @@ public interface InstanceOrBuilder * * *
    -   * Output only. A server-assigned timestamp representing when this Instance was created.
    -   * For instances created before this field was added (August 2021), this value
    -   * is `seconds: 0, nanos: 1`.
    +   * Output only. A server-assigned 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]; @@ -249,9 +259,9 @@ public interface InstanceOrBuilder * * *
    -   * Output only. A server-assigned timestamp representing when this Instance was created.
    -   * For instances created before this field was added (August 2021), this value
    -   * is `seconds: 0, nanos: 1`.
    +   * Output only. A server-assigned 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]; @@ -264,13 +274,38 @@ public interface InstanceOrBuilder * * *
    -   * Output only. A server-assigned timestamp representing when this Instance was created.
    -   * For instances created before this field was added (August 2021), this value
    -   * is `seconds: 0, nanos: 1`.
    +   * Output only. A server-assigned 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(); } 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 4deb3934c3..600ca884a1 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/instance.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public final class InstanceProto { @@ -67,10 +68,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_HotTablet_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -84,71 +101,109 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "o\022\030google.bigtable.admin.v2\032\037google/api/" + "field_behavior.proto\032\031google/api/resourc" + "e.proto\032%google/bigtable/admin/v2/common" - + ".proto\032\037google/protobuf/timestamp.proto\032" - + "\034google/api/annotations.proto\"\230\004\n\010Instan" - + "ce\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(\0162(.google.bigtabl" - + "e.admin.v2.Instance.State\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\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\005R" - + "EADY\020\001\022\014\n\010CREATING\020\002\"=\n\004Type\022\024\n\020TYPE_UNS" - + "PECIFIED\020\000\022\016\n\nPRODUCTION\020\001\022\017\n\013DEVELOPMEN" - + "T\020\002:S\352AP\n%bigtableadmin.googleapis.com/I" - + "nstance\022\'projects/{project}/instances/{i" - + "nstance}\"5\n\022AutoscalingTargets\022\037\n\027cpu_ut" - + "ilization_percent\030\002 \001(\005\"O\n\021AutoscalingLi" - + "mits\022\034\n\017min_serve_nodes\030\001 \001(\005B\003\340A\002\022\034\n\017ma" - + "x_serve_nodes\030\002 \001(\005B\003\340A\002\"\316\007\n\007Cluster\022\021\n\004" - + "name\030\001 \001(\tB\003\340A\003\0228\n\010location\030\002 \001(\tB&\372A#\n!" - + "locations.googleapis.com/Location\022;\n\005sta" - + "te\030\003 \001(\0162\'.google.bigtable.admin.v2.Clus" - + "ter.StateB\003\340A\003\022\023\n\013serve_nodes\030\004 \001(\005\022I\n\016c" - + "luster_config\030\007 \001(\0132/.google.bigtable.ad" - + "min.v2.Cluster.ClusterConfigH\000\022C\n\024defaul" - + "t_storage_type\030\005 \001(\0162%.google.bigtable.a" - + "dmin.v2.StorageType\022R\n\021encryption_config" - + "\030\006 \001(\01322.google.bigtable.admin.v2.Cluste" - + "r.EncryptionConfigB\003\340A\005\032\270\001\n\030ClusterAutos" - + "calingConfig\022L\n\022autoscaling_limits\030\001 \001(\013" - + "2+.google.bigtable.admin.v2.AutoscalingL" - + "imitsB\003\340A\002\022N\n\023autoscaling_targets\030\002 \001(\0132" - + ",.google.bigtable.admin.v2.AutoscalingTa" - + "rgetsB\003\340A\002\032o\n\rClusterConfig\022^\n\032cluster_a" - + "utoscaling_config\030\001 \001(\0132:.google.bigtabl" - + "e.admin.v2.Cluster.ClusterAutoscalingCon" - + "fig\032P\n\020EncryptionConfig\022<\n\014kms_key_name\030" - + "\001 \001(\tB&\372A#\n!cloudkms.googleapis.com/Cryp" - + "toKey\"Q\n\005State\022\023\n\017STATE_NOT_KNOWN\020\000\022\t\n\005R" - + "EADY\020\001\022\014\n\010CREATING\020\002\022\014\n\010RESIZING\020\003\022\014\n\010DI" - + "SABLED\020\004:e\352Ab\n$bigtableadmin.googleapis." - + "com/Cluster\022:projects/{project}/instance" - + "s/{instance}/clusters/{cluster}B\010\n\006confi" - + "g\"\210\004\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_clust" - + "er_routing_use_any\030\005 \001(\0132>.google.bigtab" - + "le.admin.v2.AppProfile.MultiClusterRouti" - + "ngUseAnyH\000\022[\n\026single_cluster_routing\030\006 \001" - + "(\01329.google.bigtable.admin.v2.AppProfile" - + ".SingleClusterRoutingH\000\0320\n\031MultiClusterR" - + "outingUseAny\022\023\n\013cluster_ids\030\001 \003(\t\032N\n\024Sin" - + "gleClusterRouting\022\022\n\ncluster_id\030\001 \001(\t\022\"\n" - + "\032allow_transactional_writes\030\002 \001(\010:o\352Al\n\'" - + "bigtableadmin.googleapis.com/AppProfile\022" - + "Aprojects/{project}/instances/{instance}" - + "/appProfiles/{app_profile}B\020\n\016routing_po" - + "licyB\320\002\n\034com.google.bigtable.admin.v2B\rI" - + "nstanceProtoP\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\352Ax\n!cloudkms.google" - + "apis.com/CryptoKey\022Sprojects/{project}/l" - + "ocations/{location}/keyRings/{key_ring}/" - + "cryptoKeys/{crypto_key}b\006proto3" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\306\004\n\010Instance\022\014\n\004name\030\001 \001(\t\022\031\n\014display_na" + + "me\030\002 \001(\tB\003\340A\002\0227\n\005state\030\003 \001(\0162(.google.bi" + + "gtable.admin.v2.Instance.State\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\rsatisfies_pzs\030\010 \001(\010B\003\340A\003H\000\210\001\001\032-\n\013" + + "LabelsEntry\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\005REA" + + "DY\020\001\022\014\n\010CREATING\020\002\"=\n\004Type\022\024\n\020TYPE_UNSPE" + + "CIFIED\020\000\022\016\n\nPRODUCTION\020\001\022\017\n\013DEVELOPMENT\020" + + "\002:S\352AP\n%bigtableadmin.googleapis.com/Ins" + + "tance\022\'projects/{project}/instances/{ins" + + "tance}B\020\n\016_satisfies_pzs\"_\n\022AutoscalingT" + + "argets\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_node" + + "s\030\001 \001(\005B\003\340A\002\022\034\n\017max_serve_nodes\030\002 \001(\005B\003\340" + + "A\002\"\232\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.bigtab" + + "le.admin.v2.Cluster.StateB\003\340A\003\022\023\n\013serve_" + + "nodes\030\004 \001(\005\022U\n\023node_scaling_factor\030\t \001(\016" + + "23.google.bigtable.admin.v2.Cluster.Node" + + "ScalingFactorB\003\340A\005\022I\n\016cluster_config\030\007 \001" + + "(\0132/.google.bigtable.admin.v2.Cluster.Cl" + + "usterConfigH\000\022H\n\024default_storage_type\030\005 " + + "\001(\0162%.google.bigtable.admin.v2.StorageTy" + + "peB\003\340A\005\022R\n\021encryption_config\030\006 \001(\01322.goo" + + "gle.bigtable.admin.v2.Cluster.Encryption" + + "ConfigB\003\340A\005\032\270\001\n\030ClusterAutoscalingConfig" + + "\022L\n\022autoscaling_limits\030\001 \001(\0132+.google.bi" + + "gtable.admin.v2.AutoscalingLimitsB\003\340A\002\022N" + + "\n\023autoscaling_targets\030\002 \001(\0132,.google.big" + + "table.admin.v2.AutoscalingTargetsB\003\340A\002\032o" + + "\n\rClusterConfig\022^\n\032cluster_autoscaling_c" + + "onfig\030\001 \001(\0132:.google.bigtable.admin.v2.C" + + "luster.ClusterAutoscalingConfig\032P\n\020Encry" + + "ptionConfig\022<\n\014kms_key_name\030\001 \001(\tB&\372A#\n!" + + "cloudkms.googleapis.com/CryptoKey\"Q\n\005Sta" + + "te\022\023\n\017STATE_NOT_KNOWN\020\000\022\t\n\005READY\020\001\022\014\n\010CR" + + "EATING\020\002\022\014\n\010RESIZING\020\003\022\014\n\010DISABLED\020\004\"p\n\021" + + "NodeScalingFactor\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:e\352Ab\n$big" + + "tableadmin.googleapis.com/Cluster\022:proje" + + "cts/{project}/instances/{instance}/clust" + + "ers/{cluster}B\010\n\006config\"\322\n\n\nAppProfile\022\014" + + "\n\004name\030\001 \001(\t\022\014\n\004etag\030\002 \001(\t\022\023\n\013descriptio" + + "n\030\003 \001(\t\022g\n\035multi_cluster_routing_use_any" + + "\030\005 \001(\0132>.google.bigtable.admin.v2.AppPro" + + "file.MultiClusterRoutingUseAnyH\000\022[\n\026sing" + + "le_cluster_routing\030\006 \001(\01329.google.bigtab" + + "le.admin.v2.AppProfile.SingleClusterRout" + + "ingH\000\022E\n\010priority\030\007 \001(\0162-.google.bigtabl" + + "e.admin.v2.AppProfile.PriorityB\002\030\001H\001\022T\n\022" + + "standard_isolation\030\013 \001(\01326.google.bigtab" + + "le.admin.v2.AppProfile.StandardIsolation" + + "H\001\022i\n\036data_boost_isolation_read_only\030\n \001" + + "(\0132?.google.bigtable.admin.v2.AppProfile" + + ".DataBoostIsolationReadOnlyH\001\032\257\001\n\031MultiC" + + "lusterRoutingUseAny\022\023\n\013cluster_ids\030\001 \003(\t" + + "\022b\n\014row_affinity\030\003 \001(\0132J.google.bigtable" + + ".admin.v2.AppProfile.MultiClusterRouting" + + "UseAny.RowAffinityH\000\032\r\n\013RowAffinityB\n\n\010a" + + "ffinity\032N\n\024SingleClusterRouting\022\022\n\nclust" + + "er_id\030\001 \001(\t\022\"\n\032allow_transactional_write" + + "s\030\002 \001(\010\032T\n\021StandardIsolation\022?\n\010priority" + + "\030\001 \001(\0162-.google.bigtable.admin.v2.AppPro" + + "file.Priority\032\374\001\n\032DataBoostIsolationRead" + + "Only\022w\n\025compute_billing_owner\030\001 \001(\0162S.go" + + "ogle.bigtable.admin.v2.AppProfile.DataBo" + + "ostIsolationReadOnly.ComputeBillingOwner" + + "H\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_L" + + "OW\020\001\022\023\n\017PRIORITY_MEDIUM\020\002\022\021\n\rPRIORITY_HI" + + "GH\020\003:o\352Al\n\'bigtableadmin.googleapis.com/" + + "AppProfile\022Aprojects/{project}/instances" + + "/{instance}/appProfiles/{app_profile}B\020\n" + + "\016routing_policyB\013\n\tisolation\"\210\003\n\tHotTabl" + + "et\022\014\n\004name\030\001 \001(\t\022;\n\ntable_name\030\002 \001(\tB\'\372A" + + "$\n\"bigtableadmin.googleapis.com/Table\0223\n" + + "\nstart_time\030\003 \001(\0132\032.google.protobuf.Time" + + "stampB\003\340A\003\0221\n\010end_time\030\004 \001(\0132\032.google.pr" + + "otobuf.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_perc" + + "ent\030\007 \001(\002B\003\340A\003:\177\352A|\n&bigtableadmin.googl" + + "eapis.com/HotTablet\022Rprojects/{project}/" + + "instances/{instance}/clusters/{cluster}/" + + "hotTablets/{hot_tablet}B\313\002\n\034com.google.b" + + "igtable.admin.v2B\rInstanceProtoP\001Z8cloud" + + ".google.com/go/bigtable/admin/apiv2/admi" + + "npb;adminpb\252\002\036Google.Cloud.Bigtable.Admi" + + "n.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"" + + "Google::Cloud::Bigtable::Admin::V2\352Ax\n!c" + + "loudkms.googleapis.com/CryptoKey\022Sprojec" + + "ts/{project}/locations/{location}/keyRin" + + "gs/{key_ring}/cryptoKeys/{crypto_key}b\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -158,7 +213,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.bigtable.admin.v2.CommonProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_bigtable_admin_v2_Instance_descriptor = getDescriptor().getMessageTypes().get(0); @@ -166,7 +220,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Instance_descriptor, new java.lang.String[] { - "Name", "DisplayName", "State", "Type", "Labels", "CreateTime", + "Name", "DisplayName", "State", "Type", "Labels", "CreateTime", "SatisfiesPzs", }); internal_static_google_bigtable_admin_v2_Instance_LabelsEntry_descriptor = internal_static_google_bigtable_admin_v2_Instance_descriptor.getNestedTypes().get(0); @@ -182,7 +236,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_AutoscalingTargets_descriptor, new java.lang.String[] { - "CpuUtilizationPercent", + "CpuUtilizationPercent", "StorageUtilizationGibPerNode", }); internal_static_google_bigtable_admin_v2_AutoscalingLimits_descriptor = getDescriptor().getMessageTypes().get(2); @@ -202,6 +256,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Location", "State", "ServeNodes", + "NodeScalingFactor", "ClusterConfig", "DefaultStorageType", "EncryptionConfig", @@ -242,7 +297,11 @@ 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); @@ -250,8 +309,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor, new java.lang.String[] { - "ClusterIds", + "ClusterIds", "RowAffinity", "Affinity", }); + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_descriptor + .getNestedTypes() + .get(0); + internal_static_google_bigtable_admin_v2_AppProfile_MultiClusterRoutingUseAny_RowAffinity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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_SingleClusterRouting_fieldAccessorTable = @@ -260,6 +327,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ClusterId", "AllowTransactionalWrites", }); + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_descriptor = + internal_static_google_bigtable_admin_v2_AppProfile_descriptor.getNestedTypes().get(2); + internal_static_google_bigtable_admin_v2_AppProfile_StandardIsolation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(3); + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_AppProfile_DataBoostIsolationReadOnly_descriptor, + new java.lang.String[] { + "ComputeBillingOwner", + }); + internal_static_google_bigtable_admin_v2_HotTablet_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_bigtable_admin_v2_HotTablet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_HotTablet_descriptor, + new java.lang.String[] { + "Name", + "TableName", + "StartTime", + "EndTime", + "StartKey", + "EndKey", + "NodeCpuUsagePercent", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); @@ -272,7 +369,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.bigtable.admin.v2.CommonProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.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 ce53228609..2cd837d80f 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -48,67 +49,6 @@ 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; @@ -125,13 +65,15 @@ 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/-`.
    @@ -159,8 +101,8 @@ public 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/-`.
    @@ -186,15 +128,17 @@ 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 +154,9 @@ 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_ = "";
       /**
        *
        *
    @@ -281,7 +227,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (pageSize_ != 0) {
           output.writeInt32(3, pageSize_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -299,7 +245,7 @@ public int getSerializedSize() {
         if (pageSize_ != 0) {
           size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -318,7 +264,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 +281,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;
       }
    @@ -464,28 +410,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) {
           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,13 +450,26 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.ListAppProfilesRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.parent_ = parent_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.pageSize_ = pageSize_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.pageToken_ = pageToken_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -568,6 +518,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 +526,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 +544,61 @@ 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/-`.
    @@ -640,8 +625,8 @@ public 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/-`.
    @@ -668,8 +653,8 @@ public com.google.protobuf.ByteString getParentBytes() {
          *
          *
          * 
    -     * 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,8 +671,8 @@ public Builder setParent(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -695,8 +680,8 @@ public Builder setParent(java.lang.String value) {
          *
          *
          * 
    -     * 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,8 +694,8 @@ public Builder setParent(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearParent() {
    -
           parent_ = getDefaultInstance().getParent();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    @@ -718,8 +703,8 @@ public Builder clearParent() {
          *
          *
          * 
    -     * 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,8 +722,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -749,9 +734,11 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
          *
          * 
          * 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.
    @@ -770,9 +757,11 @@ public int getPageSize() {
          *
          * 
          * 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,6 +775,7 @@ public int getPageSize() {
         public Builder setPageSize(int value) {
     
           pageSize_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -794,9 +784,11 @@ public Builder setPageSize(int value) {
          *
          * 
          * 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,7 +799,7 @@ public Builder setPageSize(int value) {
          * @return This builder for chaining.
          */
         public Builder clearPageSize() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000002);
           pageSize_ = 0;
           onChanged();
           return this;
    @@ -874,8 +866,8 @@ public Builder setPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -891,8 +883,8 @@ 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,8 +905,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -951,7 +943,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..059c2ead1a 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_instance_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface ListAppProfilesRequestOrBuilder
    @@ -27,8 +28,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/-`.
    @@ -45,8 +46,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/-`.
    @@ -65,9 +66,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.
    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 4533e82726..00808de5bc 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_instance_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -40,7 +41,7 @@ private ListAppProfilesResponse(com.google.protobuf.GeneratedMessageV3.Builder();
    -                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();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableInstanceAdminProto
             .internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor;
    @@ -142,6 +66,8 @@ 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_;
       /**
        *
    @@ -211,7 +137,9 @@ 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_ = "";
       /**
        *
        *
    @@ -264,7 +192,10 @@ 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();
       /**
        *
        *
    @@ -359,7 +290,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         for (int i = 0; i < failedLocations_.size(); i++) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 3, failedLocations_.getRaw(i));
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -382,7 +313,7 @@ public int getSerializedSize() {
           size += dataSize;
           size += 1 * getFailedLocationsList().size();
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -401,7 +332,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 +353,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;
       }
    @@ -551,34 +482,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) {
           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 +528,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,14 +547,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);
    +    }
    +
    +    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_;
           }
    -      result.failedLocations_ = failedLocations_;
    -      onBuilt();
    -      return result;
         }
     
         @java.lang.Override
    @@ -701,19 +635,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 +663,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;
         }
     
    @@ -1162,8 +1136,8 @@ public Builder setNextPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1181,8 +1155,8 @@ 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,20 +1179,20 @@ 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,7 +1209,8 @@ private void ensureFailedLocationsIsMutable() {
          * @return A list containing the failedLocations.
          */
         public com.google.protobuf.ProtocolStringList getFailedLocationsList() {
    -      return failedLocations_.getUnmodifiableView();
    +      failedLocations_.makeImmutable();
    +      return failedLocations_;
         }
         /**
          *
    @@ -1312,6 +1287,7 @@ public Builder setFailedLocations(int index, java.lang.String value) {
           }
           ensureFailedLocationsIsMutable();
           failedLocations_.set(index, value);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -1336,6 +1312,7 @@ public Builder addFailedLocations(java.lang.String value) {
           }
           ensureFailedLocationsIsMutable();
           failedLocations_.add(value);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -1357,6 +1334,7 @@ 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,8 +1353,9 @@ 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,6 +1381,7 @@ public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) {
           checkByteStringIsUtf8(value);
           ensureFailedLocationsIsMutable();
           failedLocations_.add(value);
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -1438,7 +1418,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..f875c9b0be 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_instance_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface ListAppProfilesResponseOrBuilder
    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..5d54dbb4e7
    --- /dev/null
    +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequest.java
    @@ -0,0 +1,1140 @@
    +/*
    + * 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.
    + */
    +// Generated by the protocol buffer compiler.  DO NOT EDIT!
    +// source: google/bigtable/admin/v2/bigtable_table_admin.proto
    +
    +// Protobuf Java Version: 3.25.5
    +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} + */ +public final class ListAuthorizedViewsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListAuthorizedViewsRequest) + ListAuthorizedViewsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAuthorizedViewsRequest.newBuilder() to construct. + private ListAuthorizedViewsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAuthorizedViewsRequest() { + parent_ = ""; + pageToken_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAuthorizedViewsRequest(); + } + + 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.GeneratedMessageV3.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 views' 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 views' 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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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 views' 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 views' 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 views' 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 views' 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 views' 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; + } + + @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.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..8aee7a7cdc --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsRequestOrBuilder.java @@ -0,0 +1,136 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 views' 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 views' 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..6a3ca716d2 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponse.java @@ -0,0 +1,1146 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class ListAuthorizedViewsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListAuthorizedViewsResponse) + ListAuthorizedViewsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAuthorizedViewsResponse.newBuilder() to construct. + private ListAuthorizedViewsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAuthorizedViewsResponse() { + authorizedViews_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAuthorizedViewsResponse(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAuthorizedViewsFieldBuilder() + : 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.RepeatedFieldBuilderV3< + 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 getAuthorizedViewsFieldBuilder().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 getAuthorizedViewsFieldBuilder() + .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 getAuthorizedViewsFieldBuilder() + .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 getAuthorizedViewsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + getAuthorizedViewsFieldBuilder() { + if (authorizedViewsBuilder_ == null) { + authorizedViewsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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; + } + + @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.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..e89788172d --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAuthorizedViewsResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 5972dcbb63..532f29b9fd 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 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. @@ -16,13 +16,15 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** * * *
    - * 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} @@ -50,81 +52,6 @@ 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; @@ -141,7 +68,9 @@ 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_ = ""; /** * * @@ -200,7 +129,9 @@ 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 +142,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; @@ -261,28 +197,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 +244,33 @@ 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.
        * 
    @@ -348,20 +296,25 @@ public 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.
        * 
    @@ -384,7 +337,7 @@ public com.google.protobuf.ByteString getOrderByBytes() { } public static final int PAGE_SIZE_FIELD_NUMBER = 4; - private int pageSize_; + private int pageSize_ = 0; /** * * @@ -403,15 +356,18 @@ 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; @@ -435,9 +391,10 @@ public 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; @@ -486,7 +443,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -510,7 +467,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -531,7 +488,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 +509,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; } @@ -656,7 +613,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
    -   * 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} @@ -681,32 +639,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) { 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,15 +681,32 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.ListBackupsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.orderBy_ = orderBy_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageToken_ = pageToken_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -791,14 +755,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 +773,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,20 +791,66 @@ 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_ = ""; /** * @@ -913,8 +927,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -935,8 +949,8 @@ 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,8 +976,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -979,28 +993,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; @@ -1028,28 +1047,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; @@ -1077,28 +1101,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,8 +1139,8 @@ public Builder setFilter(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1125,28 +1154,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,8 +1188,8 @@ 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 +1203,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,8 +1242,8 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - filter_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1215,20 +1254,25 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * *
          * 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.
          * 
    @@ -1253,20 +1297,25 @@ public 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.
          * 
    @@ -1291,20 +1340,25 @@ public com.google.protobuf.ByteString getOrderByBytes() { * *
          * 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,8 +1372,8 @@ public Builder setOrderBy(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - orderBy_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1328,20 +1382,25 @@ public Builder setOrderBy(java.lang.String value) { * *
          * 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,8 +1410,8 @@ public Builder setOrderBy(java.lang.String value) { * @return This builder for chaining. */ public Builder clearOrderBy() { - orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -1361,20 +1420,25 @@ public Builder clearOrderBy() { * *
          * 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,8 +1453,8 @@ public Builder setOrderByBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - orderBy_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1428,6 +1492,7 @@ public int getPageSize() { public Builder setPageSize(int value) { pageSize_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1444,7 +1509,7 @@ public Builder setPageSize(int value) { * @return This builder for chaining. */ public Builder clearPageSize() { - + bitField0_ = (bitField0_ & ~0x00000008); pageSize_ = 0; onChanged(); return this; @@ -1456,9 +1521,10 @@ public Builder clearPageSize() { * *
          * 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; @@ -1481,9 +1547,10 @@ public 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; @@ -1506,9 +1573,10 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * *
          * 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,8 +1588,8 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1530,9 +1598,10 @@ public Builder setPageToken(java.lang.String value) { * *
          * 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,8 +1609,8 @@ public Builder setPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearPageToken() { - pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } @@ -1550,9 +1619,10 @@ public Builder clearPageToken() { * *
          * 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,8 +1635,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1603,7 +1673,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..2c40307e8d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ListBackupsRequestOrBuilder @@ -68,28 +69,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; @@ -107,28 +113,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 +153,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.
        * 
    @@ -170,20 +186,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.
        * 
    @@ -213,9 +234,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; @@ -228,9 +250,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; 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 1b331ac6f5..bf645d5032 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 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. @@ -16,13 +16,15 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** * * *
    - * 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} @@ -48,70 +50,6 @@ 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; @@ -128,6 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int BACKUPS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List backups_; /** * @@ -197,14 +137,16 @@ 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; @@ -228,8 +170,8 @@ public 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; @@ -269,7 +211,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -284,7 +226,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -302,7 +244,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 +261,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; } @@ -423,7 +365,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
    -   * 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} @@ -448,32 +391,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) { 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 +436,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,9 +455,13 @@ public com.google.bigtable.admin.v2.ListBackupsResponse buildPartial() { } else { result.backups_ = backupsBuilder_.build(); } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; + } + + 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 @@ -591,9 +539,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 +557,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; } @@ -978,8 +960,8 @@ public java.util.List getBackupsBui * *
          * `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; @@ -1002,8 +984,8 @@ public 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; @@ -1026,8 +1008,8 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { * *
          * `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,8 +1021,8 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1049,8 +1031,8 @@ public Builder setNextPageToken(java.lang.String value) { * *
          * `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,8 +1040,8 @@ public Builder setNextPageToken(java.lang.String value) { * @return This builder for chaining. */ public Builder clearNextPageToken() { - nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -1068,8 +1050,8 @@ public Builder clearNextPageToken() { * *
          * `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,8 +1064,8 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - nextPageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1120,7 +1102,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..95217f1422 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ListBackupsResponseOrBuilder @@ -79,8 +80,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; @@ -93,8 +94,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; 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 2913acd14d..9a53662694 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -48,62 +49,6 @@ 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; @@ -120,15 +65,18 @@ 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/-`.
        * 
    * * @@ -153,10 +101,11 @@ public 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/-`.
        * 
    * * @@ -179,7 +128,9 @@ 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_ = ""; /** * * @@ -247,7 +198,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -262,7 +213,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -280,7 +231,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 +246,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; } @@ -424,26 +375,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) { 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,12 +414,23 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.ListClustersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -525,13 +479,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 +502,58 @@ 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/-`.
          * 
    * * @@ -592,10 +577,11 @@ public 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/-`.
          * 
    * * @@ -619,10 +605,11 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * 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,8 +623,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -645,10 +632,11 @@ public Builder setParent(java.lang.String value) { * * *
    -     * 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,8 +646,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -667,10 +655,11 @@ public Builder clearParent() { * * *
    -     * 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,8 +674,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -752,8 +741,8 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -769,8 +758,8 @@ 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,8 +780,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -829,7 +818,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..e634b1cd56 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ListClustersRequestOrBuilder @@ -27,10 +28,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/-`.
        * 
    * * @@ -44,10 +46,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/-`.
        * 
    * * 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 07f9a5a4c7..241ca55cca 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -39,7 +40,7 @@ private ListClustersResponse(com.google.protobuf.GeneratedMessageV3.Builder b private ListClustersResponse() { clusters_ = java.util.Collections.emptyList(); - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); nextPageToken_ = ""; } @@ -49,83 +50,6 @@ 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; @@ -142,6 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List clusters_; /** * @@ -211,7 +137,10 @@ 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(); /** * * @@ -288,7 +217,9 @@ 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_ = ""; /** * * @@ -359,7 +290,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -382,7 +313,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -401,7 +332,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 +353,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; } @@ -551,34 +482,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) { 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 +528,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,14 +547,17 @@ public com.google.bigtable.admin.v2.ListClustersResponse buildPartial() { } else { result.clusters_ = clustersBuilder_.build(); } - if (((bitField0_ & 0x00000002) != 0)) { - failedLocations_ = failedLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + } + + 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_; } - result.failedLocations_ = failedLocations_; - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; } @java.lang.Override @@ -702,7 +636,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 +645,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 +663,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; } @@ -1093,14 +1067,14 @@ 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,7 +1092,8 @@ private void ensureFailedLocationsIsMutable() { * @return A list containing the failedLocations. */ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { - return failedLocations_.getUnmodifiableView(); + failedLocations_.makeImmutable(); + return failedLocations_; } /** * @@ -1199,6 +1174,7 @@ public Builder setFailedLocations(int index, java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1224,6 +1200,7 @@ public Builder addFailedLocations(java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1246,6 +1223,7 @@ 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,8 +1243,9 @@ 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,6 +1272,7 @@ public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1358,8 +1338,8 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1375,8 +1355,8 @@ 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,8 +1377,8 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1435,7 +1415,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..8842d08074 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ListClustersResponseOrBuilder 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..5fe3a66942 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequest.java @@ -0,0 +1,1551 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * Request message for BigtableInstanceAdmin.ListHotTablets.
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.ListHotTabletsRequest} + */ +public final class ListHotTabletsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListHotTabletsRequest) + ListHotTabletsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHotTabletsRequest.newBuilder() to construct. + private ListHotTabletsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHotTabletsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHotTabletsRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @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 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.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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 getStartTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; + } + + @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.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..6936bb1c00 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsRequestOrBuilder.java @@ -0,0 +1,190 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..f533a928fd --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponse.java @@ -0,0 +1,1224 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * Response message for BigtableInstanceAdmin.ListHotTablets.
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.ListHotTabletsResponse} + */ +public final class ListHotTabletsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.ListHotTabletsResponse) + ListHotTabletsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListHotTabletsResponse.newBuilder() to construct. + private ListHotTabletsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListHotTabletsResponse() { + hotTablets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListHotTabletsResponse(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHotTabletsFieldBuilder() + : 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.RepeatedFieldBuilderV3< + 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 getHotTabletsFieldBuilder().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 getHotTabletsFieldBuilder() + .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 getHotTabletsFieldBuilder() + .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 getHotTabletsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.admin.v2.HotTablet, + com.google.bigtable.admin.v2.HotTablet.Builder, + com.google.bigtable.admin.v2.HotTabletOrBuilder> + getHotTabletsFieldBuilder() { + if (hotTabletsBuilder_ == null) { + hotTabletsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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; + } + + @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.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..fb82518ed0 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListHotTabletsResponseOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_instance_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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 1f5fa29dbb..a755bc85e1 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -48,62 +49,6 @@ 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; @@ -120,13 +65,15 @@ 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}`.
        * 
    * * @@ -151,8 +98,8 @@ public 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}`.
        * 
    * * @@ -175,7 +122,9 @@ 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_ = ""; /** * * @@ -243,7 +192,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -258,7 +207,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -276,7 +225,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 +240,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; } @@ -420,26 +369,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) { 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,12 +408,23 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -521,13 +473,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 +496,55 @@ 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}`.
          * 
    * * @@ -587,8 +568,8 @@ public 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}`.
          * 
    * * @@ -612,8 +593,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * 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,8 +608,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -636,8 +617,8 @@ public Builder setParent(java.lang.String value) { * * *
    -     * 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,8 +628,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -656,8 +637,8 @@ public Builder clearParent() { * * *
    -     * 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,8 +653,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -739,8 +720,8 @@ public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -756,8 +737,8 @@ 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,8 +759,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - pageToken_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -816,7 +797,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..496a1e0f88 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ListInstancesRequestOrBuilder @@ -27,8 +28,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}`.
        * 
    * * @@ -42,8 +43,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}`.
        * 
    * * 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 eb1410fc9e..30e8855b97 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -39,7 +40,7 @@ private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder private ListInstancesResponse() { instances_ = java.util.Collections.emptyList(); - failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + failedLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); nextPageToken_ = ""; } @@ -49,83 +50,6 @@ 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; @@ -142,6 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List instances_; /** * @@ -211,7 +137,10 @@ 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(); /** * * @@ -292,7 +221,9 @@ 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_ = ""; /** * * @@ -363,7 +294,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -386,7 +317,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -405,7 +336,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 +357,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; } @@ -555,34 +486,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) { 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 +532,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,14 +551,17 @@ public com.google.bigtable.admin.v2.ListInstancesResponse buildPartial() { } else { result.instances_ = instancesBuilder_.build(); } - if (((bitField0_ & 0x00000002) != 0)) { - failedLocations_ = failedLocations_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + } + + 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_; } - result.failedLocations_ = failedLocations_; - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; } @java.lang.Override @@ -706,7 +640,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 +649,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 +667,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; } @@ -1097,14 +1071,14 @@ 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,7 +1097,8 @@ private void ensureFailedLocationsIsMutable() { * @return A list containing the failedLocations. */ public com.google.protobuf.ProtocolStringList getFailedLocationsList() { - return failedLocations_.getUnmodifiableView(); + failedLocations_.makeImmutable(); + return failedLocations_; } /** * @@ -1208,6 +1183,7 @@ public Builder setFailedLocations(int index, java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.set(index, value); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1234,6 +1210,7 @@ public Builder addFailedLocations(java.lang.String value) { } ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1257,6 +1234,7 @@ 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,8 +1255,9 @@ 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,6 +1285,7 @@ public Builder addFailedLocationsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureFailedLocationsIsMutable(); failedLocations_.add(value); + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1371,8 +1351,8 @@ public Builder setNextPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1388,8 +1368,8 @@ 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,8 +1390,8 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - nextPageToken_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1448,7 +1428,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..4089707d28 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ListInstancesResponseOrBuilder 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 9b3da4debc..83cda9be85 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -24,6 +25,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
    @@ -53,67 +55,6 @@ 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;
    @@ -130,13 +71,15 @@ 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/-`.
    @@ -164,8 +107,8 @@ public 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/-`.
    @@ -191,7 +134,7 @@ public com.google.protobuf.ByteString getParentBytes() {
       }
     
       public static final int PAGE_SIZE_FIELD_NUMBER = 2;
    -  private int pageSize_;
    +  private int pageSize_ = 0;
       /**
        *
        *
    @@ -210,7 +153,9 @@ 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_ = "";
       /**
        *
        *
    @@ -281,7 +226,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -299,7 +244,7 @@ public int getSerializedSize() {
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -318,7 +263,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 +280,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;
       }
    @@ -441,6 +386,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        * 
        * 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
    @@ -469,28 +415,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) {
           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,13 +455,26 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.ListSnapshotsRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.parent_ = parent_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.pageSize_ = pageSize_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.pageToken_ = pageToken_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -573,6 +523,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 +531,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 +549,61 @@ 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/-`.
    @@ -645,8 +630,8 @@ public 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/-`.
    @@ -673,8 +658,8 @@ public com.google.protobuf.ByteString getParentBytes() {
          *
          *
          * 
    -     * 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,8 +676,8 @@ public Builder setParent(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -700,8 +685,8 @@ public Builder setParent(java.lang.String value) {
          *
          *
          * 
    -     * 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,8 +699,8 @@ public Builder setParent(java.lang.String value) {
          * @return This builder for chaining.
          */
         public Builder clearParent() {
    -
           parent_ = getDefaultInstance().getParent();
    +      bitField0_ = (bitField0_ & ~0x00000001);
           onChanged();
           return this;
         }
    @@ -723,8 +708,8 @@ public Builder clearParent() {
          *
          *
          * 
    -     * 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,8 +727,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           parent_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -781,6 +766,7 @@ public int getPageSize() {
         public Builder setPageSize(int value) {
     
           pageSize_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -797,7 +783,7 @@ public Builder setPageSize(int value) {
          * @return This builder for chaining.
          */
         public Builder clearPageSize() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000002);
           pageSize_ = 0;
           onChanged();
           return this;
    @@ -864,8 +850,8 @@ public Builder setPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -881,8 +867,8 @@ 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,8 +889,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -941,7 +927,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..e9dac374b9 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface ListSnapshotsRequestOrBuilder
    @@ -27,8 +28,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/-`.
    @@ -45,8 +46,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/-`.
    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 0242d97ce6..ae2da17fd6 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -24,6 +25,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
    @@ -53,70 +55,6 @@ 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;
    @@ -133,6 +71,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int SNAPSHOTS_FIELD_NUMBER = 1;
    +
    +  @SuppressWarnings("serial")
       private java.util.List snapshots_;
       /**
        *
    @@ -202,7 +142,9 @@ 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_ = "";
       /**
        *
        *
    @@ -274,7 +216,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -289,7 +231,7 @@ public int getSerializedSize() {
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -307,7 +249,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 +266,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;
       }
    @@ -430,6 +372,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        * 
        * 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
    @@ -458,32 +401,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) {
           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 +446,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,9 +465,13 @@ public com.google.bigtable.admin.v2.ListSnapshotsResponse buildPartial() {
           } else {
             result.snapshots_ = snapshotsBuilder_.build();
           }
    -      result.nextPageToken_ = nextPageToken_;
    -      onBuilt();
    -      return result;
    +    }
    +
    +    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
    @@ -601,9 +549,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 +567,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;
         }
     
    @@ -1050,8 +1031,8 @@ public Builder setNextPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1069,8 +1050,8 @@ 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,8 +1074,8 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1131,7 +1112,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..8916622626 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface ListSnapshotsResponseOrBuilder
    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 59e4a03792..dd1b15b9b0 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -50,74 +51,6 @@ 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;
    @@ -134,13 +67,15 @@ 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}`.
        * 
    * * @@ -165,8 +100,8 @@ public 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}`.
        * 
    * * @@ -189,13 +124,13 @@ 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; @@ -211,7 +146,7 @@ public 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; @@ -220,22 +155,23 @@ 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 +187,9 @@ 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_ = "";
       /**
        *
        *
    @@ -325,7 +263,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (pageSize_ != 0) {
           output.writeInt32(4, pageSize_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -346,7 +284,7 @@ public int getSerializedSize() {
         if (pageSize_ != 0) {
           size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -366,7 +304,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 +323,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;
       }
    @@ -515,30 +453,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) {
           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,14 +494,29 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.ListTablesRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.parent_ = parent_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.view_ = view_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.pageSize_ = pageSize_;
    +      }
    +      if (((from_bitField0_ & 0x00000008) != 0)) {
    +        result.pageToken_ = pageToken_;
    +      }
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -621,6 +564,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 +575,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 +593,67 @@ 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}`.
          * 
    * * @@ -692,8 +677,8 @@ public 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}`.
          * 
    * * @@ -717,8 +702,8 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * 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,8 +717,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -741,8 +726,8 @@ public Builder setParent(java.lang.String value) { * * *
    -     * 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,8 +737,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -761,8 +746,8 @@ public Builder clearParent() { * * *
    -     * 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,8 +762,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -789,7 +774,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * *
          * 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; @@ -805,7 +790,7 @@ public 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; @@ -814,8 +799,8 @@ public int getViewValue() { * @return This builder for chaining. */ public Builder setViewValue(int value) { - view_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -824,7 +809,7 @@ public Builder setViewValue(int value) { * *
          * 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,9 +818,8 @@ 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; } /** @@ -843,7 +827,7 @@ public com.google.bigtable.admin.v2.Table.View getView() { * *
          * 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,7 +839,7 @@ 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; @@ -865,7 +849,7 @@ public Builder setView(com.google.bigtable.admin.v2.Table.View value) { * *
          * 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,7 +857,7 @@ 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; @@ -885,9 +869,11 @@ public Builder clearView() { * *
          * 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.
    @@ -906,9 +892,11 @@ public int getPageSize() {
          *
          * 
          * 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,6 +910,7 @@ public int getPageSize() {
         public Builder setPageSize(int value) {
     
           pageSize_ = value;
    +      bitField0_ |= 0x00000004;
           onChanged();
           return this;
         }
    @@ -930,9 +919,11 @@ public Builder setPageSize(int value) {
          *
          * 
          * 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,7 +934,7 @@ public Builder setPageSize(int value) {
          * @return This builder for chaining.
          */
         public Builder clearPageSize() {
    -
    +      bitField0_ = (bitField0_ & ~0x00000004);
           pageSize_ = 0;
           onChanged();
           return this;
    @@ -1010,8 +1001,8 @@ public Builder setPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000008;
           onChanged();
           return this;
         }
    @@ -1027,8 +1018,8 @@ 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,8 +1040,8 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           pageToken_ = value;
    +      bitField0_ |= 0x00000008;
           onChanged();
           return this;
         }
    @@ -1087,7 +1078,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..6d3f733e1d 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface ListTablesRequestOrBuilder
    @@ -27,8 +28,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}`.
        * 
    * * @@ -42,8 +43,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}`.
        * 
    * * @@ -59,7 +60,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; @@ -72,7 +73,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; @@ -86,9 +87,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.
    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 fc0ec3f662..e6ababe62c 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -49,70 +50,6 @@ 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;
    @@ -129,6 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
       }
     
       public static final int TABLES_FIELD_NUMBER = 1;
    +
    +  @SuppressWarnings("serial")
       private java.util.List tables_;
       /**
        *
    @@ -198,7 +137,9 @@ 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_ = "";
       /**
        *
        *
    @@ -270,7 +211,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
           com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
         }
    -    unknownFields.writeTo(output);
    +    getUnknownFields().writeTo(output);
       }
     
       @java.lang.Override
    @@ -285,7 +226,7 @@ public int getSerializedSize() {
         if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
           size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
         }
    -    size += unknownFields.getSerializedSize();
    +    size += getUnknownFields().getSerializedSize();
         memoizedSize = size;
         return size;
       }
    @@ -303,7 +244,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 +261,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;
       }
    @@ -450,32 +391,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) {
           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 +436,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,9 +455,13 @@ public com.google.bigtable.admin.v2.ListTablesResponse buildPartial() {
           } else {
             result.tables_ = tablesBuilder_.build();
           }
    -      result.nextPageToken_ = nextPageToken_;
    -      onBuilt();
    -      return result;
    +    }
    +
    +    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
    @@ -593,9 +539,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 +557,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;
         }
     
    @@ -1041,8 +1021,8 @@ public Builder setNextPageToken(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1060,8 +1040,8 @@ 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,8 +1064,8 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           nextPageToken_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1122,7 +1102,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..b0ecdcdbe5 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface ListTablesResponseOrBuilder
    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 671a496b4a..7bb8a9d141 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 2021 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.
    @@ -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);
    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 a8afbabf6b..6f5e3f947c 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -49,74 +50,6 @@ 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;
    @@ -265,8 +198,51 @@ 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(); } /** * @@ -297,93 +273,6 @@ 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; @@ -399,7 +288,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 @@ -450,7 +342,9 @@ 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_ = ""; /** * * @@ -643,6 +537,61 @@ 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 @@ -669,7 +618,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 @@ -696,7 +648,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 +668,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 +686,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 +699,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 +719,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -901,14 +864,27 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateMaskFieldBuilder(); + } } @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,27 +917,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 (bitField0_ != 0) { + buildPartial0(result); } - if (modCase_ == 3) { - if (updateBuilder_ == null) { - result.mod_ = mod_; - } else { - result.mod_ = updateBuilder_.build(); - } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; } - if (modCase_ == 4) { - result.mod_ = mod_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.updateMask_ = + updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs( + com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification result) { result.modCase_ = modCase_; - onBuilt(); - return result; + 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 +1006,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 +1033,7 @@ public Builder mergeFrom( break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1056,19 +1048,61 @@ 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(getCreateFieldBuilder().getBuilder(), extensionRegistry); + modCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateFieldBuilder().getBuilder(), extensionRegistry); + modCase_ = 3; + break; + } // case 26 + case 32: + { + mod_ = input.readBool(); + modCase_ = 4; + break; + } // case 32 + case 50: + { + input.readMessage(getUpdateMaskFieldBuilder().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,6 +1120,8 @@ public Builder clearMod() { return this; } + private int bitField0_; + private java.lang.Object id_ = ""; /** * @@ -1147,8 +1183,8 @@ public Builder setId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1164,8 +1200,8 @@ 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,8 +1222,8 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - id_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1308,8 +1344,9 @@ 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; @@ -1405,7 +1442,6 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getCreateOrBuilder() { } modCase_ = 2; onChanged(); - ; return createBuilder_; } @@ -1525,8 +1561,9 @@ 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; @@ -1622,7 +1659,6 @@ public com.google.bigtable.admin.v2.ColumnFamilyOrBuilder getUpdateOrBuilder() { } modCase_ = 3; onChanged(); - ; return updateBuilder_; } @@ -1673,6 +1709,7 @@ public boolean getDrop() { * @return This builder for chaining. */ public Builder setDrop(boolean value) { + modCase_ = 4; mod_ = value; onChanged(); @@ -1699,6 +1736,218 @@ public Builder clearDrop() { return this; } + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000010); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
    +       * Optional. A mask specifying which fields (e.g. `gc_rule`) in the `update`
    +       * mod should be updated, ignored for other modification types. If unset or
    +       * empty, we treat it as updating `gc_rule` to be backward compatible.
    +       * 
    + * + * .google.protobuf.FieldMask update_mask = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getUpdateMaskFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1735,7 +1984,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 +2017,9 @@ 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_ = ""; /** * * @@ -1813,16 +2076,18 @@ 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).
        * 
    * * @@ -1838,10 +2103,10 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -   * Required. Modifications to be atomically applied to the specified table's families.
    -   * Entries are applied in order, meaning that earlier modifications can be
    -   * masked by later ones (in the case of repeated updates to the same family,
    -   * for example).
    +   * 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).
        * 
    * * @@ -1858,10 +2123,10 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -   * Required. Modifications to be atomically applied to the specified table's families.
    -   * Entries are applied in order, meaning that earlier modifications can be
    -   * masked by later ones (in the case of repeated updates to the same family,
    -   * for example).
    +   * 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).
        * 
    * * @@ -1876,10 +2141,10 @@ public 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).
        * 
    * * @@ -1895,10 +2160,10 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification get * * *
    -   * 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 +2176,24 @@ 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 @@ -1931,7 +2214,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io 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 @@ -1946,7 +2232,10 @@ public int getSerializedSize() { 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 +2253,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 +2271,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; } @@ -2112,32 +2404,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) { 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,19 +2450,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; + } + + 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 +2529,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,7 +2549,7 @@ 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() @@ -2257,7 +2559,10 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ModifyColumnFamiliesReques } } } - this.mergeUnknownFields(other.unknownFields); + if (other.getIgnoreWarnings() != false) { + setIgnoreWarnings(other.getIgnoreWarnings()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2272,18 +2577,58 @@ 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; } @@ -2362,8 +2707,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2383,8 +2728,8 @@ 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 +2754,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2419,12 +2764,12 @@ 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; } } @@ -2438,10 +2783,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).
          * 
    * * @@ -2460,10 +2805,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).
          * 
    * * @@ -2481,10 +2826,10 @@ public 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).
          * 
    * * @@ -2503,10 +2848,10 @@ public com.google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification get * * *
    -     * 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).
          * 
    * * @@ -2531,10 +2876,10 @@ public Builder setModifications( * * *
    -     * 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).
          * 
    * * @@ -2558,10 +2903,10 @@ public Builder setModifications( * * *
    -     * 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).
          * 
    * * @@ -2586,10 +2931,10 @@ public Builder addModifications( * * *
    -     * 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).
          * 
    * * @@ -2614,10 +2959,10 @@ public Builder addModifications( * * *
    -     * 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).
          * 
    * * @@ -2640,10 +2985,10 @@ public Builder addModifications( * * *
    -     * 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).
          * 
    * * @@ -2667,10 +3012,10 @@ public Builder addModifications( * * *
    -     * 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).
          * 
    * * @@ -2694,10 +3039,10 @@ public Builder addAllModifications( * * *
    -     * 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,7 +3052,7 @@ public Builder addAllModifications( public Builder clearModifications() { if (modificationsBuilder_ == null) { modifications_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { modificationsBuilder_.clear(); @@ -2718,10 +3063,10 @@ public Builder clearModifications() { * * *
    -     * 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).
          * 
    * * @@ -2742,10 +3087,10 @@ public Builder removeModifications(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).
          * 
    * * @@ -2760,10 +3105,10 @@ public Builder removeModifications(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).
          * 
    * * @@ -2782,10 +3127,10 @@ public Builder removeModifications(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).
          * 
    * * @@ -2806,10 +3151,10 @@ public Builder removeModifications(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).
          * 
    * * @@ -2827,10 +3172,10 @@ public Builder removeModifications(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).
          * 
    * * @@ -2849,10 +3194,10 @@ public Builder removeModifications(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).
          * 
    * * @@ -2877,7 +3222,7 @@ public Builder removeModifications(int index) { 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,6 +3230,59 @@ 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 boolean getIgnoreWarnings() { + return ignoreWarnings_; + } + /** + * + * + *
    +     * Optional. If true, ignore safety checks when modifying the column families.
    +     * 
    + * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The ignoreWarnings to set. + * @return This builder for chaining. + */ + public Builder setIgnoreWarnings(boolean value) { + + ignoreWarnings_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
    +     * Optional. If true, ignore safety checks when modifying the column families.
    +     * 
    + * + * bool ignore_warnings = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIgnoreWarnings() { + bitField0_ = (bitField0_ & ~0x00000004); + ignoreWarnings_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -2917,7 +3315,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..a6993f1715 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface ModifyColumnFamiliesRequestOrBuilder @@ -60,10 +61,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).
        * 
    * * @@ -76,10 +77,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).
        * 
    * * @@ -91,10 +92,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).
        * 
    * * @@ -106,10 +107,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).
        * 
    * * @@ -123,10 +124,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).
        * 
    * * @@ -135,4 +136,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..d4b0320e1d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -46,83 +47,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new OperationProgress(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.CommonProto .internal_static_google_bigtable_admin_v2_OperationProgress_descriptor; @@ -138,8 +62,9 @@ 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; /** * * @@ -172,7 +97,7 @@ public int getProgressPercent() { */ @java.lang.Override public boolean hasStartTime() { - return startTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -200,7 +125,7 @@ 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; @@ -219,7 +144,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { */ @java.lang.Override public boolean hasEndTime() { - return endTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -249,7 +174,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 +194,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 +212,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 +243,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 +264,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; } @@ -479,24 +404,25 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } } @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,21 +452,30 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.OperationProgress result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.progressPercent_ = progressPercent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -595,7 +530,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,20 +545,54 @@ 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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEndTimeFieldBuilder().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_; /** * @@ -657,6 +626,7 @@ public int getProgressPercent() { public Builder setProgressPercent(int value) { progressPercent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -673,7 +643,7 @@ public Builder setProgressPercent(int value) { * @return This builder for chaining. */ public Builder clearProgressPercent() { - + bitField0_ = (bitField0_ & ~0x00000001); progressPercent_ = 0; onChanged(); return this; @@ -697,7 +667,7 @@ public Builder clearProgressPercent() { * @return Whether the startTime field is set. */ public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -732,11 +702,11 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } startTime_ = value; - onChanged(); } else { startTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -751,11 +721,11 @@ 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,17 +739,20 @@ 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,14 +765,13 @@ 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,7 +784,7 @@ public Builder clearStartTime() { * .google.protobuf.Timestamp start_time = 2; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getStartTimeFieldBuilder().getBuilder(); } @@ -877,7 +849,7 @@ 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); } /** * @@ -914,11 +886,11 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } endTime_ = value; - onChanged(); } else { endTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -934,11 +906,11 @@ 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,17 +925,20 @@ 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,14 +952,13 @@ 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,7 +972,7 @@ public Builder clearEndTime() { * .google.protobuf.Timestamp end_time = 3; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getEndTimeFieldBuilder().getBuilder(); } @@ -1078,7 +1052,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..ee23f72828 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface OperationProgressOrBuilder 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 e0d2cccfab..10c20a5cd3 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -50,71 +51,6 @@ 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; @@ -130,8 +66,11 @@ 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_ = ""; /** * * @@ -194,7 +133,7 @@ public com.google.protobuf.ByteString getNameBytes() { */ @java.lang.Override public boolean hasProgress() { - return progress_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -224,7 +163,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; @@ -244,10 +185,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } - if (progress_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getProgress()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -259,10 +200,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.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 +224,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 +241,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; } @@ -443,18 +384,19 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProgressFieldBuilder(); + } } @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,16 +426,26 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.progress_ = progressBuilder_ == null ? progress_ : progressBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -542,12 +494,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,21 +515,48 @@ 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(getProgressFieldBuilder().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_ = ""; /** * @@ -638,8 +618,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -655,8 +635,8 @@ 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,8 +657,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -701,7 +681,7 @@ 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); } /** * @@ -738,11 +718,11 @@ 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,11 +738,11 @@ 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,19 +756,20 @@ 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,14 +782,13 @@ 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,7 +801,7 @@ 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(); } @@ -901,7 +881,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..3b5a04bcd8 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface OptimizeRestoredTableMetadataOrBuilder 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 index aacb02fb1a..504b10ecf7 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,95 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new PartialUpdateClusterMetadata(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PartialUpdateClusterMetadata( - 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.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 18: - { - 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; - } - case 26: - { - com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder subBuilder = null; - if (originalRequest_ != null) { - subBuilder = originalRequest_.toBuilder(); - } - originalRequest_ = - input.readMessage( - com.google.bigtable.admin.v2.PartialUpdateClusterRequest.parser(), - extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(originalRequest_); - originalRequest_ = 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_PartialUpdateClusterMetadata_descriptor; @@ -149,6 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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_; /** @@ -164,7 +77,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -192,7 +105,7 @@ 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 = 2; @@ -210,7 +123,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -238,7 +151,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_; } public static final int ORIGINAL_REQUEST_FIELD_NUMBER = 3; @@ -256,7 +169,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -287,7 +200,9 @@ public com.google.bigtable.admin.v2.PartialUpdateClusterRequest getOriginalReque @java.lang.Override public com.google.bigtable.admin.v2.PartialUpdateClusterRequestOrBuilder getOriginalRequestOrBuilder() { - return getOriginalRequest(); + return originalRequest_ == null + ? com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance() + : originalRequest_; } private byte memoizedIsInitialized = -1; @@ -304,16 +219,16 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (requestTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getFinishTime()); } - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeMessage(3, getOriginalRequest()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -322,16 +237,16 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (requestTime_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRequestTime()); } - if (finishTime_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFinishTime()); } - if (originalRequest_ != null) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOriginalRequest()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -359,7 +274,7 @@ public boolean equals(final java.lang.Object obj) { if (hasOriginalRequest()) { if (!getOriginalRequest().equals(other.getOriginalRequest())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -382,7 +297,7 @@ public int hashCode() { hash = (37 * hash) + ORIGINAL_REQUEST_FIELD_NUMBER; hash = (53 * hash) + getOriginalRequest().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -522,28 +437,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + getOriginalRequestFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (requestTimeBuilder_ == null) { - requestTime_ = null; - } else { - requestTime_ = null; + bitField0_ = 0; + 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; } - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - } else { - originalRequest_ = null; + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } return this; @@ -573,25 +490,33 @@ public com.google.bigtable.admin.v2.PartialUpdateClusterMetadata build() { public com.google.bigtable.admin.v2.PartialUpdateClusterMetadata buildPartial() { com.google.bigtable.admin.v2.PartialUpdateClusterMetadata result = new com.google.bigtable.admin.v2.PartialUpdateClusterMetadata(this); - if (requestTimeBuilder_ == null) { - result.requestTime_ = requestTime_; - } else { - result.requestTime_ = requestTimeBuilder_.build(); - } - if (finishTimeBuilder_ == null) { - result.finishTime_ = finishTime_; - } else { - result.finishTime_ = finishTimeBuilder_.build(); - } - if (originalRequestBuilder_ == null) { - result.originalRequest_ = originalRequest_; - } else { - result.originalRequest_ = originalRequestBuilder_.build(); + 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 clone() { return super.clone(); @@ -647,7 +572,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.PartialUpdateClusterMetada if (other.hasOriginalRequest()) { mergeOriginalRequest(other.getOriginalRequest()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -662,21 +587,54 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.PartialUpdateClusterMetadata 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(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getFinishTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getOriginalRequestFieldBuilder().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.PartialUpdateClusterMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } + private int bitField0_; + private com.google.protobuf.Timestamp requestTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, @@ -695,7 +653,7 @@ public Builder mergeFrom( * @return Whether the requestTime field is set. */ public boolean hasRequestTime() { - return requestTimeBuilder_ != null || requestTime_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -732,11 +690,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -751,11 +709,11 @@ 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_ |= 0x00000001; + onChanged(); return this; } /** @@ -769,19 +727,20 @@ 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_ & 0x00000001) != 0) + && requestTime_ != null + && requestTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRequestTimeBuilder().mergeFrom(value); } else { requestTime_ = value; } - onChanged(); } else { requestTimeBuilder_.mergeFrom(value); } - + if (requestTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } return this; } /** @@ -794,14 +753,13 @@ public Builder mergeRequestTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp request_time = 1; */ public Builder clearRequestTime() { - if (requestTimeBuilder_ == null) { - requestTime_ = null; - onChanged(); - } else { - requestTime_ = null; + bitField0_ = (bitField0_ & ~0x00000001); + requestTime_ = null; + if (requestTimeBuilder_ != null) { + requestTimeBuilder_.dispose(); requestTimeBuilder_ = null; } - + onChanged(); return this; } /** @@ -814,7 +772,7 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 1; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getRequestTimeFieldBuilder().getBuilder(); } @@ -880,7 +838,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { * @return Whether the finishTime field is set. */ public boolean hasFinishTime() { - return finishTimeBuilder_ != null || finishTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -917,11 +875,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -936,11 +894,11 @@ 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_ |= 0x00000002; + onChanged(); return this; } /** @@ -954,17 +912,20 @@ 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_ & 0x00000002) != 0) + && finishTime_ != null + && finishTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getFinishTimeBuilder().mergeFrom(value); } else { finishTime_ = value; } - onChanged(); } else { finishTimeBuilder_.mergeFrom(value); } - + if (finishTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } return this; } /** @@ -977,14 +938,13 @@ public Builder mergeFinishTime(com.google.protobuf.Timestamp value) { * .google.protobuf.Timestamp finish_time = 2; */ public Builder clearFinishTime() { - if (finishTimeBuilder_ == null) { - finishTime_ = null; - onChanged(); - } else { - finishTime_ = null; + bitField0_ = (bitField0_ & ~0x00000002); + finishTime_ = null; + if (finishTimeBuilder_ != null) { + finishTimeBuilder_.dispose(); finishTimeBuilder_ = null; } - + onChanged(); return this; } /** @@ -997,7 +957,7 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 2; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getFinishTimeFieldBuilder().getBuilder(); } @@ -1063,7 +1023,7 @@ public com.google.protobuf.TimestampOrBuilder getFinishTimeOrBuilder() { * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -1101,11 +1061,11 @@ public Builder setOriginalRequest( throw new NullPointerException(); } originalRequest_ = value; - onChanged(); } else { originalRequestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1121,11 +1081,11 @@ public Builder setOriginalRequest( com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder builderForValue) { if (originalRequestBuilder_ == null) { originalRequest_ = builderForValue.build(); - onChanged(); } else { originalRequestBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1140,19 +1100,21 @@ public Builder setOriginalRequest( public Builder mergeOriginalRequest( com.google.bigtable.admin.v2.PartialUpdateClusterRequest value) { if (originalRequestBuilder_ == null) { - if (originalRequest_ != null) { - originalRequest_ = - com.google.bigtable.admin.v2.PartialUpdateClusterRequest.newBuilder(originalRequest_) - .mergeFrom(value) - .buildPartial(); + if (((bitField0_ & 0x00000004) != 0) + && originalRequest_ != null + && originalRequest_ + != com.google.bigtable.admin.v2.PartialUpdateClusterRequest.getDefaultInstance()) { + getOriginalRequestBuilder().mergeFrom(value); } else { originalRequest_ = value; } - onChanged(); } else { originalRequestBuilder_.mergeFrom(value); } - + if (originalRequest_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } return this; } /** @@ -1165,14 +1127,13 @@ public Builder mergeOriginalRequest( * .google.bigtable.admin.v2.PartialUpdateClusterRequest original_request = 3; */ public Builder clearOriginalRequest() { - if (originalRequestBuilder_ == null) { - originalRequest_ = null; - onChanged(); - } else { - originalRequest_ = null; + bitField0_ = (bitField0_ & ~0x00000004); + originalRequest_ = null; + if (originalRequestBuilder_ != null) { + originalRequestBuilder_.dispose(); originalRequestBuilder_ = null; } - + onChanged(); return this; } /** @@ -1186,7 +1147,7 @@ public Builder clearOriginalRequest() { */ public com.google.bigtable.admin.v2.PartialUpdateClusterRequest.Builder getOriginalRequestBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getOriginalRequestFieldBuilder().getBuilder(); } @@ -1267,7 +1228,18 @@ public PartialUpdateClusterMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PartialUpdateClusterMetadata(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/PartialUpdateClusterMetadataOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterMetadataOrBuilder.java index 1ba9bbad43..1faef28c8f 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface PartialUpdateClusterMetadataOrBuilder 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 index ef8babcf15..6b53bdb09d 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,79 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new PartialUpdateClusterRequest(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private PartialUpdateClusterRequest( - 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 (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; - } - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_PartialUpdateClusterRequest_descriptor; @@ -133,14 +61,15 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 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.
    +   * 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]; @@ -150,14 +79,14 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasCluster() { - return cluster_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * * *
    -   * Required. The Cluster which contains the partial updates to be applied, subject to
    -   * the update_mask.
    +   * 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]; @@ -173,8 +102,8 @@ public com.google.bigtable.admin.v2.Cluster getCluster() { * * *
    -   * Required. The Cluster which contains the partial updates to be applied, subject to
    -   * the update_mask.
    +   * 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]; @@ -182,7 +111,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_; } public static final int UPDATE_MASK_FIELD_NUMBER = 2; @@ -201,7 +130,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -231,7 +160,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; @@ -248,13 +177,13 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (cluster_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(1, getCluster()); } - if (updateMask_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(2, getUpdateMask()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -263,13 +192,13 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (cluster_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCluster()); } - 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; } @@ -293,7 +222,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; } @@ -312,7 +241,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; } @@ -452,22 +381,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getClusterFieldBuilder(); + getUpdateMaskFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - if (clusterBuilder_ == null) { - cluster_ = null; - } else { - cluster_ = null; + bitField0_ = 0; + cluster_ = null; + if (clusterBuilder_ != null) { + clusterBuilder_.dispose(); clusterBuilder_ = null; } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); updateMaskBuilder_ = null; } return this; @@ -497,20 +428,27 @@ public com.google.bigtable.admin.v2.PartialUpdateClusterRequest build() { public com.google.bigtable.admin.v2.PartialUpdateClusterRequest buildPartial() { com.google.bigtable.admin.v2.PartialUpdateClusterRequest result = new com.google.bigtable.admin.v2.PartialUpdateClusterRequest(this); - if (clusterBuilder_ == null) { - result.cluster_ = cluster_; - } else { - result.cluster_ = clusterBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); + 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 clone() { return super.clone(); @@ -563,7 +501,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.PartialUpdateClusterReques if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -578,21 +516,48 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.admin.v2.PartialUpdateClusterRequest 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(getClusterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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.PartialUpdateClusterRequest) 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 cluster_; private com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.admin.v2.Cluster, @@ -603,8 +568,8 @@ public Builder mergeFrom( * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -614,14 +579,14 @@ public Builder mergeFrom( * @return Whether the cluster field is set. */ public boolean hasCluster() { - return clusterBuilder_ != null || cluster_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -643,8 +608,8 @@ public com.google.bigtable.admin.v2.Cluster getCluster() { * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -657,19 +622,19 @@ public Builder setCluster(com.google.bigtable.admin.v2.Cluster value) { throw new NullPointerException(); } cluster_ = value; - onChanged(); } 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.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -679,19 +644,19 @@ 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_ |= 0x00000001; + onChanged(); return this; } /** * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -700,27 +665,28 @@ 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_ & 0x00000001) != 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_ |= 0x00000001; + onChanged(); + } return this; } /** * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -728,22 +694,21 @@ public Builder mergeCluster(com.google.bigtable.admin.v2.Cluster value) { * */ public Builder clearCluster() { - if (clusterBuilder_ == null) { - cluster_ = null; - onChanged(); - } else { - cluster_ = null; + 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.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -751,7 +716,7 @@ public Builder clearCluster() { * */ public com.google.bigtable.admin.v2.Cluster.Builder getClusterBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getClusterFieldBuilder().getBuilder(); } @@ -759,8 +724,8 @@ public com.google.bigtable.admin.v2.Cluster.Builder getClusterBuilder() { * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -780,8 +745,8 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { * * *
    -     * Required. The Cluster which contains the partial updates to be applied, subject to
    -     * the update_mask.
    +     * Required. The Cluster which contains the partial updates to be applied,
    +     * subject to the update_mask.
          * 
    * * @@ -824,7 +789,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClusterOrBuilder() { * @return Whether the updateMask field is set. */ public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -863,11 +828,11 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -883,11 +848,11 @@ 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; } /** @@ -902,17 +867,20 @@ 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; } /** @@ -926,14 +894,13 @@ 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; } /** @@ -947,7 +914,7 @@ public Builder clearUpdateMask() { *
    */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getUpdateMaskFieldBuilder().getBuilder(); } @@ -1029,7 +996,18 @@ public PartialUpdateClusterRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PartialUpdateClusterRequest(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/PartialUpdateClusterRequestOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/PartialUpdateClusterRequestOrBuilder.java index bd595c00d1..2badefe4cd 100644 --- 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 @@ -1,5 +1,5 @@ /* - * Copyright 2020 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface PartialUpdateClusterRequestOrBuilder @@ -27,8 +28,8 @@ public interface PartialUpdateClusterRequestOrBuilder * * *
    -   * Required. The Cluster which contains the partial updates to be applied, subject to
    -   * the update_mask.
    +   * 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]; @@ -41,8 +42,8 @@ public interface PartialUpdateClusterRequestOrBuilder * * *
    -   * Required. The Cluster which contains the partial updates to be applied, subject to
    -   * the update_mask.
    +   * 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]; @@ -55,8 +56,8 @@ public interface PartialUpdateClusterRequestOrBuilder * * *
    -   * Required. The Cluster which contains the partial updates to be applied, subject to
    -   * the update_mask.
    +   * 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]; 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..50c435dc10 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,79 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new PartialUpdateInstanceRequest(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_PartialUpdateInstanceRequest_descriptor; @@ -133,6 +61,7 @@ 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,7 +79,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasInstance() { - return instance_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -184,7 +113,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 UPDATE_MASK_FIELD_NUMBER = 2; @@ -204,7 +135,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstanceOrBuilder() { */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -236,7 +167,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 +184,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 +199,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 +229,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 +248,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; } @@ -457,22 +388,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstanceFieldBuilder(); + getUpdateMaskFieldBuilder(); + } } @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,20 +435,27 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.PartialUpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -568,7 +508,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,21 +523,48 @@ 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(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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< com.google.bigtable.admin.v2.Instance, @@ -618,7 +585,7 @@ public Builder mergeFrom( * @return Whether the instance field is set. */ public boolean hasInstance() { - return instanceBuilder_ != null || instance_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -659,11 +626,11 @@ 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,11 +647,11 @@ 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,19 +667,20 @@ 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,14 +695,13 @@ 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,7 +716,7 @@ public Builder clearInstance() { *
    */ public com.google.bigtable.admin.v2.Instance.Builder getInstanceBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getInstanceFieldBuilder().getBuilder(); } @@ -821,7 +788,7 @@ 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); } /** * @@ -862,11 +829,11 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -883,11 +850,11 @@ 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,17 +870,20 @@ 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,14 +898,13 @@ 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,7 +919,7 @@ public Builder clearUpdateMask() { *
    */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getUpdateMaskFieldBuilder().getBuilder(); } @@ -1034,7 +1003,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..ee44b56245 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface PartialUpdateInstanceRequestOrBuilder 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 475c393f8f..b4f47f5bd9 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 2021 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. @@ -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); } 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..12c4f2f1b6 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -47,71 +48,6 @@ 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; @@ -128,6 +64,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int sourceInfoCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object sourceInfo_; public enum SourceInfoCase @@ -172,7 +110,7 @@ public SourceInfoCase getSourceInfoCase() { } public static final int SOURCE_TYPE_FIELD_NUMBER = 1; - private int sourceType_; + private int sourceType_ = 0; /** * * @@ -201,9 +139,8 @@ 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; } @@ -283,7 +220,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 +239,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 +263,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 +284,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -476,24 +413,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) { 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,19 +456,29 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.RestoreInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sourceType_ = sourceType_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreInfo result) { + result.sourceInfoCase_ = sourceInfoCase_; + result.sourceInfo_ = this.sourceInfo_; + if (sourceInfoCase_ == 2 && backupInfoBuilder_ != null) { + result.sourceInfo_ = backupInfoBuilder_.build(); + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -595,7 +538,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 +553,43 @@ 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(getBackupInfoFieldBuilder().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,6 +607,8 @@ public Builder clearSourceInfo() { return this; } + private int bitField0_; + private int sourceType_ = 0; /** * @@ -667,8 +638,8 @@ public int getSourceTypeValue() { * @return This builder for chaining. */ public Builder setSourceTypeValue(int value) { - sourceType_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -685,9 +656,8 @@ 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,7 +676,7 @@ 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,7 +693,7 @@ 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; @@ -845,8 +815,9 @@ 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; @@ -942,7 +913,6 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() } sourceInfoCase_ = 2; onChanged(); - ; return backupInfoBuilder_; } @@ -978,7 +948,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..e07462c884 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface RestoreInfoOrBuilder @@ -86,5 +87,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..03e1220853 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** 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 42c7fcd1fd..a1a725e170 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -50,101 +51,6 @@ 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; @@ -160,7 +66,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 @@ -205,7 +114,9 @@ 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_ = ""; /** * * @@ -254,7 +165,7 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int SOURCE_TYPE_FIELD_NUMBER = 2; - private int sourceType_; + private int sourceType_ = 0; /** * * @@ -283,9 +194,8 @@ 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; } @@ -321,7 +231,9 @@ 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_ = ""; /** * * @@ -391,7 +303,8 @@ public com.google.protobuf.ByteString getOptimizeTableOperationNameBytes() { * * *
    -   * 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 +314,14 @@ 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.
        * 
    * @@ -425,7 +339,8 @@ public 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.
        * 
    * @@ -433,7 +348,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; @@ -464,10 +381,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(optimizeTableOperationName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, optimizeTableOperationName_); } - if (progress_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getProgress()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -493,10 +410,10 @@ public int getSerializedSize() { size += com.google.protobuf.GeneratedMessageV3.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 +445,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 +474,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -697,22 +614,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProgressFieldBuilder(); + } } @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,26 +663,41 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.RestoreTableMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceType_ = sourceType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.optimizeTableOperationName_ = optimizeTableOperationName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.progress_ = progressBuilder_ == null ? progress_ : progressBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreTableMetadata result) { + result.sourceInfoCase_ = sourceInfoCase_; + result.sourceInfo_ = this.sourceInfo_; + if (sourceInfoCase_ == 3 && backupInfoBuilder_ != null) { + result.sourceInfo_ = backupInfoBuilder_.build(); + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -812,6 +746,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 +754,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 +771,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 +786,61 @@ 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(getBackupInfoFieldBuilder().getBuilder(), extensionRegistry); + sourceInfoCase_ = 3; + break; + } // case 26 + case 34: + { + optimizeTableOperationName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getProgressFieldBuilder().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,6 +858,8 @@ public Builder clearSourceInfo() { return this; } + private int bitField0_; + private java.lang.Object name_ = ""; /** * @@ -940,8 +921,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -957,8 +938,8 @@ 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,8 +960,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1014,8 +995,8 @@ public int getSourceTypeValue() { * @return This builder for chaining. */ public Builder setSourceTypeValue(int value) { - sourceType_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1032,9 +1013,8 @@ 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,7 +1033,7 @@ 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,7 +1050,7 @@ 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; @@ -1151,8 +1131,9 @@ 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; @@ -1212,7 +1193,6 @@ public com.google.bigtable.admin.v2.BackupInfoOrBuilder getBackupInfoOrBuilder() } sourceInfoCase_ = 3; onChanged(); - ; return backupInfoBuilder_; } @@ -1301,8 +1281,8 @@ public Builder setOptimizeTableOperationName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - optimizeTableOperationName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1326,8 +1306,8 @@ 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,8 +1336,8 @@ public Builder setOptimizeTableOperationNameBytes(com.google.protobuf.ByteString throw new NullPointerException(); } checkByteStringIsUtf8(value); - optimizeTableOperationName_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1372,7 +1352,8 @@ public Builder setOptimizeTableOperationNameBytes(com.google.protobuf.ByteString * * *
    -     * 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 +1362,14 @@ 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.
          * 
    * @@ -1408,7 +1390,8 @@ public 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.
          * 
    * @@ -1420,18 +1403,19 @@ 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 +1425,19 @@ 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,54 +1445,56 @@ 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(); } @@ -1515,7 +1502,8 @@ public com.google.bigtable.admin.v2.OperationProgress.Builder getProgressBuilder * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1534,7 +1522,8 @@ public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuil * * *
    -     * The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
    +     * The progress of the
    +     * [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]
          * operation.
          * 
    * @@ -1589,7 +1578,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..39761c7e56 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface RestoreTableMetadataOrBuilder @@ -133,7 +134,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.
        * 
    * @@ -146,7 +148,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.
        * 
    * @@ -159,7 +162,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.
        * 
    * @@ -167,5 +171,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 794d623b03..b58fd43ae7 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -49,69 +50,6 @@ 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; @@ -128,6 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int sourceCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object source_; public enum SourceCase @@ -172,14 +112,15 @@ 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 in the same project as the source backup.
    -   * Values are of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -205,8 +146,7 @@ public java.lang.String getParent() { * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be in the same project as the source backup.
    -   * Values are of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -229,7 +169,9 @@ 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_ = ""; /** * * @@ -379,7 +321,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (sourceCase_ == 3) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -397,7 +339,7 @@ public int getSerializedSize() { if (sourceCase_ == 3) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -423,7 +365,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 +388,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -576,26 +518,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) { 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,16 +559,29 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.RestoreTableRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableId_ = tableId_; + } + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.RestoreTableRequest result) { + result.sourceCase_ = sourceCase_; + result.source_ = this.source_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -683,10 +630,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 +651,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 +666,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 +727,15 @@ 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 in the same project as the source backup.
    -     * Values are of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -777,8 +760,7 @@ public java.lang.String getParent() { * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be in the same project as the source backup.
    -     * Values are of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -803,8 +785,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be in the same project as the source backup.
    -     * Values are of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -818,8 +799,8 @@ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -828,8 +809,7 @@ public Builder setParent(java.lang.String value) { * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be in the same project as the source backup.
    -     * Values are of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -839,8 +819,8 @@ public Builder setParent(java.lang.String value) { * @return This builder for chaining. */ public Builder clearParent() { - parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -849,8 +829,7 @@ public Builder clearParent() { * *
          * Required. The name of the instance in which to create the restored
    -     * table. This instance must be in the same project as the source backup.
    -     * Values are of the form `projects/<project>/instances/<instance>`.
    +     * table. Values are of the form `projects/<project>/instances/<instance>`.
          * 
    * * @@ -865,8 +844,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - parent_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -941,8 +920,8 @@ public Builder setTableId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -961,8 +940,8 @@ 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 +965,8 @@ public Builder setTableIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - tableId_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -1164,7 +1143,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 f55e5f6108..fd264598eb 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface RestoreTableRequestOrBuilder @@ -28,8 +29,7 @@ public interface RestoreTableRequestOrBuilder * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be in the same project as the source backup.
    -   * Values are of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -44,8 +44,7 @@ public interface RestoreTableRequestOrBuilder * *
        * Required. The name of the instance in which to create the restored
    -   * table. This instance must be in the same project as the source backup.
    -   * Values are of the form `projects/<project>/instances/<instance>`.
    +   * table. Values are of the form `projects/<project>/instances/<instance>`.
        * 
    * * @@ -127,5 +126,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/Snapshot.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java index cabb53546b..07fc2b7189 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -24,6 +25,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
    @@ -54,119 +56,6 @@ 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;
    @@ -343,13 +232,16 @@ 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}`.
        * 
    @@ -374,7 +266,7 @@ public 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}`.
        * 
    @@ -405,13 +297,15 @@ 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 +314,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. */ @@ -437,15 +333,19 @@ 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 +356,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. */ @@ -474,13 +374,14 @@ 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 +390,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. */ @@ -504,11 +406,12 @@ 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; @@ -517,8 +420,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
    -   * 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 +431,14 @@ 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.
        * 
    * @@ -551,8 +454,8 @@ public 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.
        * 
    * @@ -560,11 +463,11 @@ 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 +475,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. */ @@ -587,25 +492,28 @@ 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; @@ -628,7 +536,7 @@ public java.lang.String getDescription() { * * *
    -   * Output only. Description of the snapshot.
    +   * Description of the snapshot.
        * 
    * * string description = 7; @@ -665,16 +573,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.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()) { @@ -683,7 +591,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, description_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -695,16 +603,16 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.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()) { @@ -713,7 +621,7 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, description_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -744,7 +652,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 +683,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; } @@ -880,6 +788,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
        * 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
    @@ -918,38 +827,36 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    +        getSourceTableFieldBuilder();
    +        getCreateTimeFieldBuilder();
    +        getDeleteTimeFieldBuilder();
    +      }
         }
     
         @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,29 +884,44 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.Snapshot result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.sourceTable_ =
    +            sourceTableBuilder_ == null ? sourceTable_ : sourceTableBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.dataSizeBytes_ = dataSizeBytes_;
    +      }
    +      if (((from_bitField0_ & 0x00000008) != 0)) {
    +        result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
    +        to_bitField0_ |= 0x00000002;
    +      }
    +      if (((from_bitField0_ & 0x00000010) != 0)) {
    +        result.deleteTime_ = deleteTimeBuilder_ == null ? deleteTime_ : deleteTimeBuilder_.build();
    +        to_bitField0_ |= 0x00000004;
    +      }
    +      if (((from_bitField0_ & 0x00000020) != 0)) {
    +        result.state_ = state_;
    +      }
    +      if (((from_bitField0_ & 0x00000040) != 0)) {
    +        result.description_ = description_;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -1047,6 +969,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 +989,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 +1007,84 @@ 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(getSourceTableFieldBuilder().getBuilder(), extensionRegistry);
    +                bitField0_ |= 0x00000002;
    +                break;
    +              } // case 18
    +            case 24:
    +              {
    +                dataSizeBytes_ = input.readInt64();
    +                bitField0_ |= 0x00000004;
    +                break;
    +              } // case 24
    +            case 34:
    +              {
    +                input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry);
    +                bitField0_ |= 0x00000008;
    +                break;
    +              } // case 34
    +            case 42:
    +              {
    +                input.readMessage(getDeleteTimeFieldBuilder().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}`.
          * 
    @@ -1126,7 +1108,7 @@ public 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}`.
          * 
    @@ -1150,7 +1132,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
    -     * 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,8 +1146,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1173,7 +1155,7 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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,8 +1165,8 @@ public Builder setName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearName() { - name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -1192,7 +1174,7 @@ public Builder clearName() { * * *
    -     * 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,8 +1189,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1226,12 +1208,14 @@ 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 +1224,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. */ @@ -1260,7 +1246,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,11 +1256,11 @@ 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,16 +1270,18 @@ 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,23 +1291,26 @@ 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,17 +1320,18 @@ 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,10 +1341,12 @@ 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(); } @@ -1361,7 +1357,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) { @@ -1379,7 +1377,9 @@ 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< com.google.bigtable.admin.v2.Table, @@ -1409,7 +1409,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. */ @@ -1427,7 +1427,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,6 +1435,7 @@ public long getDataSizeBytes() { public Builder setDataSizeBytes(long value) { dataSizeBytes_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1448,12 +1449,12 @@ 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; @@ -1472,12 +1473,14 @@ 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 +1489,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. */ @@ -1506,7 +1511,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,11 +1521,11 @@ public Builder setCreateTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } createTime_ = value; - onChanged(); } else { createTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } /** @@ -1528,16 +1535,18 @@ 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,21 +1556,26 @@ 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,17 +1585,18 @@ 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,10 +1606,12 @@ 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(); } @@ -1605,7 +1622,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) { @@ -1623,7 +1642,9 @@ 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< com.google.protobuf.Timestamp, @@ -1652,8 +1673,8 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * * *
    -     * 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 +1683,14 @@ 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.
          * 
    * @@ -1690,8 +1711,8 @@ public 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.
          * 
    * @@ -1703,19 +1724,19 @@ 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 +1745,19 @@ 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,54 +1765,56 @@ 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(); } @@ -1799,8 +1822,8 @@ public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { * * *
    -     * 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.
          * 
    * @@ -1819,8 +1842,8 @@ public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { * * *
    -     * 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.
          * 
    * @@ -1851,7 +1874,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. */ @@ -1866,14 +1891,16 @@ 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,15 +1911,16 @@ 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 +1930,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,7 +1941,7 @@ 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,12 +1953,14 @@ 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; @@ -1939,7 +1971,7 @@ public Builder clearState() { * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -1961,7 +1993,7 @@ public java.lang.String getDescription() { * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -1983,7 +2015,7 @@ public com.google.protobuf.ByteString getDescriptionBytes() { * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -1995,8 +2027,8 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2004,7 +2036,7 @@ public Builder setDescription(java.lang.String value) { * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -2012,8 +2044,8 @@ public Builder setDescription(java.lang.String value) { * @return This builder for chaining. */ public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); return this; } @@ -2021,7 +2053,7 @@ public Builder clearDescription() { * * *
    -     * Output only. Description of the snapshot.
    +     * Description of the snapshot.
          * 
    * * string description = 7; @@ -2034,8 +2066,8 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2072,7 +2104,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 c593846890..881075fe8c 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 2021 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. @@ -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) 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..6e082eb183 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface SnapshotOrBuilder @@ -27,7 +28,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}`.
        * 
    @@ -41,7 +42,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}`.
        * 
    @@ -59,7 +60,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]; + * * * @return Whether the sourceTable field is set. */ @@ -71,7 +74,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]; + * * * @return The sourceTable. */ @@ -83,7 +88,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 +104,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,7 +117,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]; + * * * @return Whether the createTime field is set. */ @@ -122,7 +130,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]; + * * * @return The createTime. */ @@ -134,7 +143,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 +152,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.
        * 
    * @@ -156,8 +166,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.
        * 
    * @@ -170,8 +180,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.
        * 
    * @@ -186,7 +196,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 enum numeric value on the wire for state. */ @@ -198,7 +210,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 +222,7 @@ public interface SnapshotOrBuilder * * *
    -   * Output only. Description of the snapshot.
    +   * Description of the snapshot.
        * 
    * * string description = 7; @@ -220,7 +234,7 @@ public interface SnapshotOrBuilder * * *
    -   * 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..116f1b910a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -23,6 +24,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
    @@ -49,95 +51,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
         return new SnapshotTableMetadata();
       }
     
    -  @java.lang.Override
    -  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -    return this.unknownFields;
    -  }
    -
    -  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();
    -    }
    -  }
    -
       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
         return com.google.bigtable.admin.v2.BigtableTableAdminProto
             .internal_static_google_bigtable_admin_v2_SnapshotTableMetadata_descriptor;
    @@ -153,6 +66,7 @@ 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,7 +82,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        */
       @java.lang.Override
       public boolean hasOriginalRequest() {
    -    return originalRequest_ != null;
    +    return ((bitField0_ & 0x00000001) != 0);
       }
       /**
        *
    @@ -198,7 +112,9 @@ 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;
    @@ -216,7 +132,7 @@ public com.google.bigtable.admin.v2.SnapshotTableRequestOrBuilder getOriginalReq
        */
       @java.lang.Override
       public boolean hasRequestTime() {
    -    return requestTime_ != null;
    +    return ((bitField0_ & 0x00000002) != 0);
       }
       /**
        *
    @@ -244,7 +160,7 @@ 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;
    @@ -262,7 +178,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() {
        */
       @java.lang.Override
       public boolean hasFinishTime() {
    -    return finishTime_ != null;
    +    return ((bitField0_ & 0x00000004) != 0);
       }
       /**
        *
    @@ -290,7 +206,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 +223,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 +241,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 +278,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 +301,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;
       }
    @@ -490,6 +406,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
        *
        * 
        * 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
    @@ -528,28 +445,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    +        getOriginalRequestFieldBuilder();
    +        getRequestTimeFieldBuilder();
    +        getFinishTimeFieldBuilder();
    +      }
         }
     
         @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,25 +498,33 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.SnapshotTableMetadata result) {
    +      int from_bitField0_ = bitField0_;
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.originalRequest_ =
    +            originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.requestTime_ =
    +            requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build();
    +        to_bitField0_ |= 0x00000002;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build();
    +        to_bitField0_ |= 0x00000004;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -653,7 +580,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,21 +595,54 @@ 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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry);
    +                bitField0_ |= 0x00000001;
    +                break;
    +              } // case 10
    +            case 18:
    +              {
    +                input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry);
    +                bitField0_ |= 0x00000002;
    +                break;
    +              } // case 18
    +            case 26:
    +              {
    +                input.readMessage(getFinishTimeFieldBuilder().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<
                 com.google.bigtable.admin.v2.SnapshotTableRequest,
    @@ -701,7 +661,7 @@ public Builder mergeFrom(
          * @return Whether the originalRequest field is set.
          */
         public boolean hasOriginalRequest() {
    -      return originalRequestBuilder_ != null || originalRequest_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
         /**
          *
    @@ -738,11 +698,11 @@ 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,11 +718,11 @@ 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,19 +736,21 @@ 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,14 +763,13 @@ 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,7 +782,7 @@ 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();
         }
    @@ -888,7 +849,7 @@ 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);
         }
         /**
          *
    @@ -925,11 +886,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             requestTime_ = value;
    -        onChanged();
           } else {
             requestTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000002;
    +      onChanged();
           return this;
         }
         /**
    @@ -944,11 +905,11 @@ 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,19 +923,20 @@ 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,14 +949,13 @@ 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,7 +968,7 @@ public Builder clearRequestTime() {
          * .google.protobuf.Timestamp request_time = 2;
          */
         public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() {
    -
    +      bitField0_ |= 0x00000002;
           onChanged();
           return getRequestTimeFieldBuilder().getBuilder();
         }
    @@ -1073,7 +1034,7 @@ 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);
         }
         /**
          *
    @@ -1110,11 +1071,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) {
               throw new NullPointerException();
             }
             finishTime_ = value;
    -        onChanged();
           } else {
             finishTimeBuilder_.setMessage(value);
           }
    -
    +      bitField0_ |= 0x00000004;
    +      onChanged();
           return this;
         }
         /**
    @@ -1129,11 +1090,11 @@ 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,17 +1108,20 @@ 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,14 +1134,13 @@ 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,7 +1153,7 @@ public Builder clearFinishTime() {
          * .google.protobuf.Timestamp finish_time = 3;
          */
         public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() {
    -
    +      bitField0_ |= 0x00000004;
           onChanged();
           return getFinishTimeFieldBuilder().getBuilder();
         }
    @@ -1270,7 +1233,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..a945a3c3fb 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     public interface SnapshotTableMetadataOrBuilder
    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 643d5522d7..7680f308b6 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 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.
    @@ -16,6 +16,7 @@
     // Generated by the protocol buffer compiler.  DO NOT EDIT!
     // source: google/bigtable/admin/v2/bigtable_table_admin.proto
     
    +// Protobuf Java Version: 3.25.5
     package com.google.bigtable.admin.v2;
     
     /**
    @@ -24,6 +25,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
    @@ -55,90 +57,6 @@ 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;
    @@ -154,8 +72,11 @@ 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_ = "";
       /**
        *
        *
    @@ -212,7 +133,9 @@ 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_ = "";
       /**
        *
        *
    @@ -269,14 +192,16 @@ 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`.
        * 
    * @@ -300,9 +225,9 @@ public 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`.
        * 
    * @@ -341,7 +266,7 @@ public com.google.protobuf.ByteString getSnapshotIdBytes() { */ @java.lang.Override public boolean hasTtl() { - return ttl_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -375,11 +300,13 @@ 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_ = ""; /** * * @@ -450,13 +377,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshotId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, snapshotId_); } - if (ttl_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(4, getTtl()); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -474,13 +401,13 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshotId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, snapshotId_); } - if (ttl_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTtl()); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -504,7 +431,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 +454,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; } @@ -633,6 +560,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
        * 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
    @@ -671,26 +599,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
         }
     
         private void maybeForceBuilderInitialization() {
    -      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    +        getTtlFieldBuilder();
    +      }
         }
     
         @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,19 +644,35 @@ 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;
         }
     
    +    private void buildPartial0(com.google.bigtable.admin.v2.SnapshotTableRequest result) {
    +      int from_bitField0_ = bitField0_;
    +      if (((from_bitField0_ & 0x00000001) != 0)) {
    +        result.name_ = name_;
    +      }
    +      if (((from_bitField0_ & 0x00000002) != 0)) {
    +        result.cluster_ = cluster_;
    +      }
    +      if (((from_bitField0_ & 0x00000004) != 0)) {
    +        result.snapshotId_ = snapshotId_;
    +      }
    +      int to_bitField0_ = 0;
    +      if (((from_bitField0_ & 0x00000008) != 0)) {
    +        result.ttl_ = ttlBuilder_ == null ? ttl_ : ttlBuilder_.build();
    +        to_bitField0_ |= 0x00000001;
    +      }
    +      if (((from_bitField0_ & 0x00000010) != 0)) {
    +        result.description_ = description_;
    +      }
    +      result.bitField0_ |= to_bitField0_;
    +    }
    +
         @java.lang.Override
         public Builder clone() {
           return super.clone();
    @@ -779,14 +721,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 +739,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,21 +757,66 @@ 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(getTtlFieldBuilder().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_ = "";
         /**
          *
    @@ -899,8 +890,8 @@ public Builder setName(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -920,8 +911,8 @@ 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,8 +937,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           name_ = value;
    +      bitField0_ |= 0x00000001;
           onChanged();
           return this;
         }
    @@ -1025,8 +1016,8 @@ public Builder setCluster(java.lang.String value) {
           if (value == null) {
             throw new NullPointerException();
           }
    -
           cluster_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1046,8 +1037,8 @@ 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,8 +1063,8 @@ public Builder setClusterBytes(com.google.protobuf.ByteString value) {
             throw new NullPointerException();
           }
           checkByteStringIsUtf8(value);
    -
           cluster_ = value;
    +      bitField0_ |= 0x00000002;
           onChanged();
           return this;
         }
    @@ -1083,9 +1074,9 @@ public Builder setClusterBytes(com.google.protobuf.ByteString value) {
          *
          *
          * 
    -     * 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`.
          * 
    * @@ -1108,9 +1099,9 @@ public 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`.
          * 
    * @@ -1133,9 +1124,9 @@ public com.google.protobuf.ByteString getSnapshotIdBytes() { * * *
    -     * 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,8 +1139,8 @@ public Builder setSnapshotId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - snapshotId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1157,9 +1148,9 @@ public Builder setSnapshotId(java.lang.String value) { * * *
    -     * 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,8 +1159,8 @@ public Builder setSnapshotId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearSnapshotId() { - snapshotId_ = getDefaultInstance().getSnapshotId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -1177,9 +1168,9 @@ public Builder clearSnapshotId() { * * *
    -     * 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,8 +1184,8 @@ public Builder setSnapshotIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - snapshotId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1220,7 +1211,7 @@ 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); } /** * @@ -1261,11 +1252,11 @@ public Builder setTtl(com.google.protobuf.Duration value) { throw new NullPointerException(); } ttl_ = value; - onChanged(); } else { ttlBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } /** @@ -1283,11 +1274,11 @@ 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,16 +1295,20 @@ 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,14 +1324,13 @@ 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,7 +1346,7 @@ public Builder clearTtl() { * .google.protobuf.Duration ttl = 4; */ public com.google.protobuf.Duration.Builder getTtlBuilder() { - + bitField0_ |= 0x00000008; onChanged(); return getTtlFieldBuilder().getBuilder(); } @@ -1464,8 +1458,8 @@ public Builder setDescription(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - description_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1481,8 +1475,8 @@ 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,8 +1497,8 @@ public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - description_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -1541,7 +1535,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..fb1f7c8335 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface SnapshotTableRequestOrBuilder @@ -93,9 +94,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`.
        * 
    * @@ -108,9 +109,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`.
        * 
    * 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..d9201a5e05 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWrites.java @@ -0,0 +1,435 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class StandardReadRemoteWrites extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.StandardReadRemoteWrites) + StandardReadRemoteWritesOrBuilder { + private static final long serialVersionUID = 0L; + // Use StandardReadRemoteWrites.newBuilder() to construct. + private StandardReadRemoteWrites(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StandardReadRemoteWrites() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..43547ad385 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/StandardReadRemoteWritesOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..f9c8c19f2a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/common.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** 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 9ed5da936d..c06d068870 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -49,117 +50,6 @@ 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 +57,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(); @@ -384,7 +275,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; @@ -448,7 +339,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; @@ -566,7 +457,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 enum numeric value on the wire for replicationState. @@ -579,7 +471,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. @@ -698,71 +591,6 @@ 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; @@ -1023,7 +851,7 @@ private ReplicationState(int value) { } public static final int REPLICATION_STATE_FIELD_NUMBER = 1; - private int replicationState_; + private int replicationState_ = 0; /** * * @@ -1031,7 +859,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. @@ -1047,16 +876,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,6 +893,8 @@ 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_; /** * @@ -1185,7 +1016,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 +1033,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 +1051,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 +1068,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; } @@ -1368,32 +1199,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) { 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,19 +1244,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; + } + + 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 +1327,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,7 +1340,7 @@ 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() @@ -1514,7 +1350,7 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Table.ClusterState other) } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1529,18 +1365,50 @@ 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; } @@ -1554,7 +1422,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. @@ -1570,15 +1439,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]; * * * @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 +1459,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,9 +1468,8 @@ 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 @@ -1612,7 +1482,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,7 +1494,7 @@ public Builder setReplicationState( if (value == null) { throw new NullPointerException(); } - + bitField0_ |= 0x00000001; replicationState_ = value.getNumber(); onChanged(); return this; @@ -1635,13 +1506,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,10 +1523,10 @@ 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; } } @@ -1938,7 +1810,7 @@ public Builder addAllEncryptionInfo( public Builder clearEncryptionInfo() { if (encryptionInfoBuilder_ == null) { encryptionInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { encryptionInfoBuilder_.clear(); @@ -2106,7 +1978,7 @@ public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuil com.google.bigtable.admin.v2.EncryptionInfo.Builder, com.google.bigtable.admin.v2.EncryptionInfoOrBuilder>( encryptionInfo_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); encryptionInfo_ = null; @@ -2147,7 +2019,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,908 +2050,3115 @@ 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; - } + public interface AutomatedBackupPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
    +     * Required. How long the automated backups should be retained. The only
    +     * supported value at this time is 3 days.
    +     * 
    + * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the retentionPeriod field is set. + */ + boolean hasRetentionPeriod(); + /** + * + * + *
    +     * Required. How long the automated backups should be retained. The only
    +     * supported value at this time is 3 days.
    +     * 
    + * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The retentionPeriod. + */ + com.google.protobuf.Duration getRetentionPeriod(); + /** + * + * + *
    +     * Required. How long the automated backups should be retained. The only
    +     * supported value at this time is 3 days.
    +     * 
    + * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getRetentionPeriodOrBuilder(); + + /** + * + * + *
    +     * Required. How frequently automated backups should occur. The only
    +     * supported value at this time is 24 hours.
    +     * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the frequency field is set. + */ + boolean hasFrequency(); + /** + * + * + *
    +     * Required. How frequently automated backups should occur. The only
    +     * supported value at this time is 24 hours.
    +     * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The frequency. + */ + com.google.protobuf.Duration getFrequency(); + /** + * + * + *
    +     * Required. How frequently automated backups should occur. The only
    +     * supported value at this time is 24 hours.
    +     * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.DurationOrBuilder getFrequencyOrBuilder(); } /** * * *
    -   * 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`
    +   * Defines an automated backup policy for a table
        * 
    * - * string name = 1; - * - * @return The bytes for name. + * Protobuf type {@code google.bigtable.admin.v2.Table.AutomatedBackupPolicy} */ - @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 class AutomatedBackupPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + AutomatedBackupPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutomatedBackupPolicy.newBuilder() to construct. + private AutomatedBackupPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - } - public static final int CLUSTER_STATES_FIELD_NUMBER = 2; + private AutomatedBackupPolicy() {} - 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()); - } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutomatedBackupPolicy(); + } - private com.google.protobuf.MapField< - java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> - clusterStates_; + 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; + } - 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); + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.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); } - 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; - * - */ - @java.lang.Override - public boolean containsClusterStates(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + private int bitField0_; + public static final int RETENTION_PERIOD_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retentionPeriod_; + /** + * + * + *
    +     * Required. How long the automated backups should be retained. The only
    +     * supported value at this time is 3 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); } - 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(); + /** + * + * + *
    +     * Required. How long the automated backups should be retained. The only
    +     * supported value at this time is 3 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_; } - 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(); + /** + * + * + *
    +     * Required. How long the automated backups should be retained. The only
    +     * supported value at this time is 3 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_; } - java.util.Map map = - internalGetClusterStates().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + + public static final int FREQUENCY_FIELD_NUMBER = 2; + private com.google.protobuf.Duration frequency_; + /** + * + * + *
    +     * Required. How frequently automated backups should occur. The only
    +     * supported value at this time is 24 hours.
    +     * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the frequency field is set. + */ + @java.lang.Override + public boolean hasFrequency() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
    +     * Required. How frequently automated backups should occur. The only
    +     * supported value at this time is 24 hours.
    +     * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The frequency. + */ + @java.lang.Override + public com.google.protobuf.Duration getFrequency() { + return frequency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : frequency_; + } + /** + * + * + *
    +     * Required. How frequently automated backups should occur. The only
    +     * supported value at this time is 24 hours.
    +     * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getFrequencyOrBuilder() { + return frequency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : frequency_; } - return map.get(key); - } - public static final int COLUMN_FAMILIES_FIELD_NUMBER = 3; + private byte memoizedIsInitialized = -1; - 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()); - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - private com.google.protobuf.MapField - columnFamilies_; + memoizedIsInitialized = 1; + return true; + } - private com.google.protobuf.MapField - internalGetColumnFamilies() { - if (columnFamilies_ == null) { - return com.google.protobuf.MapField.emptyMapField( - ColumnFamiliesDefaultEntryHolder.defaultEntry); + @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()); + } + getUnknownFields().writeTo(output); } - return columnFamilies_; - } - 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(); + @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()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; } - 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.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(); - } - 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_; - /** - * - * - *
    -   * (`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; - } + @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; - 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(); - } + 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } - private byte memoizedIsInitialized = -1; + @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(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - memoizedIsInitialized = 1; - return true; - } + 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); + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - 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_); + + 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); } - if (restoreInfo_ != null) { - output.writeMessage(6, getRestoreInfo()); + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + 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); + } - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - 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__); + + 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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - 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__); + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - if (granularity_ - != com.google.bigtable.admin.v2.Table.TimestampGranularity.TIMESTAMP_GRANULARITY_UNSPECIFIED - .getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, granularity_); + + 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.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - if (restoreInfo_ != null) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getRestoreInfo()); + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + 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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - if (!(obj instanceof com.google.bigtable.admin.v2.Table)) { - return super.equals(obj); + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); } - 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; + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public static Builder newBuilder( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - 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(); + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } - hash = (37 * hash) + GRANULARITY_FIELD_NUMBER; - hash = (53 * hash) + granularity_; - if (hasRestoreInfo()) { - hash = (37 * hash) + RESTORE_INFO_FIELD_NUMBER; - hash = (53 * hash) + getRestoreInfo().hashCode(); + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } + /** + * + * + *
    +     * 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.GeneratedMessageV3.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; + } - public static com.google.bigtable.admin.v2.Table parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.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); + } - 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); - } + // Construct using com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - public static com.google.bigtable.admin.v2.Table parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } - 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 void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRetentionPeriodFieldBuilder(); + getFrequencyFieldBuilder(); + } + } - public static com.google.bigtable.admin.v2.Table parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @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; + } + return this; + } - 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); - } + @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; + } - 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); - } + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } - 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); - } + @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; + } - 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); - } + @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; + } - 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); - } + 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; + } + result.bitField0_ |= to_bitField0_; + } - 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); - } + @java.lang.Override + public Builder clone() { + return super.clone(); + } - 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); - } + @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 newBuilderForType() { - return newBuilder(); - } + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + @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.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()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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( + getRetentionPeriodFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getFrequencyFieldBuilder().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.Duration retentionPeriod_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + retentionPeriodBuilder_; + /** + * + * + *
    +       * Required. How long the automated backups should be retained. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 days.
    +       * 
    + * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getRetentionPeriodBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRetentionPeriodFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * Required. How long the automated backups should be retained. The only
    +       * supported value at this time is 3 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. The only
    +       * supported value at this time is 3 days.
    +       * 
    + * + * + * .google.protobuf.Duration retention_period = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getRetentionPeriodFieldBuilder() { + if (retentionPeriodBuilder_ == null) { + retentionPeriodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + frequencyBuilder_; + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the frequency field is set. + */ + public boolean hasFrequency() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFrequency() { + bitField0_ = (bitField0_ & ~0x00000002); + frequency_ = null; + if (frequencyBuilder_ != null) { + frequencyBuilder_.dispose(); + frequencyBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.Duration.Builder getFrequencyBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFrequencyFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.DurationOrBuilder getFrequencyOrBuilder() { + if (frequencyBuilder_ != null) { + return frequencyBuilder_.getMessageOrBuilder(); + } else { + return frequency_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : frequency_; + } + } + /** + * + * + *
    +       * Required. How frequently automated backups should occur. The only
    +       * supported value at this time is 24 hours.
    +       * 
    + * + * .google.protobuf.Duration frequency = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getFrequencyFieldBuilder() { + if (frequencyBuilder_ == null) { + frequencyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getFrequency(), getParentForChildren(), isClean()); + frequency_ = null; + } + return frequencyBuilder_; + } + + @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.AutomatedBackupPolicy) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Table.AutomatedBackupPolicy) + private static final com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy(); + } + + public static com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomatedBackupPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + private int automatedBackupConfigCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object automatedBackupConfig_; + + public enum AutomatedBackupConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTOMATED_BACKUP_POLICY(13), + AUTOMATEDBACKUPCONFIG_NOT_SET(0); + private final int value; + + private AutomatedBackupConfigCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AutomatedBackupConfigCase valueOf(int value) { + return forNumber(value); + } + + public static AutomatedBackupConfigCase forNumber(int value) { + switch (value) { + case 13: + return AUTOMATED_BACKUP_POLICY; + case 0: + return AUTOMATEDBACKUPCONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AutomatedBackupConfigCase getAutomatedBackupConfigCase() { + return AutomatedBackupConfigCase.forNumber(automatedBackupConfigCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
    +   * The unique name of the table. Values are of the form
    +   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +   * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +   * 
    + * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
    +   * The unique name of the table. Values are of the form
    +   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +   * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +   * 
    + * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CLUSTER_STATES_FIELD_NUMBER = 2; + + private static final class ClusterStatesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.Table.ClusterState.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + clusterStates_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + internalGetClusterStates() { + if (clusterStates_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ClusterStatesDefaultEntryHolder.defaultEntry); + } + return clusterStates_; + } + + public int getClusterStatesCount() { + return internalGetClusterStates().getMap().size(); + } + /** + * + * + *
    +   * Output only. Map from cluster ID to per-cluster table state.
    +   * If it could not be determined whether or not the table has data in a
    +   * particular cluster (for example, if its zone is unavailable), then
    +   * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public boolean containsClusterStates(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetClusterStates().getMap().containsKey(key); + } + /** Use {@link #getClusterStatesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getClusterStates() { + return getClusterStatesMap(); + } + /** + * + * + *
    +   * Output only. Map from cluster ID to per-cluster table state.
    +   * If it could not be determined whether or not the table has data in a
    +   * particular cluster (for example, if its zone is unavailable), then
    +   * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.Map + getClusterStatesMap() { + return internalGetClusterStates().getMap(); + } + /** + * + * + *
    +   * Output only. Map from cluster ID to per-cluster table state.
    +   * If it could not be determined whether or not the table has data in a
    +   * particular cluster (for example, if its zone is unavailable), then
    +   * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetClusterStates().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
    +   * Output only. Map from cluster ID to per-cluster table state.
    +   * If it could not be determined whether or not the table has data in a
    +   * particular cluster (for example, if its zone is unavailable), then
    +   * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +   * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +   * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetClusterStates().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int COLUMN_FAMILIES_FIELD_NUMBER = 3; + + private static final class ColumnFamiliesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.bigtable.admin.v2.ColumnFamily.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField + columnFamilies_; + + private com.google.protobuf.MapField + internalGetColumnFamilies() { + if (columnFamilies_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ColumnFamiliesDefaultEntryHolder.defaultEntry); + } + return columnFamilies_; + } + + public int getColumnFamiliesCount() { + return internalGetColumnFamilies().getMap().size(); + } + /** + * + * + *
    +   * The column families configured for this table, mapped by column family ID.
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +   * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public boolean containsColumnFamilies(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetColumnFamilies().getMap().containsKey(key); + } + /** Use {@link #getColumnFamiliesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getColumnFamilies() { + return getColumnFamiliesMap(); + } + /** + * + * + *
    +   * The column families configured for this table, mapped by column family ID.
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +   * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public java.util.Map + getColumnFamiliesMap() { + return internalGetColumnFamilies().getMap(); + } + /** + * + * + *
    +   * The column families configured for this table, mapped by column family ID.
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +   * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.ColumnFamily defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetColumnFamilies().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
    +   * The column families configured for this table, mapped by column family ID.
    +   * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +   * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetColumnFamilies().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int GRANULARITY_FIELD_NUMBER = 4; + private int granularity_ = 0; + /** + * + * + *
    +   * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
    +   * in this table. Timestamps not matching the granularity will be rejected. If
    +   * unspecified at creation time, the value will be set to `MILLIS`. Views:
    +   * `SCHEMA_VIEW`, `FULL`.
    +   * 
    + * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for granularity. + */ + @java.lang.Override + public int getGranularityValue() { + return granularity_; + } + /** + * + * + *
    +   * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
    +   * in this table. Timestamps not matching the granularity will be rejected. If
    +   * unspecified at creation time, the value will be set to `MILLIS`. Views:
    +   * `SCHEMA_VIEW`, `FULL`.
    +   * 
    + * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The granularity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity() { + com.google.bigtable.admin.v2.Table.TimestampGranularity result = + com.google.bigtable.admin.v2.Table.TimestampGranularity.forNumber(granularity_); + return result == null + ? com.google.bigtable.admin.v2.Table.TimestampGranularity.UNRECOGNIZED + : result; + } + + public static final int RESTORE_INFO_FIELD_NUMBER = 6; + private com.google.bigtable.admin.v2.RestoreInfo restoreInfo_; + /** + * + * + *
    +   * Output only. If this table was restored from another data source (e.g. a
    +   * backup), this field will be populated with information about the restore.
    +   * 
    + * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the restoreInfo field is set. + */ + @java.lang.Override + public boolean hasRestoreInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
    +   * Output only. If this table was restored from another data source (e.g. a
    +   * backup), this field will be populated with information about the restore.
    +   * 
    + * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The restoreInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo() { + return restoreInfo_ == null + ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + /** + * + * + *
    +   * Output only. If this table was restored from another data source (e.g. a
    +   * backup), this field will be populated with information about the restore.
    +   * 
    + * + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { + return restoreInfo_ == null + ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() + : restoreInfo_; + } + + public static final int CHANGE_STREAM_CONFIG_FIELD_NUMBER = 8; + private com.google.bigtable.admin.v2.ChangeStreamConfig changeStreamConfig_; + /** + * + * + *
    +   * If specified, enable the change stream on this table.
    +   * Otherwise, the change stream is disabled and the change stream is not
    +   * retained.
    +   * 
    + * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return Whether the changeStreamConfig field is set. + */ + @java.lang.Override + public boolean hasChangeStreamConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
    +   * If specified, enable the change stream on this table.
    +   * Otherwise, the change stream is disabled and the change stream is not
    +   * retained.
    +   * 
    + * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return The changeStreamConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfig getChangeStreamConfig() { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } + /** + * + * + *
    +   * If specified, enable the change stream on this table.
    +   * Otherwise, the change stream is disabled and the change stream is not
    +   * retained.
    +   * 
    + * + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + @java.lang.Override + public com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder getChangeStreamConfigOrBuilder() { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } + + public static final int DELETION_PROTECTION_FIELD_NUMBER = 9; + private boolean deletionProtection_ = false; + /** + * + * + *
    +   * Set to true to make the table protected against data loss. i.e. deleting
    +   * the following resources through Admin APIs are prohibited:
    +   *
    +   * * The table.
    +   * * The column families in the table.
    +   * * The instance containing the table.
    +   *
    +   * Note one can still delete the data stored in the table through Data APIs.
    +   * 
    + * + * bool deletion_protection = 9; + * + * @return The deletionProtection. + */ + @java.lang.Override + public boolean getDeletionProtection() { + return deletionProtection_; + } + + public static final int AUTOMATED_BACKUP_POLICY_FIELD_NUMBER = 13; + /** + * + * + *
    +   * If specified, automated backups are enabled for this table.
    +   * Otherwise, automated backups are disabled.
    +   * 
    + * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return Whether the automatedBackupPolicy field is set. + */ + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupConfigCase_ == 13; + } + /** + * + * + *
    +   * If specified, automated backups are enabled for this table.
    +   * Otherwise, automated backups are disabled.
    +   * 
    + * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + * + * @return The automatedBackupPolicy. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + /** + * + * + *
    +   * If specified, automated backups are enabled for this table.
    +   * Otherwise, automated backups are disabled.
    +   * 
    + * + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + 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_); + } + 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_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @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 (!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()); + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.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; + } + + @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.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); + } + + // Construct using com.google.bigtable.admin.v2.Table.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRestoreInfoFieldBuilder(); + getChangeStreamConfigFieldBuilder(); + } + } + + @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(); + } + 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_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.admin.v2.Table result) { + result.automatedBackupConfigCase_ = automatedBackupConfigCase_; + result.automatedBackupConfig_ = this.automatedBackupConfig_; + if (automatedBackupConfigCase_ == 13 && automatedBackupPolicyBuilder_ != null) { + result.automatedBackupConfig_ = automatedBackupPolicyBuilder_.build(); + } + } + + @java.lang.Override + public Builder 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.Table) { + return mergeFrom((com.google.bigtable.admin.v2.Table) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Table other) { + if (other == com.google.bigtable.admin.v2.Table.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + internalGetMutableClusterStates().mergeFrom(other.internalGetClusterStates()); + bitField0_ |= 0x00000002; + internalGetMutableColumnFamilies().mergeFrom(other.internalGetColumnFamilies()); + bitField0_ |= 0x00000004; + if (other.granularity_ != 0) { + setGranularityValue(other.getGranularityValue()); + } + if (other.hasRestoreInfo()) { + mergeRestoreInfo(other.getRestoreInfo()); + } + if (other.hasChangeStreamConfig()) { + mergeChangeStreamConfig(other.getChangeStreamConfig()); + } + if (other.getDeletionProtection() != false) { + setDeletionProtection(other.getDeletionProtection()); + } + switch (other.getAutomatedBackupConfigCase()) { + case AUTOMATED_BACKUP_POLICY: + { + mergeAutomatedBackupPolicy(other.getAutomatedBackupPolicy()); + break; + } + case AUTOMATEDBACKUPCONFIG_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.Table.ClusterState> + clusterStates__ = + input.readMessage( + ClusterStatesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableClusterStates() + .ensureBuilderMap() + .put(clusterStates__.getKey(), clusterStates__.getValue()); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> + columnFamilies__ = + input.readMessage( + ColumnFamiliesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableColumnFamilies() + .ensureBuilderMap() + .put(columnFamilies__.getKey(), columnFamilies__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + granularity_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 50: + { + input.readMessage(getRestoreInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 66: + { + input.readMessage( + getChangeStreamConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 66 + case 72: + { + deletionProtection_ = input.readBool(); + bitField0_ |= 0x00000040; + break; + } // case 72 + case 106: + { + input.readMessage( + getAutomatedBackupPolicyFieldBuilder().getBuilder(), extensionRegistry); + automatedBackupConfigCase_ = 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 automatedBackupConfigCase_ = 0; + private java.lang.Object automatedBackupConfig_; + + public AutomatedBackupConfigCase getAutomatedBackupConfigCase() { + return AutomatedBackupConfigCase.forNumber(automatedBackupConfigCase_); + } + + public Builder clearAutomatedBackupConfig() { + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
    +     * The unique name of the table. Values are of the form
    +     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +     * 
    + * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
    +     * The unique name of the table. Values are of the form
    +     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +     * 
    + * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
    +     * The unique name of the table. Values are of the form
    +     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +     * 
    + * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
    +     * The unique name of the table. Values are of the form
    +     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +     * 
    + * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
    +     * The unique name of the table. Values are of the form
    +     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    +     * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    +     * 
    + * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private static final class ClusterStatesConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.String, + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder, + com.google.bigtable.admin.v2.Table.ClusterState> { + @java.lang.Override + public com.google.bigtable.admin.v2.Table.ClusterState build( + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder val) { + if (val instanceof com.google.bigtable.admin.v2.Table.ClusterState) { + return (com.google.bigtable.admin.v2.Table.ClusterState) val; + } + return ((com.google.bigtable.admin.v2.Table.ClusterState.Builder) val).build(); + } - public static Builder newBuilder(com.google.bigtable.admin.v2.Table prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + @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 Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + private static final ClusterStatesConverter clusterStatesConverter = + new ClusterStatesConverter(); - @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; - } + 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_; - @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); + 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_; } - @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); + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder, + com.google.bigtable.admin.v2.Table.ClusterState, + com.google.bigtable.admin.v2.Table.ClusterState.Builder> + internalGetMutableClusterStates() { + if (clusterStates_ == null) { + clusterStates_ = new com.google.protobuf.MapFieldBuilder<>(clusterStatesConverter); } + bitField0_ |= 0x00000002; + onChanged(); + return clusterStates_; } + public int getClusterStatesCount() { + return internalGetClusterStates().ensureBuilderMap().size(); + } + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ @java.lang.Override - 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); + public boolean containsClusterStates(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetClusterStates().ensureBuilderMap().containsKey(key); } - - // Construct using com.google.bigtable.admin.v2.Table.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** Use {@link #getClusterStatesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getClusterStates() { + return getClusterStatesMap(); } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * + * + *
    +     * 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(); } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public /* nullable */ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( + java.lang.String key, + /* nullable */ + com.google.bigtable.admin.v2.Table.ClusterState defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableClusterStates().ensureBuilderMap(); + return map.containsKey(key) ? clusterStatesConverter.build(map.get(key)) : defaultValue; } - + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; + public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map + map = internalGetMutableClusterStates().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return clusterStatesConverter.build(map.get(key)); + } + public Builder clearClusterStates() { + bitField0_ = (bitField0_ & ~0x00000002); internalGetMutableClusterStates().clear(); - internalGetMutableColumnFamilies().clear(); - granularity_ = 0; - - if (restoreInfoBuilder_ == null) { - restoreInfo_ = null; - } else { - restoreInfo_ = null; - restoreInfoBuilder_ = null; + return this; + } + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeClusterStates(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } + internalGetMutableClusterStates().ensureBuilderMap().remove(key); return this; } - - @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; + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableClusterStates() { + bitField0_ |= 0x00000002; + return internalGetMutableClusterStates().ensureMessageMap(); + } + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder putClusterStates( + java.lang.String key, com.google.bigtable.admin.v2.Table.ClusterState value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableClusterStates().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder putAllClusterStates( + java.util.Map values) { + for (java.util.Map.Entry + e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableClusterStates().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000002; + return this; + } + /** + * + * + *
    +     * Output only. Map from cluster ID to per-cluster table state.
    +     * If it could not be determined whether or not the table has data in a
    +     * particular cluster (for example, if its zone is unavailable), then
    +     * there will be an entry for the cluster with UNKNOWN `replication_status`.
    +     * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL`
    +     * 
    + * + * + * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.Table.ClusterState.Builder putClusterStatesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableClusterStates().ensureBuilderMap(); + com.google.bigtable.admin.v2.Table.ClusterStateOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.Table.ClusterState.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.Table.ClusterState) { + entry = ((com.google.bigtable.admin.v2.Table.ClusterState) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.Table.ClusterState.Builder) entry; } - @java.lang.Override - public com.google.bigtable.admin.v2.Table getDefaultInstanceForType() { - return com.google.bigtable.admin.v2.Table.getDefaultInstance(); - } + 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.bigtable.admin.v2.Table build() { - com.google.bigtable.admin.v2.Table result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + @java.lang.Override + public com.google.protobuf.MapEntry< + java.lang.String, com.google.bigtable.admin.v2.ColumnFamily> + defaultEntry() { + return ColumnFamiliesDefaultEntryHolder.defaultEntry; } - 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); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.clusterStates_ = internalGetClusterStates(); - result.clusterStates_.makeImmutable(); - result.columnFamilies_ = internalGetColumnFamilies(); - result.columnFamilies_.makeImmutable(); - result.granularity_ = granularity_; - if (restoreInfoBuilder_ == null) { - result.restoreInfo_ = restoreInfo_; - } else { - result.restoreInfo_ = restoreInfoBuilder_.build(); + private static final ColumnFamiliesConverter columnFamiliesConverter = + new ColumnFamiliesConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder, + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder> + columnFamilies_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.String, + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder, + com.google.bigtable.admin.v2.ColumnFamily, + com.google.bigtable.admin.v2.ColumnFamily.Builder> + internalGetColumnFamilies() { + if (columnFamilies_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(columnFamiliesConverter); } - onBuilt(); - return result; + return columnFamilies_; } - @java.lang.Override - public Builder clone() { - return super.clone(); + 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_; } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); + public int getColumnFamiliesCount() { + return internalGetColumnFamilies().ensureBuilderMap().size(); } - + /** + * + * + *
    +     * The column families configured for this table, mapped by column family ID.
    +     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +     * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); + public boolean containsColumnFamilies(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetColumnFamilies().ensureBuilderMap().containsKey(key); } - + /** Use {@link #getColumnFamiliesMap()} instead. */ @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); + @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 Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); + 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 Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); + 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 Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.bigtable.admin.v2.Table) { - return mergeFrom((com.google.bigtable.admin.v2.Table) other); - } else { - super.mergeFrom(other); - return this; + public com.google.bigtable.admin.v2.ColumnFamily getColumnFamiliesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetMutableColumnFamilies().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); } + return columnFamiliesConverter.build(map.get(key)); } - public Builder 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(); + public Builder clearColumnFamilies() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableColumnFamilies().clear(); + return this; + } + /** + * + * + *
    +     * The column families configured for this table, mapped by column family ID.
    +     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +     * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public Builder removeColumnFamilies(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); } - internalGetMutableClusterStates().mergeFrom(other.internalGetClusterStates()); - internalGetMutableColumnFamilies().mergeFrom(other.internalGetColumnFamilies()); - if (other.granularity_ != 0) { - setGranularityValue(other.getGranularityValue()); + internalGetMutableColumnFamilies().ensureBuilderMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableColumnFamilies() { + bitField0_ |= 0x00000004; + return internalGetMutableColumnFamilies().ensureMessageMap(); + } + /** + * + * + *
    +     * The column families configured for this table, mapped by column family ID.
    +     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +     * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public Builder putColumnFamilies( + java.lang.String key, com.google.bigtable.admin.v2.ColumnFamily value) { + if (key == null) { + throw new NullPointerException("map key"); } - if (other.hasRestoreInfo()) { - mergeRestoreInfo(other.getRestoreInfo()); + if (value == null) { + throw new NullPointerException("map value"); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); + internalGetMutableColumnFamilies().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000004; return this; } - - @java.lang.Override - public final 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); + /** + * + * + *
    +     * The column families configured for this table, mapped by column family ID.
    +     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +     * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public Builder putAllColumnFamilies( + java.util.Map values) { + for (java.util.Map.Entry e : + values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); } } + internalGetMutableColumnFamilies().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000004; return this; } + /** + * + * + *
    +     * The column families configured for this table, mapped by column family ID.
    +     * Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL`
    +     * 
    + * + * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + */ + public com.google.bigtable.admin.v2.ColumnFamily.Builder putColumnFamiliesBuilderIfAbsent( + java.lang.String key) { + java.util.Map + builderMap = internalGetMutableColumnFamilies().ensureBuilderMap(); + com.google.bigtable.admin.v2.ColumnFamilyOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.bigtable.admin.v2.ColumnFamily.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.bigtable.admin.v2.ColumnFamily) { + entry = ((com.google.bigtable.admin.v2.ColumnFamily) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.bigtable.admin.v2.ColumnFamily.Builder) entry; + } - private int bitField0_; - - private java.lang.Object name_ = ""; + private int granularity_ = 0; /** * * *
    -     * 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`
    +     * 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`.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @return The name. + * @return The enum numeric value on the wire for granularity. */ - 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; - } + @java.lang.Override + public int getGranularityValue() { + return granularity_; } /** * * *
    -     * 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`
    +     * 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`.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @return The bytes for name. + * @param value The enum numeric value on the wire for granularity to set. + * @return This builder for chaining. */ - 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; - } + public Builder setGranularityValue(int value) { + granularity_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
    +     * Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored
    +     * in this table. Timestamps not matching the granularity will be rejected. If
    +     * unspecified at creation time, the value will be set to `MILLIS`. Views:
    +     * `SCHEMA_VIEW`, `FULL`.
    +     * 
    + * + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The granularity. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Table.TimestampGranularity getGranularity() { + com.google.bigtable.admin.v2.Table.TimestampGranularity result = + com.google.bigtable.admin.v2.Table.TimestampGranularity.forNumber(granularity_); + return result == null + ? com.google.bigtable.admin.v2.Table.TimestampGranularity.UNRECOGNIZED + : result; } /** * * *
    -     * 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`
    +     * 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`.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * * - * @param value The name to set. + * @param value The granularity to set. * @return This builder for chaining. */ - public Builder setName(java.lang.String value) { + public Builder setGranularity(com.google.bigtable.admin.v2.Table.TimestampGranularity value) { if (value == null) { throw new NullPointerException(); } - - name_ = value; + bitField0_ |= 0x00000008; + granularity_ = value.getNumber(); onChanged(); return this; } @@ -3075,527 +5166,490 @@ public Builder setName(java.lang.String value) { * * *
    -     * 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`
    +     * 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`.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * * * @return This builder for chaining. */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); + public Builder clearGranularity() { + bitField0_ = (bitField0_ & ~0x00000008); + granularity_ = 0; onChanged(); return this; } + + 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_; /** * * *
    -     * 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`
    +     * 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.
          * 
    * - * string name = 1; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * * - * @param value The bytes for name to set. - * @return This builder for chaining. + * @return Whether the restoreInfo field is set. */ - public Builder setNameBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - 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); - } - return clusterStates_; - } - - 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_; - } - - public int getClusterStatesCount() { - return internalGetClusterStates().getMap().size(); + public boolean hasRestoreInfo() { + return ((bitField0_ & 0x00000010) != 0); } /** * * *
    -     * 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * + * + * @return The restoreInfo. */ - @java.lang.Override - public boolean containsClusterStates(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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(); } - 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - @java.lang.Override - public java.util.Map - getClusterStatesMap() { - return internalGetClusterStates().getMap(); + public Builder setRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { + if (restoreInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + restoreInfo_ = value; + } else { + restoreInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; } /** * * *
    -     * Output only. 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - @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(); + public Builder setRestoreInfo( + com.google.bigtable.admin.v2.RestoreInfo.Builder builderForValue) { + if (restoreInfoBuilder_ == null) { + restoreInfo_ = builderForValue.build(); + } else { + restoreInfoBuilder_.setMessage(builderForValue.build()); } - java.util.Map map = - internalGetClusterStates().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; + bitField0_ |= 0x00000010; + 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.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 java.lang.NullPointerException(); + public Builder mergeRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { + if (restoreInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && restoreInfo_ != null + && restoreInfo_ != com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance()) { + getRestoreInfoBuilder().mergeFrom(value); + } else { + restoreInfo_ = value; + } + } else { + restoreInfoBuilder_.mergeFrom(value); } - java.util.Map map = - internalGetClusterStates().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); + if (restoreInfo_ != null) { + bitField0_ |= 0x00000010; + onChanged(); } - 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; * */ - public Builder removeClusterStates(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + public Builder clearRestoreInfo() { + bitField0_ = (bitField0_ & ~0x00000010); + restoreInfo_ = null; + if (restoreInfoBuilder_ != null) { + restoreInfoBuilder_.dispose(); + restoreInfoBuilder_ = null; } - internalGetMutableClusterStates().getMutableMap().remove(key); + onChanged(); 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.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 java.lang.NullPointerException(); - } - if (value == null) { - throw new java.lang.NullPointerException(); - } - internalGetMutableClusterStates().getMutableMap().put(key, value); - return this; + public com.google.bigtable.admin.v2.RestoreInfo.Builder getRestoreInfoBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getRestoreInfoFieldBuilder().getBuilder(); } /** * * *
    -     * 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`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; - * - */ - 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(); + * + * .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_; } - return columnFamilies_; - } - - public int getColumnFamiliesCount() { - return internalGetColumnFamilies().getMap().size(); } /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * 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.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * + * .google.bigtable.admin.v2.RestoreInfo restore_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * */ - @java.lang.Override - public boolean containsColumnFamilies(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + 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; } - return internalGetColumnFamilies().getMap().containsKey(key); - } - /** Use {@link #getColumnFamiliesMap()} instead. */ - @java.lang.Override - @java.lang.Deprecated - public java.util.Map - getColumnFamilies() { - return getColumnFamiliesMap(); + return restoreInfoBuilder_; } + + private com.google.bigtable.admin.v2.ChangeStreamConfig changeStreamConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.ChangeStreamConfig, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder, + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder> + changeStreamConfigBuilder_; /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return Whether the changeStreamConfig field is set. */ - @java.lang.Override - public java.util.Map - getColumnFamiliesMap() { - return internalGetColumnFamilies().getMap(); + public boolean hasChangeStreamConfig() { + return ((bitField0_ & 0x00000020) != 0); } /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + * + * @return The changeStreamConfig. */ - @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.ChangeStreamConfig getChangeStreamConfig() { + if (changeStreamConfigBuilder_ == null) { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } else { + return changeStreamConfigBuilder_.getMessage(); } - 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, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - @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(); + 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); } - return map.get(key); - } - - public Builder clearColumnFamilies() { - internalGetMutableColumnFamilies().getMutableMap().clear(); + bitField0_ |= 0x00000020; + onChanged(); return this; } /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - public Builder removeColumnFamilies(java.lang.String key) { - if (key == null) { - throw new java.lang.NullPointerException(); + public Builder setChangeStreamConfig( + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder builderForValue) { + if (changeStreamConfigBuilder_ == null) { + changeStreamConfig_ = builderForValue.build(); + } else { + changeStreamConfigBuilder_.setMessage(builderForValue.build()); } - internalGetMutableColumnFamilies().getMutableMap().remove(key); + bitField0_ |= 0x00000020; + onChanged(); 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`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - public Builder putColumnFamilies( - java.lang.String key, com.google.bigtable.admin.v2.ColumnFamily value) { - if (key == null) { - throw new java.lang.NullPointerException(); + public Builder mergeChangeStreamConfig(com.google.bigtable.admin.v2.ChangeStreamConfig value) { + if (changeStreamConfigBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && changeStreamConfig_ != null + && changeStreamConfig_ + != com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance()) { + getChangeStreamConfigBuilder().mergeFrom(value); + } else { + changeStreamConfig_ = value; + } + } else { + changeStreamConfigBuilder_.mergeFrom(value); } - if (value == null) { - throw new java.lang.NullPointerException(); + if (changeStreamConfig_ != null) { + bitField0_ |= 0x00000020; + onChanged(); } - internalGetMutableColumnFamilies().getMutableMap().put(key, value); return this; } /** * * *
    -     * (`CreationOnly`)
    -     * The column families configured for this table, mapped by column family ID.
    -     * Views: `SCHEMA_VIEW`, `FULL`
    +     * If specified, enable the change stream on this table.
    +     * Otherwise, the change stream is disabled and the change stream is not
    +     * retained.
          * 
    * - * map<string, .google.bigtable.admin.v2.ColumnFamily> column_families = 3; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - public Builder putAllColumnFamilies( - java.util.Map values) { - internalGetMutableColumnFamilies().getMutableMap().putAll(values); + public Builder clearChangeStreamConfig() { + bitField0_ = (bitField0_ & ~0x00000020); + changeStreamConfig_ = null; + if (changeStreamConfigBuilder_ != null) { + changeStreamConfigBuilder_.dispose(); + changeStreamConfigBuilder_ = null; + } + 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`.
    +     * 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.Table.TimestampGranularity granularity = 4; - * - * @return The enum numeric value on the wire for granularity. + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; */ - @java.lang.Override - public int getGranularityValue() { - return granularity_; + public com.google.bigtable.admin.v2.ChangeStreamConfig.Builder getChangeStreamConfigBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getChangeStreamConfigFieldBuilder().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`.
    +     * 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.Table.TimestampGranularity granularity = 4; + * .google.bigtable.admin.v2.ChangeStreamConfig change_stream_config = 8; + */ + public com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder + getChangeStreamConfigOrBuilder() { + if (changeStreamConfigBuilder_ != null) { + return changeStreamConfigBuilder_.getMessageOrBuilder(); + } else { + return changeStreamConfig_ == null + ? com.google.bigtable.admin.v2.ChangeStreamConfig.getDefaultInstance() + : changeStreamConfig_; + } + } + /** + * * - * @param value The enum numeric value on the wire for granularity to set. - * @return This builder for chaining. + *
    +     * 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 setGranularityValue(int value) { - - granularity_ = value; - onChanged(); - return this; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.ChangeStreamConfig, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder, + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder> + getChangeStreamConfigFieldBuilder() { + if (changeStreamConfigBuilder_ == null) { + changeStreamConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.ChangeStreamConfig, + com.google.bigtable.admin.v2.ChangeStreamConfig.Builder, + com.google.bigtable.admin.v2.ChangeStreamConfigOrBuilder>( + getChangeStreamConfig(), getParentForChildren(), isClean()); + changeStreamConfig_ = null; + } + return changeStreamConfigBuilder_; } + + private boolean deletionProtection_; /** * * *
    -     * (`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`.
    +     * 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.
          * 
    * - * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4; + * bool deletion_protection = 9; * - * @return The granularity. + * @return The deletionProtection. */ @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 boolean getDeletionProtection() { + return deletionProtection_; } /** * * *
    -     * (`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`.
    +     * 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.
          * 
    * - * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4; + * bool deletion_protection = 9; * - * @param value The granularity to set. + * @param value The deletionProtection to set. * @return This builder for chaining. */ - public Builder setGranularity(com.google.bigtable.admin.v2.Table.TimestampGranularity value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder setDeletionProtection(boolean value) { - granularity_ = value.getNumber(); + deletionProtection_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -3603,217 +5657,259 @@ public Builder setGranularity(com.google.bigtable.admin.v2.Table.TimestampGranul * * *
    -     * (`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`.
    +     * 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.
          * 
    * - * .google.bigtable.admin.v2.Table.TimestampGranularity granularity = 4; + * bool deletion_protection = 9; * * @return This builder for chaining. */ - public Builder clearGranularity() { - - granularity_ = 0; + public Builder clearDeletionProtection() { + bitField0_ = (bitField0_ & ~0x00000040); + deletionProtection_ = false; onChanged(); return this; } - 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_; + 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. If this table was restored from another data source (e.g. a
    -     * backup), this field will be populated with information about the restore.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * * - * @return Whether the restoreInfo field is set. + * @return Whether the automatedBackupPolicy field is set. */ - public boolean hasRestoreInfo() { - return restoreInfoBuilder_ != null || restoreInfo_ != null; + @java.lang.Override + public boolean hasAutomatedBackupPolicy() { + return automatedBackupConfigCase_ == 13; } /** * * *
    -     * 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * * - * @return The restoreInfo. + * @return The automatedBackupPolicy. */ - public com.google.bigtable.admin.v2.RestoreInfo getRestoreInfo() { - if (restoreInfoBuilder_ == null) { - return restoreInfo_ == null - ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() - : restoreInfo_; + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy getAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); } else { - return restoreInfoBuilder_.getMessage(); + if (automatedBackupConfigCase_ == 13) { + return automatedBackupPolicyBuilder_.getMessage(); + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); } } /** * * *
    -     * 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - public Builder setRestoreInfo(com.google.bigtable.admin.v2.RestoreInfo value) { - if (restoreInfoBuilder_ == null) { + public Builder setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy value) { + if (automatedBackupPolicyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - restoreInfo_ = value; + automatedBackupConfig_ = value; onChanged(); } else { - restoreInfoBuilder_.setMessage(value); + automatedBackupPolicyBuilder_.setMessage(value); } - + automatedBackupConfigCase_ = 13; 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - public Builder setRestoreInfo( - com.google.bigtable.admin.v2.RestoreInfo.Builder builderForValue) { - if (restoreInfoBuilder_ == null) { - restoreInfo_ = builderForValue.build(); + public Builder setAutomatedBackupPolicy( + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder builderForValue) { + if (automatedBackupPolicyBuilder_ == null) { + automatedBackupConfig_ = builderForValue.build(); onChanged(); } else { - restoreInfoBuilder_.setMessage(builderForValue.build()); + automatedBackupPolicyBuilder_.setMessage(builderForValue.build()); } - + automatedBackupConfigCase_ = 13; 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - 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_) + 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 { - restoreInfo_ = value; + automatedBackupConfig_ = value; } onChanged(); } else { - restoreInfoBuilder_.mergeFrom(value); + if (automatedBackupConfigCase_ == 13) { + automatedBackupPolicyBuilder_.mergeFrom(value); + } else { + automatedBackupPolicyBuilder_.setMessage(value); + } } - + automatedBackupConfigCase_ = 13; 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - public Builder clearRestoreInfo() { - if (restoreInfoBuilder_ == null) { - restoreInfo_ = null; - onChanged(); + public Builder clearAutomatedBackupPolicy() { + if (automatedBackupPolicyBuilder_ == null) { + if (automatedBackupConfigCase_ == 13) { + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + onChanged(); + } } else { - restoreInfo_ = null; - restoreInfoBuilder_ = null; + if (automatedBackupConfigCase_ == 13) { + automatedBackupConfigCase_ = 0; + automatedBackupConfig_ = null; + } + automatedBackupPolicyBuilder_.clear(); } - 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - public com.google.bigtable.admin.v2.RestoreInfo.Builder getRestoreInfoBuilder() { - - onChanged(); - return getRestoreInfoFieldBuilder().getBuilder(); + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder + getAutomatedBackupPolicyBuilder() { + return getAutomatedBackupPolicyFieldBuilder().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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ - public com.google.bigtable.admin.v2.RestoreInfoOrBuilder getRestoreInfoOrBuilder() { - if (restoreInfoBuilder_ != null) { - return restoreInfoBuilder_.getMessageOrBuilder(); + @java.lang.Override + public com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder + getAutomatedBackupPolicyOrBuilder() { + if ((automatedBackupConfigCase_ == 13) && (automatedBackupPolicyBuilder_ != null)) { + return automatedBackupPolicyBuilder_.getMessageOrBuilder(); } else { - return restoreInfo_ == null - ? com.google.bigtable.admin.v2.RestoreInfo.getDefaultInstance() - : restoreInfo_; + if (automatedBackupConfigCase_ == 13) { + return (com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy) automatedBackupConfig_; + } + return com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); } } /** * * *
    -     * 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.
    +     * If specified, automated backups are enabled for this table.
    +     * Otherwise, automated backups are disabled.
          * 
    * - * .google.bigtable.admin.v2.RestoreInfo restore_info = 6; + * .google.bigtable.admin.v2.Table.AutomatedBackupPolicy automated_backup_policy = 13; + * */ 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_ = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.Builder, + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicyOrBuilder> + getAutomatedBackupPolicyFieldBuilder() { + if (automatedBackupPolicyBuilder_ == null) { + if (!(automatedBackupConfigCase_ == 13)) { + automatedBackupConfig_ = + com.google.bigtable.admin.v2.Table.AutomatedBackupPolicy.getDefaultInstance(); + } + automatedBackupPolicyBuilder_ = 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; + 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 restoreInfoBuilder_; + automatedBackupConfigCase_ = 13; + onChanged(); + return automatedBackupPolicyBuilder_; } @java.lang.Override @@ -3848,7 +5944,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 bf602bdd1c..25337b915d 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 2021 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. @@ -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) 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..a0ff4c7b76 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface TableOrBuilder @@ -63,7 +64,8 @@ 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,7 +80,8 @@ 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); @@ -97,7 +100,8 @@ 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 @@ -113,11 +117,15 @@ 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 +137,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,9 +147,8 @@ 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; @@ -150,9 +158,8 @@ 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; @@ -165,9 +172,8 @@ 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; @@ -177,22 +183,23 @@ 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; */ + /* 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,14 +210,15 @@ 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. */ @@ -219,14 +227,15 @@ 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 granularity. */ @@ -240,7 +249,9 @@ 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. */ @@ -253,7 +264,9 @@ 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. */ @@ -266,7 +279,114 @@ 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(); + + 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 f82367733f..492168fce0 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/table.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public final class TableProto { @@ -31,6 +32,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -39,6 +44,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -47,6 +56,22 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -91,101 +116,139 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\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\"\335\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:_\352A\\" - + "\n\"bigtableadmin.googleapis.com/Table\0226pr" - + "ojects/{project}/instances/{instance}/ta" - + "bles/{table}\"A\n\014ColumnFamily\0221\n\007gc_rule\030" - + "\001 \001(\0132 .google.bigtable.admin.v2.GcRule\"" - + "\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.Durati" - + "onH\000\022E\n\014intersection\030\003 \001(\0132-.google.bigt" - + "able.admin.v2.GcRule.IntersectionH\000\0227\n\005u" - + "nion\030\004 \001(\0132&.google.bigtable.admin.v2.Gc" - + "Rule.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\016EncryptionIn" - + "fo\022U\n\017encryption_type\030\003 \001(\01627.google.big" - + "table.admin.v2.EncryptionInfo.Encryption" - + "TypeB\003\340A\003\0222\n\021encryption_status\030\004 \001(\0132\022.g" - + "oogle.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\033EN" - + "CRYPTION_TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DE" - + "FAULT_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_E" - + "NCRYPTION\020\002\"\314\003\n\010Snapshot\022\014\n\004name\030\001 \001(\t\0225" - + "\n\014source_table\030\002 \001(\0132\037.google.bigtable.a" - + "dmin.v2.Table\022\027\n\017data_size_bytes\030\003 \001(\003\022/" - + "\n\013create_time\030\004 \001(\0132\032.google.protobuf.Ti" - + "mestamp\022/\n\013delete_time\030\005 \001(\0132\032.google.pr" - + "otobuf.Timestamp\0227\n\005state\030\006 \001(\0162(.google" - + ".bigtable.admin.v2.Snapshot.State\022\023\n\013des" - + "cription\030\007 \001(\t\"5\n\005State\022\023\n\017STATE_NOT_KNO" - + "WN\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002:{\352Ax\n%bigt" - + "ableadmin.googleapis.com/Snapshot\022Oproje" - + "cts/{project}/instances/{instance}/clust" - + "ers/{cluster}/snapshots/{snapshot}\"\244\004\n\006B" - + "ackup\022\021\n\004name\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.go" - + "ogle.protobuf.TimestampB\003\340A\002\0223\n\nstart_ti" - + "me\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A" - + "\003\0221\n\010end_time\030\005 \001(\0132\032.google.protobuf.Ti" - + "mestampB\003\340A\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.StateB\003\340A\003\022F\n\017encryption_info\030\t \001" - + "(\0132(.google.bigtable.admin.v2.Encryption" - + "InfoB\003\340A\003\"7\n\005State\022\025\n\021STATE_UNSPECIFIED\020" - + "\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002:u\352Ar\n#bigtabl" - + "eadmin.googleapis.com/Backup\022Kprojects/{" - + "project}/instances/{instance}/clusters/{" - + "cluster}/backups/{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.protobuf.TimestampB\003\340A\003\0221\n\010en" - + "d_time\030\003 \001(\0132\032.google.protobuf.Timestamp" - + "B\003\340A\003\022\031\n\014source_table\030\004 \001(\tB\003\340A\003*D\n\021Rest" - + "oreSourceType\022#\n\037RESTORE_SOURCE_TYPE_UNS" - + "PECIFIED\020\000\022\n\n\006BACKUP\020\001B\374\002\n\034com.google.bi" - + "gtable.admin.v2B\nTableProtoP\001Z=google.go" - + "lang.org/genproto/googleapis/bigtable/ad" - + "min/v2;admin\252\002\036Google.Cloud.Bigtable.Adm" - + "in.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002" - + "\"Google::Cloud::Bigtable::Admin::V2\352A\246\001\n" - + "(cloudkms.googleapis.com/CryptoKeyVersio" - + "n\022zprojects/{project}/locations/{locatio" - + "n}/keyRings/{key_ring}/cryptoKeys/{crypt" - + "o_key}/cryptoKeyVersions/{crypto_key_ver" - + "sion}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_t" + + "ype\030\001 \001(\0162+.google.bigtable.admin.v2.Res" + + "toreSourceType\022;\n\013backup_info\030\002 \001(\0132$.go" + + "ogle.bigtable.admin.v2.BackupInfoH\000B\r\n\013s" + + "ource_info\"I\n\022ChangeStreamConfig\0223\n\020rete" + + "ntion_period\030\001 \001(\0132\031.google.protobuf.Dur" + + "ation\"\326\013\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\013granular" + + "ity\030\004 \001(\01624.google.bigtable.admin.v2.Tab" + + "le.TimestampGranularityB\003\340A\005\022@\n\014restore_" + + "info\030\006 \001(\0132%.google.bigtable.admin.v2.Re" + + "storeInfoB\003\340A\003\022J\n\024change_stream_config\030\010" + + " \001(\0132,.google.bigtable.admin.v2.ChangeSt" + + "reamConfig\022\033\n\023deletion_protection\030\t \001(\010\022" + + "X\n\027automated_backup_policy\030\r \001(\01325.googl" + + "e.bigtable.admin.v2.Table.AutomatedBacku" + + "pPolicyH\000\032\306\002\n\014ClusterState\022]\n\021replicatio" + + "n_state\030\001 \001(\0162=.google.bigtable.admin.v2" + + ".Table.ClusterState.ReplicationStateB\003\340A" + + "\003\022F\n\017encryption_info\030\002 \003(\0132(.google.bigt" + + "able.admin.v2.EncryptionInfoB\003\340A\003\"\216\001\n\020Re" + + "plicationState\022\023\n\017STATE_NOT_KNOWN\020\000\022\020\n\014I" + + "NITIALIZING\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\020" + + "READY_OPTIMIZING\020\005\032\204\001\n\025AutomatedBackupPo" + + "licy\0228\n\020retention_period\030\001 \001(\0132\031.google." + + "protobuf.DurationB\003\340A\002\0221\n\tfrequency\030\002 \001(" + + "\0132\031.google.protobuf.DurationB\003\340A\002\032b\n\022Clu" + + "sterStatesEntry\022\013\n\003key\030\001 \001(\t\022;\n\005value\030\002 " + + "\001(\0132,.google.bigtable.admin.v2.Table.Clu" + + "sterState:\0028\001\032]\n\023ColumnFamiliesEntry\022\013\n\003" + + "key\030\001 \001(\t\0225\n\005value\030\002 \001(\0132&.google.bigtab" + + "le.admin.v2.ColumnFamily:\0028\001\"I\n\024Timestam" + + "pGranularity\022%\n!TIMESTAMP_GRANULARITY_UN" + + "SPECIFIED\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_V" + + "IEW\020\002\022\024\n\020REPLICATION_VIEW\020\003\022\023\n\017ENCRYPTIO" + + "N_VIEW\020\005\022\010\n\004FULL\020\004:_\352A\\\n\"bigtableadmin.g" + + "oogleapis.com/Table\0226projects/{project}/" + + "instances/{instance}/tables/{table}B\031\n\027a" + + "utomated_backup_config\"\343\005\n\016AuthorizedVie" + + "w\022\021\n\004name\030\001 \001(\tB\003\340A\010\022J\n\013subset_view\030\002 \001(" + + "\01323.google.bigtable.admin.v2.AuthorizedV" + + "iew.SubsetViewH\000\022\014\n\004etag\030\003 \001(\t\022\033\n\023deleti" + + "on_protection\030\004 \001(\010\032?\n\rFamilySubsets\022\022\n\n" + + "qualifiers\030\001 \003(\014\022\032\n\022qualifier_prefixes\030\002" + + " \003(\014\032\360\001\n\nSubsetView\022\024\n\014row_prefixes\030\001 \003(" + + "\014\022^\n\016family_subsets\030\002 \003(\0132F.google.bigta" + + "ble.admin.v2.AuthorizedView.SubsetView.F" + + "amilySubsetsEntry\032l\n\022FamilySubsetsEntry\022" + + "\013\n\003key\030\001 \001(\t\022E\n\005value\030\002 \001(\01326.google.big" + + "table.admin.v2.AuthorizedView.FamilySubs" + + "ets:\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.googlea" + + "pis.com/AuthorizedView\022Xprojects/{projec" + + "t}/instances/{instance}/tables/{table}/a" + + "uthorizedViews/{authorized_view}*\017author" + + "izedViews2\016authorizedViewB\021\n\017authorized_" + + "view\"u\n\014ColumnFamily\0221\n\007gc_rule\030\001 \001(\0132 ." + + "google.bigtable.admin.v2.GcRule\0222\n\nvalue" + + "_type\030\003 \001(\0132\036.google.bigtable.admin.v2.T" + + "ype\"\325\002\n\006GcRule\022\032\n\020max_num_versions\030\001 \001(\005" + + "H\000\022,\n\007max_age\030\002 \001(\0132\031.google.protobuf.Du" + + "rationH\000\022E\n\014intersection\030\003 \001(\0132-.google." + + "bigtable.admin.v2.GcRule.IntersectionH\000\022" + + "7\n\005union\030\004 \001(\0132&.google.bigtable.admin.v" + + "2.GcRule.UnionH\000\032?\n\014Intersection\022/\n\005rule" + + "s\030\001 \003(\0132 .google.bigtable.admin.v2.GcRul" + + "e\0328\n\005Union\022/\n\005rules\030\001 \003(\0132 .google.bigta" + + "ble.admin.v2.GcRuleB\006\n\004rule\"\331\002\n\016Encrypti" + + "onInfo\022U\n\017encryption_type\030\003 \001(\01627.google" + + ".bigtable.admin.v2.EncryptionInfo.Encryp" + + "tionTypeB\003\340A\003\0222\n\021encryption_status\030\004 \001(\013" + + "2\022.google.rpc.StatusB\003\340A\003\022I\n\017kms_key_ver" + + "sion\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\031GOOGL" + + "E_DEFAULT_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAG" + + "ED_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.bigtab" + + "le.admin.v2.TableB\003\340A\003\022\034\n\017data_size_byte" + + "s\030\003 \001(\003B\003\340A\003\0224\n\013create_time\030\004 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\022/\n\013delete_tim" + + "e\030\005 \001(\0132\032.google.protobuf.Timestamp\022<\n\005s" + + "tate\030\006 \001(\0162(.google.bigtable.admin.v2.Sn" + + "apshot.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.google" + + "apis.com/Snapshot\022Oprojects/{project}/in" + + "stances/{instance}/clusters/{cluster}/sn" + + "apshots/{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\rsou" + + "rce_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\ns" + + "tart_time\030\004 \001(\0132\032.google.protobuf.Timest" + + "ampB\003\340A\003\0221\n\010end_time\030\005 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\022\027\n\nsize_bytes\030\006 \001(\003B" + + "\003\340A\003\022:\n\005state\030\007 \001(\0162&.google.bigtable.ad" + + "min.v2.Backup.StateB\003\340A\003\022F\n\017encryption_i" + + "nfo\030\t \001(\0132(.google.bigtable.admin.v2.Enc" + + "ryptionInfoB\003\340A\003\022@\n\013backup_type\030\013 \001(\0162+." + + "google.bigtable.admin.v2.Backup.BackupTy" + + "pe\0228\n\024hot_to_standard_time\030\014 \001(\0132\032.googl" + + "e.protobuf.Timestamp\"7\n\005State\022\025\n\021STATE_U" + + "NSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002\"@\n" + + "\nBackupType\022\033\n\027BACKUP_TYPE_UNSPECIFIED\020\000" + + "\022\014\n\010STANDARD\020\001\022\007\n\003HOT\020\002:u\352Ar\n#bigtablead" + + "min.googleapis.com/Backup\022Kprojects/{pro" + + "ject}/instances/{instance}/clusters/{clu" + + "ster}/backups/{backup}\"\300\001\n\nBackupInfo\022\023\n" + + "\006backup\030\001 \001(\tB\003\340A\003\0223\n\nstart_time\030\002 \001(\0132\032" + + ".google.protobuf.TimestampB\003\340A\003\0221\n\010end_t" + + "ime\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022\031\n\014source_table\030\004 \001(\tB\003\340A\003\022\032\n\rsource_" + + "backup\030\n \001(\tB\003\340A\003*D\n\021RestoreSourceType\022#" + + "\n\037RESTORE_SOURCE_TYPE_UNSPECIFIED\020\000\022\n\n\006B" + + "ACKUP\020\001B\367\002\n\034com.google.bigtable.admin.v2" + + "B\nTableProtoP\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::Bigt" + + "able::Admin::V2\352A\246\001\n(cloudkms.googleapis" + + ".com/CryptoKeyVersion\022zprojects/{project" + + "}/locations/{location}/keyRings/{key_rin" + + "g}/cryptoKeys/{crypto_key}/cryptoKeyVers" + + "ions/{crypto_key_version}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -193,6 +256,7 @@ 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(), @@ -205,13 +269,29 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "SourceType", "BackupInfo", "SourceInfo", }); - internal_static_google_bigtable_admin_v2_Table_descriptor = + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_ChangeStreamConfig_descriptor, + new java.lang.String[] { + "RetentionPeriod", + }); + internal_static_google_bigtable_admin_v2_Table_descriptor = + getDescriptor().getMessageTypes().get(2); internal_static_google_bigtable_admin_v2_Table_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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", + "AutomatedBackupConfig", }); internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor = internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedTypes().get(0); @@ -221,8 +301,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ReplicationState", "EncryptionInfo", }); - internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor = + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor = internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Table_AutomatedBackupPolicy_descriptor, + new java.lang.String[] { + "RetentionPeriod", "Frequency", + }); + internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor = + internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedTypes().get(2); internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor, @@ -230,23 +318,57 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "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.getNestedTypes().get(3); internal_static_google_bigtable_admin_v2_Table_ColumnFamiliesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(3); + internal_static_google_bigtable_admin_v2_AuthorizedView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_AuthorizedView_FamilySubsets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(0); + internal_static_google_bigtable_admin_v2_AuthorizedView_SubsetView_FamilySubsetsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(4); internal_static_google_bigtable_admin_v2_ColumnFamily_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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); + getDescriptor().getMessageTypes().get(5); internal_static_google_bigtable_admin_v2_GcRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_GcRule_descriptor, @@ -270,7 +392,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Rules", }); internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(6); internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor, @@ -278,7 +400,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EncryptionType", "EncryptionStatus", "KmsKeyVersion", }); internal_static_google_bigtable_admin_v2_Snapshot_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(7); internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Snapshot_descriptor, @@ -292,27 +414,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Description", }); internal_static_google_bigtable_admin_v2_Backup_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(8); internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(9); internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_BackupInfo_descriptor, new java.lang.String[] { - "Backup", "StartTime", "EndTime", "SourceTable", + "Backup", "StartTime", "EndTime", "SourceTable", "SourceBackup", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); @@ -324,6 +449,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { descriptor, registry); 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(); 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..d1916a406e --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Type.java @@ -0,0 +1,21625 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/types.proto + +// Protobuf Java Version: 3.25.5 +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/from the underlying data.
    + *
    + * Each encoding also defines the following properties:
    + *
    + *  * Order-preserving: Does the encoded value sort consistently with the
    + *    original typed value? Note that Bigtable will always sort data based on
    + *    the raw encoded value, *not* the decoded type.
    + *     - Example: BYTES values sort in the same order as their raw encodings.
    + *     - Counterexample: Encoding INT64 as a fixed-width decimal string does
    + *       *not* preserve sort order when dealing with negative numbers.
    + *       `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001)`.
    + *  * Self-delimiting: If we concatenate two encoded values, can we always tell
    + *    where the first one ends and the second one begins?
    + *     - Example: If we encode INT64s to fixed-width STRINGs, the first value
    + *       will always contain exactly N digits, possibly preceded by a sign.
    + *     - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have
    + *       no way to tell where the first one ends.
    + *  * Compatibility: Which other systems have matching encoding schemes? For
    + *    example, does this encoding have a GoogleSQL equivalent? HBase? Java?
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type} + */ +public final class Type extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type) + TypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Type.newBuilder() to construct. + private Type(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Type() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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/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/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/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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bytes) + BytesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Bytes.newBuilder() to construct. + private Bytes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Bytes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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/from lower level types.
    +     * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bytes.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Encoding() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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"
    +       * * Order-preserving? Yes
    +       * * Self-delimiting? No
    +       * * Compatibility? N/A
    +       * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Raw extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bytes.Encoding.Raw) + RawOrBuilder { + private static final long serialVersionUID = 0L; + // Use Raw.newBuilder() to construct. + private Raw(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Raw() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +         * Leaves the value "as-is"
    +         * * Order-preserving? Yes
    +         * * Self-delimiting? No
    +         * * Compatibility? N/A
    +         * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +       * Rules used to convert to/from lower level types.
    +       * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.Bytes.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getRawFieldBuilder().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.SingleFieldBuilderV3< + 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 getRawFieldBuilder().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.SingleFieldBuilderV3< + 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> + getRawFieldBuilder() { + if (rawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.admin.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + rawBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncodingFieldBuilder(); + } + } + + @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 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.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(getEncodingFieldBuilder().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.SingleFieldBuilderV3< + 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/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/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/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/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/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/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/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 getEncodingFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * The encoding to use when converting to/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/from lower level types.
    +       * 
    + * + * .google.bigtable.admin.v2.Type.Bytes.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + 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> + getEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String) + StringOrBuilder { + private static final long serialVersionUID = 0L; + // Use String.newBuilder() to construct. + private String(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private String() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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=97 + * @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=97 + * @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/from lower level types.
    +     * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Encoding() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw) + Utf8RawOrBuilder { + private static final long serialVersionUID = 0L; + // Use Utf8Raw.newBuilder() to construct. + private Utf8Raw(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Utf8Raw() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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
    +       * * Order-preserving? Yes (code point order)
    +       * * Self-delimiting? No
    +       * * Compatibility?
    +       *    - BigQuery Federation `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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes) + Utf8BytesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Utf8Bytes.newBuilder() to construct. + private Utf8Bytes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Utf8Bytes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +         * UTF-8 encoding
    +         * * Order-preserving? Yes (code point order)
    +         * * Self-delimiting? No
    +         * * Compatibility?
    +         *    - BigQuery Federation `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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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=97 + * @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=97 + * @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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +       * Rules used to convert to/from lower level types.
    +       * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.String.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getUtf8RawFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getUtf8BytesFieldBuilder().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.SingleFieldBuilderV3< + 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=97 + * @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=97 + * @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 getUtf8RawFieldBuilder().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.SingleFieldBuilderV3< + 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> + getUtf8RawFieldBuilder() { + if (utf8RawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + utf8RawBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getUtf8BytesFieldBuilder().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.SingleFieldBuilderV3< + 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> + getUtf8BytesFieldBuilder() { + if (utf8BytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.admin.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + utf8BytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncodingFieldBuilder(); + } + } + + @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 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.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(getEncodingFieldBuilder().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.SingleFieldBuilderV3< + 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/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/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/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/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/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/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/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 getEncodingFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * The encoding to use when converting to/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/from lower level types.
    +       * 
    + * + * .google.bigtable.admin.v2.Type.String.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + 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> + getEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64) + Int64OrBuilder { + private static final long serialVersionUID = 0L; + // Use Int64.newBuilder() to construct. + private Int64(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Int64() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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(); + + com.google.bigtable.admin.v2.Type.Int64.Encoding.EncodingCase getEncodingCase(); + } + /** + * + * + *
    +     * Rules used to convert to/from lower level types.
    +     * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Encoding() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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; + * + * @return Whether the bytesType field is set. + */ + boolean hasBytesType(); + /** + * + * + *
    +         * Deprecated: ignored if set.
    +         * 
    + * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + com.google.bigtable.admin.v2.Type.Bytes getBytesType(); + /** + * + * + *
    +         * Deprecated: ignored if set.
    +         * 
    + * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + com.google.bigtable.admin.v2.Type.BytesOrBuilder getBytesTypeOrBuilder(); + } + /** + * + * + *
    +       * Encodes the value as an 8-byte big endian twos complement `Bytes`
    +       * value.
    +       * * Order-preserving? No (positive values only)
    +       * * Self-delimiting? Yes
    +       * * Compatibility?
    +       *    - BigQuery Federation `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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes) + BigEndianBytesOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigEndianBytes.newBuilder() to construct. + private BigEndianBytes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigEndianBytes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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; + * + * @return Whether the bytesType field is set. + */ + @java.lang.Override + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
    +         * Deprecated: ignored if set.
    +         * 
    + * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + @java.lang.Override + 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; + */ + @java.lang.Override + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +         * Encodes the value as an 8-byte big endian twos complement `Bytes`
    +         * value.
    +         * * Order-preserving? No (positive values only)
    +         * * Self-delimiting? Yes
    +         * * Compatibility?
    +         *    - BigQuery Federation `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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBytesTypeFieldBuilder(); + } + } + + @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 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.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(getBytesTypeFieldBuilder().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.SingleFieldBuilderV3< + 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; + * + * @return Whether the bytesType field is set. + */ + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
    +           * Deprecated: ignored if set.
    +           * 
    + * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + 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; + */ + 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; + */ + 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; + */ + 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; + */ + 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; + */ + public com.google.bigtable.admin.v2.Type.Bytes.Builder getBytesTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getBytesTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
    +           * Deprecated: ignored if set.
    +           * 
    + * + * .google.bigtable.admin.v2.Type.Bytes bytes_type = 1; + */ + 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; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder> + getBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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; + } + } + + 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), + 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 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(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @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 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 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +       * Rules used to convert to/from lower level types.
    +       * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type.Int64.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bigEndianBytesBuilder_ != null) { + bigEndianBytesBuilder_.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(); + } + } + + @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.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 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( + getBigEndianBytesFieldBuilder().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.SingleFieldBuilderV3< + 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 getBigEndianBytesFieldBuilder().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.SingleFieldBuilderV3< + 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> + getBigEndianBytesFieldBuilder() { + if (bigEndianBytesBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.admin.v2.Type.Int64.Encoding.BigEndianBytes + .getDefaultInstance(); + } + bigEndianBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncodingFieldBuilder(); + } + } + + @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 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.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(getEncodingFieldBuilder().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.SingleFieldBuilderV3< + 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/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/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/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/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/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/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/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 getEncodingFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * The encoding to use when converting to/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/from lower level types.
    +       * 
    + * + * .google.bigtable.admin.v2.Type.Int64.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + 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> + getEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Bool) + BoolOrBuilder { + private static final long serialVersionUID = 0L; + // Use Bool.newBuilder() to construct. + private Bool(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Bool() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Float32) + Float32OrBuilder { + private static final long serialVersionUID = 0L; + // Use Float32.newBuilder() to construct. + private Float32(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Float32() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Float64) + Float64OrBuilder { + private static final long serialVersionUID = 0L; + // Use Float64.newBuilder() to construct. + private Float64(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Float64() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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 {} + /** + * + * + *
    +   * 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Timestamp) + TimestampOrBuilder { + private static final long serialVersionUID = 0L; + // Use Timestamp.newBuilder() to construct. + private Timestamp(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Timestamp() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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.Timestamp)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Type.Timestamp other = + (com.google.bigtable.admin.v2.Type.Timestamp) 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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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_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); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.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; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Date) + DateOrBuilder { + private static final long serialVersionUID = 0L; + // Use Date.newBuilder() to construct. + private Date(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Date() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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); + } + /** + * + * + *
    +   * 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct) + StructOrBuilder { + private static final long serialVersionUID = 0L; + // Use Struct.newBuilder() to construct. + private Struct(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Struct() { + fields_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Struct(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Struct.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Field() { + fieldName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Field(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(fieldName_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(fieldName_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @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 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.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(getTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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 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); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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)); + } + 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)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @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 (!getUnknownFields().equals(other.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(); + } + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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); + 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_; + } + + @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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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.RepeatedFieldBuilderV3< + 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 getFieldsFieldBuilder().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 getFieldsFieldBuilder() + .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 getFieldsFieldBuilder() + .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 getFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + 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> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Array) + ArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use Array.newBuilder() to construct. + private Array(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Array() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getElementTypeFieldBuilder(); + } + } + + @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 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.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(getElementTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getElementTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getElementTypeFieldBuilder() { + if (elementTypeBuilder_ == null) { + elementTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Map) + MapOrBuilder { + private static final long serialVersionUID = 0L; + // Use Map.newBuilder() to construct. + private Map(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Map() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getKeyTypeFieldBuilder(); + getValueTypeFieldBuilder(); + } + } + + @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 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.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(getKeyTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getValueTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getKeyTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getKeyTypeFieldBuilder() { + if (keyTypeBuilder_ == null) { + keyTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getValueTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getValueTypeFieldBuilder() { + if (valueTypeBuilder_ == null) { + valueTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate) + AggregateOrBuilder { + private static final long serialVersionUID = 0L; + // Use Aggregate.newBuilder() to construct. + private Aggregate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Aggregate() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.Sum) + SumOrBuilder { + private static final long serialVersionUID = 0L; + // Use Sum.newBuilder() to construct. + private Sum(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sum() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.Max) + MaxOrBuilder { + private static final long serialVersionUID = 0L; + // Use Max.newBuilder() to construct. + private Max(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Max() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.Min) + MinOrBuilder { + private static final long serialVersionUID = 0L; + // Use Min.newBuilder() to construct. + private Min(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Min() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + HyperLogLogPlusPlusUniqueCountOrBuilder { + private static final long serialVersionUID = 0L; + // Use HyperLogLogPlusPlusUniqueCount.newBuilder() to construct. + private HyperLogLogPlusPlusUniqueCount( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HyperLogLogPlusPlusUniqueCount() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInputTypeFieldBuilder(); + getStateTypeFieldBuilder(); + } + } + + @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 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.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(getInputTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getStateTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getSumFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getHllppUniqueCountFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getMaxFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getMinFieldBuilder().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.SingleFieldBuilderV3< + 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 getInputTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getInputTypeFieldBuilder() { + if (inputTypeBuilder_ == null) { + inputTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getStateTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type, + com.google.bigtable.admin.v2.Type.Builder, + com.google.bigtable.admin.v2.TypeOrBuilder> + getStateTypeFieldBuilder() { + if (stateTypeBuilder_ == null) { + stateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getSumFieldBuilder().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.SingleFieldBuilderV3< + 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> + getSumFieldBuilder() { + if (sumBuilder_ == null) { + if (!(aggregatorCase_ == 4)) { + aggregator_ = com.google.bigtable.admin.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + sumBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getHllppUniqueCountFieldBuilder().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.SingleFieldBuilderV3< + 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> + getHllppUniqueCountFieldBuilder() { + if (hllppUniqueCountBuilder_ == null) { + if (!(aggregatorCase_ == 5)) { + aggregator_ = + com.google.bigtable.admin.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + hllppUniqueCountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMaxFieldBuilder().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.SingleFieldBuilderV3< + 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> + getMaxFieldBuilder() { + if (maxBuilder_ == null) { + if (!(aggregatorCase_ == 6)) { + aggregator_ = com.google.bigtable.admin.v2.Type.Aggregate.Max.getDefaultInstance(); + } + maxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMinFieldBuilder().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.SingleFieldBuilderV3< + 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> + getMinFieldBuilder() { + if (minBuilder_ == null) { + if (!(aggregatorCase_ == 7)) { + aggregator_ = com.google.bigtable.admin.v2.Type.Aggregate.Min.getDefaultInstance(); + } + minBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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), + 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 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(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @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 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 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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/from the underlying data.
    +   *
    +   * Each encoding also defines the following properties:
    +   *
    +   *  * Order-preserving: Does the encoded value sort consistently with the
    +   *    original typed value? Note that Bigtable will always sort data based on
    +   *    the raw encoded value, *not* the decoded type.
    +   *     - Example: BYTES values sort in the same order as their raw encodings.
    +   *     - Counterexample: Encoding INT64 as a fixed-width decimal string does
    +   *       *not* preserve sort order when dealing with negative numbers.
    +   *       `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001)`.
    +   *  * Self-delimiting: If we concatenate two encoded values, can we always tell
    +   *    where the first one ends and the second one begins?
    +   *     - Example: If we encode INT64s to fixed-width STRINGs, the first value
    +   *       will always contain exactly N digits, possibly preceded by a sign.
    +   *     - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have
    +   *       no way to tell where the first one ends.
    +   *  * Compatibility: Which other systems have matching encoding schemes? For
    +   *    example, does this encoding have a GoogleSQL equivalent? HBase? Java?
    +   * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.Type} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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(); + } + 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(); + } + } + + @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.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 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(getBytesTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getStringTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getArrayTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getMapTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getInt64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getAggregateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getStructTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getBoolTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getFloat64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage(getTimestampTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage(getDateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 11; + break; + } // case 90 + case 98: + { + input.readMessage(getFloat32TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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.SingleFieldBuilderV3< + 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 getBytesTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Bytes, + com.google.bigtable.admin.v2.Type.Bytes.Builder, + com.google.bigtable.admin.v2.Type.BytesOrBuilder> + getBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = com.google.bigtable.admin.v2.Type.Bytes.getDefaultInstance(); + } + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getStringTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.String, + com.google.bigtable.admin.v2.Type.String.Builder, + com.google.bigtable.admin.v2.Type.StringOrBuilder> + getStringTypeFieldBuilder() { + if (stringTypeBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = com.google.bigtable.admin.v2.Type.String.getDefaultInstance(); + } + stringTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getInt64TypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Int64, + com.google.bigtable.admin.v2.Type.Int64.Builder, + com.google.bigtable.admin.v2.Type.Int64OrBuilder> + getInt64TypeFieldBuilder() { + if (int64TypeBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = com.google.bigtable.admin.v2.Type.Int64.getDefaultInstance(); + } + int64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getFloat32TypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Float32, + com.google.bigtable.admin.v2.Type.Float32.Builder, + com.google.bigtable.admin.v2.Type.Float32OrBuilder> + getFloat32TypeFieldBuilder() { + if (float32TypeBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = com.google.bigtable.admin.v2.Type.Float32.getDefaultInstance(); + } + float32TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getFloat64TypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Float64, + com.google.bigtable.admin.v2.Type.Float64.Builder, + com.google.bigtable.admin.v2.Type.Float64OrBuilder> + getFloat64TypeFieldBuilder() { + if (float64TypeBuilder_ == null) { + if (!(kindCase_ == 9)) { + kind_ = com.google.bigtable.admin.v2.Type.Float64.getDefaultInstance(); + } + float64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getBoolTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Bool, + com.google.bigtable.admin.v2.Type.Bool.Builder, + com.google.bigtable.admin.v2.Type.BoolOrBuilder> + getBoolTypeFieldBuilder() { + if (boolTypeBuilder_ == null) { + if (!(kindCase_ == 8)) { + kind_ = com.google.bigtable.admin.v2.Type.Bool.getDefaultInstance(); + } + boolTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getTimestampTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Timestamp, + com.google.bigtable.admin.v2.Type.Timestamp.Builder, + com.google.bigtable.admin.v2.Type.TimestampOrBuilder> + getTimestampTypeFieldBuilder() { + if (timestampTypeBuilder_ == null) { + if (!(kindCase_ == 10)) { + kind_ = com.google.bigtable.admin.v2.Type.Timestamp.getDefaultInstance(); + } + timestampTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getDateTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Date, + com.google.bigtable.admin.v2.Type.Date.Builder, + com.google.bigtable.admin.v2.Type.DateOrBuilder> + getDateTypeFieldBuilder() { + if (dateTypeBuilder_ == null) { + if (!(kindCase_ == 11)) { + kind_ = com.google.bigtable.admin.v2.Type.Date.getDefaultInstance(); + } + dateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getAggregateTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Aggregate, + com.google.bigtable.admin.v2.Type.Aggregate.Builder, + com.google.bigtable.admin.v2.Type.AggregateOrBuilder> + getAggregateTypeFieldBuilder() { + if (aggregateTypeBuilder_ == null) { + if (!(kindCase_ == 6)) { + kind_ = com.google.bigtable.admin.v2.Type.Aggregate.getDefaultInstance(); + } + aggregateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getStructTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Struct, + com.google.bigtable.admin.v2.Type.Struct.Builder, + com.google.bigtable.admin.v2.Type.StructOrBuilder> + getStructTypeFieldBuilder() { + if (structTypeBuilder_ == null) { + if (!(kindCase_ == 7)) { + kind_ = com.google.bigtable.admin.v2.Type.Struct.getDefaultInstance(); + } + structTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getArrayTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Array, + com.google.bigtable.admin.v2.Type.Array.Builder, + com.google.bigtable.admin.v2.Type.ArrayOrBuilder> + getArrayTypeFieldBuilder() { + if (arrayTypeBuilder_ == null) { + if (!(kindCase_ == 3)) { + kind_ = com.google.bigtable.admin.v2.Type.Array.getDefaultInstance(); + } + arrayTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMapTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Type.Map, + com.google.bigtable.admin.v2.Type.Map.Builder, + com.google.bigtable.admin.v2.Type.MapOrBuilder> + getMapTypeFieldBuilder() { + if (mapTypeBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.bigtable.admin.v2.Type.Map.getDefaultInstance(); + } + mapTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..779fdc68ea --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypeOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/types.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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(); + + 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..0b24ae83f6 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TypesProto.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/types.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +public final class TypesProto { + private 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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_Bool_descriptor; + static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Type_Timestamp_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Type_Date_descriptor; + static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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_Array_descriptor; + static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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\"\232\022\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\032\251\001\n\005Bytes\022?\n\010encoding\030\001 \001(\0132-.goo" + + "gle.bigtable.admin.v2.Type.Bytes.Encodin" + + "g\032_\n\010Encoding\022@\n\003raw\030\001 \001(\01321.google.bigt" + + "able.admin.v2.Type.Bytes.Encoding.RawH\000\032" + + "\005\n\003RawB\n\n\010encoding\032\237\002\n\006String\022@\n\010encodin" + + "g\030\001 \001(\0132..google.bigtable.admin.v2.Type." + + "String.Encoding\032\322\001\n\010Encoding\022N\n\010utf8_raw" + + "\030\001 \001(\01326.google.bigtable.admin.v2.Type.S" + + "tring.Encoding.Utf8RawB\002\030\001H\000\022N\n\nutf8_byt" + + "es\030\002 \001(\01328.google.bigtable.admin.v2.Type" + + ".String.Encoding.Utf8BytesH\000\032\r\n\007Utf8Raw:" + + "\002\030\001\032\013\n\tUtf8BytesB\n\n\010encoding\032\207\002\n\005Int64\022?" + + "\n\010encoding\030\001 \001(\0132-.google.bigtable.admin" + + ".v2.Type.Int64.Encoding\032\274\001\n\010Encoding\022X\n\020" + + "big_endian_bytes\030\001 \001(\0132<.google.bigtable" + + ".admin.v2.Type.Int64.Encoding.BigEndianB" + + "ytesH\000\032J\n\016BigEndianBytes\0228\n\nbytes_type\030\001" + + " \001(\0132$.google.bigtable.admin.v2.Type.Byt" + + "esB\n\n\010encoding\032\006\n\004Bool\032\t\n\007Float32\032\t\n\007Flo" + + "at64\032\013\n\tTimestamp\032\006\n\004Date\032\220\001\n\006Struct\022;\n\006" + + "fields\030\001 \003(\0132+.google.bigtable.admin.v2." + + "Type.Struct.Field\032I\n\005Field\022\022\n\nfield_name" + + "\030\001 \001(\t\022,\n\004type\030\002 \001(\0132\036.google.bigtable.a" + + "dmin.v2.Type\032=\n\005Array\0224\n\014element_type\030\001 " + + "\001(\0132\036.google.bigtable.admin.v2.Type\032k\n\003M" + + "ap\0220\n\010key_type\030\001 \001(\0132\036.google.bigtable.a" + + "dmin.v2.Type\0222\n\nvalue_type\030\002 \001(\0132\036.googl" + + "e.bigtable.admin.v2.Type\032\333\003\n\tAggregate\0222" + + "\n\ninput_type\030\001 \001(\0132\036.google.bigtable.adm" + + "in.v2.Type\0227\n\nstate_type\030\002 \001(\0132\036.google." + + "bigtable.admin.v2.TypeB\003\340A\003\022;\n\003sum\030\004 \001(\013" + + "2,.google.bigtable.admin.v2.Type.Aggrega" + + "te.SumH\000\022e\n\022hllpp_unique_count\030\005 \001(\0132G.g" + + "oogle.bigtable.admin.v2.Type.Aggregate.H" + + "yperLogLogPlusPlusUniqueCountH\000\022;\n\003max\030\006" + + " \001(\0132,.google.bigtable.admin.v2.Type.Agg" + + "regate.MaxH\000\022;\n\003min\030\007 \001(\0132,.google.bigta" + + "ble.admin.v2.Type.Aggregate.MinH\000\032\005\n\003Sum" + + "\032\005\n\003Max\032\005\n\003Min\032 \n\036HyperLogLogPlusPlusUni" + + "queCountB\014\n\naggregatorB\006\n\004kindB\315\001\n\034com.g" + + "oogle.bigtable.admin.v2B\nTypesProtoP\001Z8c" + + "loud.google.com/go/bigtable/admin/apiv2/" + + "adminpb;adminpb\252\002\036Google.Cloud.Bigtable." + + "Admin.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V" + + "2\352\002\"Google::Cloud::Bigtable::Admin::V2b\006" + + "proto3" + }; + 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().getMessageTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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", + "Kind", + }); + internal_static_google_bigtable_admin_v2_Type_Bytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(0); + internal_static_google_bigtable_admin_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_Type_String_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(0); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(1); + internal_static_google_bigtable_admin_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_admin_v2_Type_Int64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor, + new java.lang.String[] { + "BigEndianBytes", "Encoding", + }); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor = + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_descriptor + .getNestedTypes() + .get(0); + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Int64_Encoding_BigEndianBytes_descriptor, + new java.lang.String[] { + "BytesType", + }); + internal_static_google_bigtable_admin_v2_Type_Bool_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedTypes().get(3); + internal_static_google_bigtable_admin_v2_Type_Bool_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(4); + internal_static_google_bigtable_admin_v2_Type_Float32_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(5); + internal_static_google_bigtable_admin_v2_Type_Float64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(6); + internal_static_google_bigtable_admin_v2_Type_Timestamp_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Timestamp_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_admin_v2_Type_Date_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedTypes().get(7); + internal_static_google_bigtable_admin_v2_Type_Date_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(8); + internal_static_google_bigtable_admin_v2_Type_Struct_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor, + new java.lang.String[] { + "Fields", + }); + internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor = + internal_static_google_bigtable_admin_v2_Type_Struct_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_Struct_Field_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Struct_Field_descriptor, + new java.lang.String[] { + "FieldName", "Type", + }); + internal_static_google_bigtable_admin_v2_Type_Array_descriptor = + internal_static_google_bigtable_admin_v2_Type_descriptor.getNestedTypes().get(9); + internal_static_google_bigtable_admin_v2_Type_Array_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(10); + internal_static_google_bigtable_admin_v2_Type_Map_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(11); + internal_static_google_bigtable_admin_v2_Type_Aggregate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Sum_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Max_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_admin_v2_Type_Aggregate_Min_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(3); + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor, + new java.lang.String[] {}); + 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); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@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..9ff990beea --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadata.java @@ -0,0 +1,1158 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class UndeleteTableMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UndeleteTableMetadata) + UndeleteTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteTableMetadata.newBuilder() to construct. + private UndeleteTableMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteTableMetadata() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteTableMetadata(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @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 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.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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 getStartTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + 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.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..77188d4d72 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableMetadataOrBuilder.java @@ -0,0 +1,121 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..c255cb17b5 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequest.java @@ -0,0 +1,655 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class UndeleteTableRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UndeleteTableRequest) + UndeleteTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UndeleteTableRequest.newBuilder() to construct. + private UndeleteTableRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteTableRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteTableRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..fc2fc67ebe --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UndeleteTableRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..8a4fb536b9 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,48 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UpdateAppProfileMetadata(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateAppProfileMetadata_descriptor; @@ -116,7 +75,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 +84,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -141,7 +100,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 +111,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; } @@ -282,17 +241,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) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -375,7 +327,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,18 +342,31 @@ 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; } @@ -437,7 +402,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..5db086ec92 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface UpdateAppProfileMetadataOrBuilder 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..52ef5fa8fb 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,84 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UpdateAppProfileRequest(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor; @@ -138,6 +61,7 @@ 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,7 +79,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasAppProfile() { - return appProfile_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -189,7 +113,9 @@ 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; @@ -209,7 +135,7 @@ public com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfileOrBuilder() */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -241,11 +167,11 @@ 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 +202,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 +220,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 +254,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 +275,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; } @@ -488,26 +414,27 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAppProfileFieldBuilder(); + getUpdateMaskFieldBuilder(); + } } @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,21 +462,30 @@ 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 (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); + if (bitField0_ != 0) { + buildPartial0(result); } - result.ignoreWarnings_ = ignoreWarnings_; onBuilt(); return result; } + private void buildPartial0(com.google.bigtable.admin.v2.UpdateAppProfileRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.appProfile_ = appProfileBuilder_ == null ? appProfile_ : appProfileBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ignoreWarnings_ = ignoreWarnings_; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -605,7 +541,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,21 +556,54 @@ 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(getAppProfileFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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< com.google.bigtable.admin.v2.AppProfile, @@ -655,7 +624,7 @@ public Builder mergeFrom( * @return Whether the appProfile field is set. */ public boolean hasAppProfile() { - return appProfileBuilder_ != null || appProfile_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -696,11 +665,11 @@ 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,11 +686,11 @@ 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,19 +706,20 @@ 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,14 +734,13 @@ 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,7 +755,7 @@ public Builder clearAppProfile() { *
    */ public com.google.bigtable.admin.v2.AppProfile.Builder getAppProfileBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getAppProfileFieldBuilder().getBuilder(); } @@ -858,7 +827,7 @@ 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); } /** * @@ -899,11 +868,11 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -920,11 +889,11 @@ 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,17 +909,20 @@ 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,14 +937,13 @@ 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,7 +958,7 @@ public Builder clearUpdateMask() { * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getUpdateMaskFieldBuilder().getBuilder(); } @@ -1070,6 +1041,7 @@ public boolean getIgnoreWarnings() { public Builder setIgnoreWarnings(boolean value) { ignoreWarnings_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1085,7 +1057,7 @@ public Builder setIgnoreWarnings(boolean value) { * @return This builder for chaining. */ public Builder clearIgnoreWarnings() { - + bitField0_ = (bitField0_ & ~0x00000004); ignoreWarnings_ = false; onChanged(); return this; @@ -1123,7 +1095,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..50fb03e76d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface UpdateAppProfileRequestOrBuilder 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..d4fa163462 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadata.java @@ -0,0 +1,1273 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class UpdateAuthorizedViewMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateAuthorizedViewMetadata) + UpdateAuthorizedViewMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAuthorizedViewMetadata.newBuilder() to construct. + private UpdateAuthorizedViewMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAuthorizedViewMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOriginalRequestFieldBuilder(); + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + } + } + + @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 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.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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getFinishTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 getOriginalRequestFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequest.Builder, + com.google.bigtable.admin.v2.UpdateAuthorizedViewRequestOrBuilder> + getOriginalRequestFieldBuilder() { + if (originalRequestBuilder_ == null) { + originalRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getRequestTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRequestTimeFieldBuilder() { + if (requestTimeBuilder_ == null) { + requestTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getFinishTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getFinishTimeFieldBuilder() { + if (finishTimeBuilder_ == null) { + finishTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getFinishTime(), getParentForChildren(), isClean()); + finishTime_ = null; + } + 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.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..405f45985f --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewMetadataOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..6779309332 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequest.java @@ -0,0 +1,1232 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * The request for
    + * [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.UpdateAuthorizedViewRequest} + */ +public final class UpdateAuthorizedViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateAuthorizedViewRequest) + UpdateAuthorizedViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateAuthorizedViewRequest.newBuilder() to construct. + private UpdateAuthorizedViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateAuthorizedViewRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAuthorizedViewFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @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 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.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(getAuthorizedViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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.SingleFieldBuilderV3< + 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 getAuthorizedViewFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.AuthorizedView, + com.google.bigtable.admin.v2.AuthorizedView.Builder, + com.google.bigtable.admin.v2.AuthorizedViewOrBuilder> + getAuthorizedViewFieldBuilder() { + if (authorizedViewBuilder_ == null) { + authorizedViewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getUpdateMaskFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; + } + + @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.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..3fb26920b5 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateAuthorizedViewRequestOrBuilder.java @@ -0,0 +1,146 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..1693e62c5f 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 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. @@ -16,13 +16,15 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** * * *
    - * 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} @@ -45,79 +47,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UpdateBackupRequest(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableTableAdminProto .internal_static_google_bigtable_admin_v2_UpdateBackupRequest_descriptor; @@ -133,6 +62,7 @@ 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,6 +72,7 @@ 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`. * * @@ -152,7 +83,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasBackup() { - return backup_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -161,6 +92,7 @@ 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`. * * @@ -180,6 +112,7 @@ 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`. * * @@ -188,7 +121,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_; } public static final int UPDATE_MASK_FIELD_NUMBER = 2; @@ -211,7 +144,7 @@ public com.google.bigtable.admin.v2.BackupOrBuilder getBackupOrBuilder() { */ @java.lang.Override public boolean hasUpdateMask() { - return updateMask_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -249,7 +182,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 +199,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 +214,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 +244,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 +263,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; } @@ -434,7 +367,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
    -   * 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} @@ -469,22 +403,24 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBackupFieldBuilder(); + getUpdateMaskFieldBuilder(); + } } @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,20 +450,27 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.UpdateBackupRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.backup_ = backupBuilder_ == null ? backup_ : backupBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -580,7 +523,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,20 +538,48 @@ 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(getBackupFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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< com.google.bigtable.admin.v2.Backup, @@ -622,6 +593,7 @@ 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`. * * @@ -631,7 +603,7 @@ public Builder mergeFrom( * @return Whether the backup field is set. */ public boolean hasBackup() { - return backupBuilder_ != null || backup_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -640,6 +612,7 @@ 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`. * * @@ -662,6 +635,7 @@ 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`. * * @@ -674,11 +648,11 @@ 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,6 +662,7 @@ 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`. * * @@ -697,11 +672,11 @@ 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,6 +686,7 @@ 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`. * * @@ -719,19 +695,20 @@ 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,6 +718,7 @@ 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`. * * @@ -748,14 +726,13 @@ public Builder mergeBackup(com.google.bigtable.admin.v2.Backup value) { * */ 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,6 +742,7 @@ 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`. * * @@ -772,7 +750,7 @@ public Builder clearBackup() { * */ public com.google.bigtable.admin.v2.Backup.Builder getBackupBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getBackupFieldBuilder().getBuilder(); } @@ -783,6 +761,7 @@ 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`. * * @@ -803,6 +782,7 @@ 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`. * * @@ -849,7 +829,7 @@ 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); } /** * @@ -896,11 +876,11 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { throw new NullPointerException(); } updateMask_ = value; - onChanged(); } else { updateMaskBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -920,11 +900,11 @@ 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,17 +923,20 @@ 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,14 +954,13 @@ 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,7 +978,7 @@ public Builder clearUpdateMask() { * */ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getUpdateMaskFieldBuilder().getBuilder(); } @@ -1086,7 +1068,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..5da0a0e979 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_table_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface UpdateBackupRequestOrBuilder @@ -30,6 +31,7 @@ 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`. * * @@ -46,6 +48,7 @@ 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`. * * @@ -62,6 +65,7 @@ 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`. * * 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..c92a79f08d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,94 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UpdateClusterMetadata(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateClusterMetadata_descriptor; @@ -148,6 +61,7 @@ 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,7 +77,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -193,7 +107,9 @@ 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; @@ -211,7 +127,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getOriginalRequestOrBuilder */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -239,7 +155,7 @@ 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; @@ -257,7 +173,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -285,7 +201,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 +218,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 +236,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 +273,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 +296,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; } @@ -519,28 +435,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOriginalRequestFieldBuilder(); + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + } } @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,25 +488,33 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.UpdateClusterMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -644,7 +570,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,21 +585,54 @@ 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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getFinishTimeFieldBuilder().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< com.google.bigtable.admin.v2.Cluster, @@ -692,7 +651,7 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -729,11 +688,11 @@ 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,11 +708,11 @@ 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,19 +726,20 @@ 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,14 +752,13 @@ 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,7 +771,7 @@ 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(); } @@ -878,7 +837,7 @@ 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); } /** * @@ -915,11 +874,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -934,11 +893,11 @@ 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,19 +911,20 @@ 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,14 +937,13 @@ 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,7 +956,7 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getRequestTimeFieldBuilder().getBuilder(); } @@ -1063,7 +1022,7 @@ 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); } /** * @@ -1100,11 +1059,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1119,11 +1078,11 @@ 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,17 +1096,20 @@ 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,14 +1122,13 @@ 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,7 +1141,7 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getFinishTimeFieldBuilder().getBuilder(); } @@ -1260,7 +1221,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..5675229c61 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface UpdateClusterMetadataOrBuilder 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..aeaa25103a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; /** @@ -45,95 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UpdateInstanceMetadata(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.admin.v2.BigtableInstanceAdminProto .internal_static_google_bigtable_admin_v2_UpdateInstanceMetadata_descriptor; @@ -149,6 +61,7 @@ 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,7 +77,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasOriginalRequest() { - return originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -195,7 +108,9 @@ 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; @@ -213,7 +128,7 @@ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest getOriginalRequ */ @java.lang.Override public boolean hasRequestTime() { - return requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -241,7 +156,7 @@ 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; @@ -259,7 +174,7 @@ public com.google.protobuf.TimestampOrBuilder getRequestTimeOrBuilder() { */ @java.lang.Override public boolean hasFinishTime() { - return finishTime_ != null; + return ((bitField0_ & 0x00000004) != 0); } /** * @@ -287,7 +202,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 +219,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 +237,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 +274,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 +297,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; } @@ -521,28 +436,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOriginalRequestFieldBuilder(); + getRequestTimeFieldBuilder(); + getFinishTimeFieldBuilder(); + } } @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,25 +489,33 @@ 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; } + private void buildPartial0(com.google.bigtable.admin.v2.UpdateInstanceMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.originalRequest_ = + originalRequestBuilder_ == null ? originalRequest_ : originalRequestBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.requestTime_ = + requestTimeBuilder_ == null ? requestTime_ : requestTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.finishTime_ = finishTimeBuilder_ == null ? finishTime_ : finishTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -646,7 +571,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,21 +586,54 @@ 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(getOriginalRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getRequestTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getFinishTimeFieldBuilder().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< com.google.bigtable.admin.v2.PartialUpdateInstanceRequest, @@ -694,7 +652,7 @@ public Builder mergeFrom( * @return Whether the originalRequest field is set. */ public boolean hasOriginalRequest() { - return originalRequestBuilder_ != null || originalRequest_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -732,11 +690,11 @@ public Builder setOriginalRequest( throw new NullPointerException(); } originalRequest_ = value; - onChanged(); } else { originalRequestBuilder_.setMessage(value); } - + bitField0_ |= 0x00000001; + onChanged(); return this; } /** @@ -752,11 +710,11 @@ 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,19 +729,21 @@ 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,14 +756,13 @@ 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,7 +776,7 @@ public Builder clearOriginalRequest() { */ public com.google.bigtable.admin.v2.PartialUpdateInstanceRequest.Builder getOriginalRequestBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getOriginalRequestFieldBuilder().getBuilder(); } @@ -884,7 +843,7 @@ public Builder clearOriginalRequest() { * @return Whether the requestTime field is set. */ public boolean hasRequestTime() { - return requestTimeBuilder_ != null || requestTime_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -921,11 +880,11 @@ public Builder setRequestTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } requestTime_ = value; - onChanged(); } else { requestTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -940,11 +899,11 @@ 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,19 +917,20 @@ 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,14 +943,13 @@ 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,7 +962,7 @@ public Builder clearRequestTime() { * .google.protobuf.Timestamp request_time = 2; */ public com.google.protobuf.Timestamp.Builder getRequestTimeBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getRequestTimeFieldBuilder().getBuilder(); } @@ -1069,7 +1028,7 @@ 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); } /** * @@ -1106,11 +1065,11 @@ public Builder setFinishTime(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } finishTime_ = value; - onChanged(); } else { finishTimeBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1125,11 +1084,11 @@ 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,17 +1102,20 @@ 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,14 +1128,13 @@ 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,7 +1147,7 @@ public Builder clearFinishTime() { * .google.protobuf.Timestamp finish_time = 3; */ public com.google.protobuf.Timestamp.Builder getFinishTimeBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getFinishTimeFieldBuilder().getBuilder(); } @@ -1266,7 +1227,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..7a9d4e9e73 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/admin/v2/bigtable_instance_admin.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.admin.v2; public interface UpdateInstanceMetadataOrBuilder 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..07332a928e --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadata.java @@ -0,0 +1,1158 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class UpdateTableMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateTableMetadata) + UpdateTableMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTableMetadata.newBuilder() to construct. + private UpdateTableMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTableMetadata() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateTableMetadata(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @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 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.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(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + 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 getStartTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + 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.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..42b7a58392 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableMetadataOrBuilder.java @@ -0,0 +1,121 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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..5bc5e4ad16 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequest.java @@ -0,0 +1,1147 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +/** + * + * + *
    + * The request for
    + * [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
    + * 
    + * + * Protobuf type {@code google.bigtable.admin.v2.UpdateTableRequest} + */ +public final class UpdateTableRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.UpdateTableRequest) + UpdateTableRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateTableRequest.newBuilder() to construct. + private UpdateTableRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateTableRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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`
    +   *
    +   * 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`
    +   *
    +   * 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`
    +   *
    +   * 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_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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()); + } + 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()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @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 (!getUnknownFields().equals(other.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 = (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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTableFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @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; + } + 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; + } + result.bitField0_ |= to_bitField0_; + } + + @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.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()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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(getTableFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getUpdateMaskFieldBuilder().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.Table table_; + private com.google.protobuf.SingleFieldBuilderV3< + 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 getTableFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Table, + com.google.bigtable.admin.v2.Table.Builder, + com.google.bigtable.admin.v2.TableOrBuilder> + getTableFieldBuilder() { + if (tableBuilder_ == null) { + tableBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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`
    +     *
    +     * 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`
    +     *
    +     * 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`
    +     *
    +     * 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`
    +     *
    +     * 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`
    +     *
    +     * 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`
    +     *
    +     * 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`
    +     *
    +     * 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 getUpdateMaskFieldBuilder().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`
    +     *
    +     * 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`
    +     *
    +     * 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.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + 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.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..7d771444ce --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/UpdateTableRequestOrBuilder.java @@ -0,0 +1,138 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/bigtable_table_admin.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.admin.v2; + +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`
    +   *
    +   * 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`
    +   *
    +   * 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`
    +   *
    +   * 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(); +} 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 76dbd914f7..5e3fe7affe 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 2021 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. @@ -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"; @@ -57,12 +57,14 @@ service BigtableInstanceAdmin { // 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) { + 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" @@ -97,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" @@ -124,7 +127,8 @@ service BigtableInstanceAdmin { // 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) { + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v2/{parent=projects/*/instances/*}/clusters" body: "cluster" @@ -180,7 +184,8 @@ service BigtableInstanceAdmin { // // 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) { + rpc PartialUpdateCluster(PartialUpdateClusterRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v2/{cluster.name=projects/*/instances/*/clusters/*}" body: "cluster" @@ -218,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" }; @@ -226,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" @@ -239,7 +246,8 @@ 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/*}" }; @@ -248,7 +256,8 @@ service BigtableInstanceAdmin { // 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: "*" @@ -258,7 +267,8 @@ service BigtableInstanceAdmin { // 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: "*" @@ -267,19 +277,29 @@ service BigtableInstanceAdmin { } // 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: "*" }; 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"; + } } // 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) = { @@ -287,8 +307,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]; @@ -318,8 +338,8 @@ message GetInstanceRequest { // 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) = { @@ -355,7 +375,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. @@ -372,9 +393,8 @@ message DeleteInstanceRequest { // 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) = { @@ -382,8 +402,8 @@ message CreateClusterRequest { } ]; - // 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]; @@ -406,10 +426,11 @@ message GetClusterRequest { // 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) = { @@ -439,8 +460,8 @@ 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) = { @@ -475,6 +496,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; @@ -483,6 +535,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. @@ -511,19 +573,19 @@ message PartialUpdateClusterMetadata { // Request message for BigtableInstanceAdmin.PartialUpdateCluster. message PartialUpdateClusterRequest { - // Required. The Cluster which contains the partial updates to be applied, subject to - // the update_mask. + // 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]; + 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) = { @@ -531,8 +593,8 @@ message CreateAppProfileRequest { } ]; - // 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]; @@ -546,8 +608,8 @@ 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) = { @@ -558,8 +620,8 @@ message GetAppProfileRequest { // 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/-`. @@ -609,7 +671,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; @@ -617,7 +680,8 @@ 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, @@ -631,6 +695,57 @@ 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; } 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 88bd870474..1fdcefa4a0 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 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. @@ -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 project 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 { }; } + // 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 Table or Backup 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: "*" @@ -305,7 +407,8 @@ service BigtableTableAdmin { // Sets the access control policy on a Table or Backup 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: "*" @@ -317,8 +420,10 @@ service BigtableTableAdmin { 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 Table or Backup + // resource. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) + returns (google.iam.v1.TestIamPermissionsResponse) { option (google.api.http) = { post: "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions" body: "*" @@ -335,8 +440,7 @@ service BigtableTableAdmin { // [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 in the same project as 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) = { @@ -355,8 +459,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: "bigtableadmin.googleapis.com/Backup" - }]; + type: "bigtableadmin.googleapis.com/Backup" + }]; } } @@ -370,7 +474,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 +491,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; } @@ -421,8 +527,8 @@ message CreateTableRequest { } ]; - // 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]; @@ -465,13 +571,13 @@ message CreateTableFromSnapshotRequest { } ]; - // 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, @@ -508,8 +614,8 @@ 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) = { @@ -518,7 +624,7 @@ message ListTablesRequest { ]; // 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. @@ -566,6 +672,42 @@ 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` + // + // 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]; +} + +// 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 { @@ -580,6 +722,33 @@ message DeleteTableRequest { ]; } +// 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 +757,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 +771,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. @@ -614,18 +789,22 @@ message ModifyColumnFamiliesRequest { } ]; - // 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, @@ -645,8 +824,8 @@ 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, @@ -657,8 +836,30 @@ message CheckConsistencyRequest { // 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 { @@ -695,9 +896,9 @@ message SnapshotTableRequest { } ]; - // 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]; @@ -738,8 +939,8 @@ 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/-`. @@ -829,7 +1030,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 @@ -869,11 +1071,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 +1086,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 @@ -898,7 +1104,8 @@ message GetBackupRequest { ]; } -// 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 @@ -911,7 +1118,8 @@ message DeleteBackupRequest { ]; } -// 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}`. @@ -932,13 +1140,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 +1155,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 +1196,239 @@ 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 CreateInstance 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 views' 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//instances//tables/
    /authorizedViews/ + 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]; +} 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 1d7782e675..fe28f5fa8f 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 2021 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. @@ -17,10 +17,9 @@ syntax = "proto3"; package google.bigtable.admin.v2; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.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 2e61b0858f..d6a3c861a3 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 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. @@ -20,10 +20,9 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/bigtable/admin/v2/common.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.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"; @@ -69,19 +68,14 @@ 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 @@ -108,18 +102,31 @@ message Instance { // * Keys and values must both be under 128 bytes. map labels = 5; - // Output only. A server-assigned 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. A server-assigned 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]; } // 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). + // 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. @@ -140,13 +147,55 @@ message Cluster { pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" }; + // Possible states of a cluster. + enum State { + // The state of the cluster could not be determined. + STATE_NOT_KNOWN = 0; + + // The cluster has been successfully created and is ready to serve requests. + READY = 1; + + // The cluster is currently being created, and may be destroyed + // if the creation process encounters an error. + // A cluster may not be able to serve requests while being created. + CREATING = 2; + + // The cluster is currently being resized, and may revert to its previous + // node count if the process encounters an error. + // A cluster is still capable of serving requests while being resized, + // but may exhibit performance as if its number of allocated nodes is + // between the starting and requested states. + RESIZING = 3; + + // The cluster has no backing nodes. The data (tables) still + // exist, but no operations can be performed on the cluster. + DISABLED = 4; + } + + // Possible node scaling factors of the clusters. Node scaling delivers better + // latency and more throughput by removing node boundaries. + enum NodeScalingFactor { + // No node scaling specified. Defaults to NODE_SCALING_FACTOR_1X. + NODE_SCALING_FACTOR_UNSPECIFIED = 0; + + // The cluster is running with a scaling factor of 1. + NODE_SCALING_FACTOR_1X = 1; + + // The cluster is running with a scaling factor of 2. + // All node count values must be in increments of 2 with this scaling factor + // enabled, otherwise an INVALID_ARGUMENT error will be returned. + NODE_SCALING_FACTOR_2X = 2; + } + // Autoscaling config for a cluster. message ClusterAutoscalingConfig { // Required. Autoscaling limits for this cluster. - AutoscalingLimits autoscaling_limits = 1 [(google.api.field_behavior) = REQUIRED]; + AutoscalingLimits autoscaling_limits = 1 + [(google.api.field_behavior) = REQUIRED]; // Required. Autoscaling targets for this cluster. - AutoscalingTargets autoscaling_targets = 2 [(google.api.field_behavior) = REQUIRED]; + AutoscalingTargets autoscaling_targets = 2 + [(google.api.field_behavior) = REQUIRED]; } // Configuration for a cluster. @@ -165,66 +214,49 @@ message Cluster { // `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. + // 3) All clusters within an instance must use the same CMEK key. + // 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" }]; } - // Possible states of a cluster. - enum State { - // The state of the cluster could not be determined. - STATE_NOT_KNOWN = 0; - - // The cluster has been successfully created and is ready to serve requests. - READY = 1; - - // The cluster is currently being created, and may be destroyed - // if the creation process encounters an error. - // A cluster may not be able to serve requests while being created. - CREATING = 2; - - // The cluster is currently being resized, and may revert to its previous - // node count if the process encounters an error. - // A cluster is still capable of serving requests while being resized, - // but may exhibit performance as if its number of allocated nodes is - // between the starting and requested states. - RESIZING = 3; - - // The cluster has no backing nodes. The data (tables) still - // exist, but no operations can be performed on the cluster. - DISABLED = 4; - } - // 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]; // The number of nodes allocated to this cluster. More nodes enable higher // throughput and more consistent performance. 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 @@ -245,9 +277,34 @@ message AppProfile { // equidistant. Choosing this option sacrifices read-your-writes consistency // to improve availability. message MultiClusterRoutingUseAny { + // If enabled, Bigtable will route the request based on the row key of the + // request, rather than randomly. Instead, each row key will be assigned + // to a cluster, and will stick to that cluster. If clusters are added or + // removed, then this may affect which row keys stick to which clusters. + // To avoid this, users can use a cluster group to specify which clusters + // are to be used. In this case, new clusters that are not a part of the + // cluster group will not be routed to, and routing will be unaffected by + // the new cluster. Moreover, clusters specified in the cluster group cannot + // be deleted unless removed from the cluster group. + message RowAffinity {} + // The set of clusters to route to. The order is ignored; clusters will be // tried in order of distance. If left empty, all clusters are eligible. repeated string cluster_ids = 1; + + // Possible algorithms for routing affinity. If enabled, Bigtable will + // route between equidistant clusters in a deterministic order rather than + // choosing randomly. + // + // This mechanism gives read-your-writes consistency for *most* requests + // under *most* circumstances, without sacrificing availability. Consistency + // is *not* guaranteed, as requests might still fail over between clusters + // in the event of errors or latency. + oneof affinity { + // Row affinity sticky routing based on the row key of the request. + // Requests that span multiple rows are routed non-deterministically. + RowAffinity row_affinity = 3; + } } // Unconditionally routes all read/write requests to a specific cluster. @@ -263,7 +320,56 @@ 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 on your Bigtable data, without impacting the + // performance of the clusters that handle your application traffic. + // Currently, Data Boost exclusively supports read-only use-cases with + // single-cluster routing. + // + // Data Boost reads are only guaranteed to see the results of writes that + // were written at least 30 minutes ago. This means newly written values may + // not become visible for up to 30m, and also means that old values may + // remain visible for up to 30m after being deleted or overwritten. To + // mitigate the staleness of the data, users may either wait 30m, or use + // CheckConsistency. + 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; @@ -278,7 +384,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. @@ -290,4 +396,63 @@ 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}" + }; + + // 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]; } 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 4e2d709abf..b2ef458c83 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 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. @@ -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,6 +48,16 @@ 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 { @@ -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,26 @@ 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. The only + // supported value at this time is 3 days. + google.protobuf.Duration retention_period = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. How frequently automated backups should occur. The only + // supported value at this time is 24 hours. + google.protobuf.Duration frequency = 2 + [(google.api.field_behavior) = REQUIRED]; + } + // 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 +166,117 @@ 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; + } +} + +// 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 +288,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. @@ -284,32 +406,33 @@ 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; } @@ -333,7 +456,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 +483,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 +493,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 +531,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 +563,19 @@ 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; } 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..49c50d1767 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/types.proto @@ -0,0 +1,294 @@ +// 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.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/from the underlying data. +// +// Each encoding also defines the following properties: +// +// * Order-preserving: Does the encoded value sort consistently with the +// original typed value? Note that Bigtable will always sort data based on +// the raw encoded value, *not* the decoded type. +// - Example: BYTES values sort in the same order as their raw encodings. +// - Counterexample: Encoding INT64 as a fixed-width decimal string does +// *not* preserve sort order when dealing with negative numbers. +// `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001)`. +// * Self-delimiting: If we concatenate two encoded values, can we always tell +// where the first one ends and the second one begins? +// - Example: If we encode INT64s to fixed-width STRINGs, the first value +// will always contain exactly N digits, possibly preceded by a sign. +// - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have +// no way to tell where the first one ends. +// * Compatibility: Which other systems have matching encoding schemes? For +// example, does this encoding have a GoogleSQL equivalent? HBase? Java? +message Type { + // Bytes + // Values of type `Bytes` are stored in `Value.bytes_value`. + message Bytes { + // Rules used to convert to/from lower level types. + message Encoding { + // Leaves the value "as-is" + // * Order-preserving? Yes + // * Self-delimiting? No + // * Compatibility? N/A + message Raw {} + + // Which encoding to use. + oneof encoding { + // Use `Raw` encoding. + Raw raw = 1; + } + } + + // The encoding to use when converting to/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/from lower level types. + message Encoding { + // Deprecated: prefer the equivalent `Utf8Bytes`. + message Utf8Raw { + option deprecated = true; + } + + // UTF-8 encoding + // * Order-preserving? Yes (code point order) + // * Self-delimiting? No + // * Compatibility? + // - BigQuery Federation `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/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/from lower level types. + message Encoding { + // Encodes the value as an 8-byte big endian twos complement `Bytes` + // value. + // * Order-preserving? No (positive values only) + // * Self-delimiting? Yes + // * Compatibility? + // - BigQuery Federation `BINARY` encoding + // - HBase `Bytes.toBytes` + // - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` + message BigEndianBytes { + // Deprecated: ignored if set. + Bytes bytes_type = 1; + } + + // Which encoding to use. + oneof encoding { + // Use `BigEndianBytes` encoding. + BigEndianBytes big_endian_bytes = 1; + } + } + + // The encoding to use when converting to/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 {} + + // 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; + } + + // The names and types of the fields in this struct. + repeated Field fields = 1; + } + + // 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; + } +} 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 de2ae94dd9..64ca962c1b 100644 --- a/proto-google-cloud-bigtable-v2/pom.xml +++ b/proto-google-cloud-bigtable-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-bigtable-v2 - 2.5.3 + 2.45.0 proto-google-cloud-bigtable-v2 PROTO library for proto-google-cloud-bigtable-v2 com.google.cloud google-cloud-bigtable-parent - 2.5.3 + 2.45.0 @@ -18,14 +18,14 @@ com.google.cloud google-cloud-bigtable-deps-bom - 2.5.3 + 2.45.0 pom import com.google.cloud google-cloud-bigtable-bom - 2.5.3 + 2.45.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..ee6b0ed2fb --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValue.java @@ -0,0 +1,924 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * `ArrayValue` is an ordered list of `Value`.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ArrayValue} + */ +public final class ArrayValue extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ArrayValue) + ArrayValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use ArrayValue.newBuilder() to construct. + private ArrayValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ArrayValue() { + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ArrayValue(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ArrayValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : 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.RepeatedFieldBuilderV3< + 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 getValuesFieldBuilder().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 getValuesFieldBuilder().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 getValuesFieldBuilder() + .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 getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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..aa80768898 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ArrayValueOrBuilder.java @@ -0,0 +1,77 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..26bc34da3d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/AuthorizedViewName.java @@ -0,0 +1,269 @@ +/* + * 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.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 2faa963ae0..b2bb19fca9 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public final class BigtableProto { @@ -71,6 +72,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -79,6 +84,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -87,6 +100,54 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_ExecuteQueryResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -100,113 +161,281 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "gle.bigtable.v2\032\034google/api/annotations." + "proto\032\027google/api/client.proto\032\037google/a" + "pi/field_behavior.proto\032\031google/api/reso" - + "urce.proto\032\035google/bigtable/v2/data.prot" - + "o\032\036google/protobuf/wrappers.proto\032\027googl" - + "e/rpc/status.proto\"\326\001\n\017ReadRowsRequest\022>" - + "\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmi" - + "n.googleapis.com/Table\022\026\n\016app_profile_id" - + "\030\005 \001(\t\022(\n\004rows\030\002 \001(\0132\032.google.bigtable.v" - + "2.RowSet\022-\n\006filter\030\003 \001(\0132\035.google.bigtab" - + "le.v2.RowFilter\022\022\n\nrows_limit\030\004 \001(\003\"\370\002\n\020" - + "ReadRowsResponse\022>\n\006chunks\030\001 \003(\0132..googl" - + "e.bigtable.v2.ReadRowsResponse.CellChunk" - + "\022\034\n\024last_scanned_row_key\030\002 \001(\014\032\205\002\n\tCellC" - + "hunk\022\017\n\007row_key\030\001 \001(\014\0221\n\013family_name\030\002 \001" - + "(\0132\034.google.protobuf.StringValue\022.\n\tqual" - + "ifier\030\003 \001(\0132\033.google.protobuf.BytesValue" - + "\022\030\n\020timestamp_micros\030\004 \001(\003\022\016\n\006labels\030\005 \003" - + "(\t\022\r\n\005value\030\006 \001(\014\022\022\n\nvalue_size\030\007 \001(\005\022\023\n" - + "\treset_row\030\010 \001(\010H\000\022\024\n\ncommit_row\030\t \001(\010H\000" - + "B\014\n\nrow_status\"n\n\024SampleRowKeysRequest\022>" - + "\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmi" - + "n.googleapis.com/Table\022\026\n\016app_profile_id" - + "\030\002 \001(\t\">\n\025SampleRowKeysResponse\022\017\n\007row_k" - + "ey\030\001 \001(\014\022\024\n\014offset_bytes\030\002 \001(\003\"\266\001\n\020Mutat" - + "eRowRequest\022>\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n" - + "\"bigtableadmin.googleapis.com/Table\022\026\n\016a" - + "pp_profile_id\030\004 \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340A" - + "\002\0224\n\tmutations\030\003 \003(\0132\034.google.bigtable.v" - + "2.MutationB\003\340A\002\"\023\n\021MutateRowResponse\"\376\001\n" - + "\021MutateRowsRequest\022>\n\ntable_name\030\001 \001(\tB*" - + "\340A\002\372A$\n\"bigtableadmin.googleapis.com/Tab" - + "le\022\026\n\016app_profile_id\030\003 \001(\t\022A\n\007entries\030\002 " - + "\003(\0132+.google.bigtable.v2.MutateRowsReque" - + "st.EntryB\003\340A\002\032N\n\005Entry\022\017\n\007row_key\030\001 \001(\014\022" - + "4\n\tmutations\030\002 \003(\0132\034.google.bigtable.v2." - + "MutationB\003\340A\002\"\217\001\n\022MutateRowsResponse\022=\n\007" - + "entries\030\001 \003(\0132,.google.bigtable.v2.Mutat" - + "eRowsResponse.Entry\032:\n\005Entry\022\r\n\005index\030\001 " - + "\001(\003\022\"\n\006status\030\002 \001(\0132\022.google.rpc.Status\"" - + "\256\002\n\030CheckAndMutateRowRequest\022>\n\ntable_na" - + "me\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin.googleap" - + "is.com/Table\022\026\n\016app_profile_id\030\007 \001(\t\022\024\n\007" - + "row_key\030\002 \001(\014B\003\340A\002\0227\n\020predicate_filter\030\006" - + " \001(\0132\035.google.bigtable.v2.RowFilter\0224\n\016t" - + "rue_mutations\030\004 \003(\0132\034.google.bigtable.v2" - + ".Mutation\0225\n\017false_mutations\030\005 \003(\0132\034.goo" - + "gle.bigtable.v2.Mutation\"6\n\031CheckAndMuta" - + "teRowResponse\022\031\n\021predicate_matched\030\001 \001(\010" - + "\"\306\001\n\031ReadModifyWriteRowRequest\022>\n\ntable_" - + "name\030\001 \001(\tB*\340A\002\372A$\n\"bigtableadmin.google" - + "apis.com/Table\022\026\n\016app_profile_id\030\004 \001(\t\022\024" - + "\n\007row_key\030\002 \001(\014B\003\340A\002\022;\n\005rules\030\003 \003(\0132\'.go" - + "ogle.bigtable.v2.ReadModifyWriteRuleB\003\340A" - + "\002\"B\n\032ReadModifyWriteRowResponse\022$\n\003row\030\001" - + " \001(\0132\027.google.bigtable.v2.Row2\304\016\n\010Bigtab" - + "le\022\306\001\n\010ReadRows\022#.google.bigtable.v2.Rea" - + "dRowsRequest\032$.google.bigtable.v2.ReadRo" - + "wsResponse\"m\202\323\344\223\002>\"9/v2/{table_name=proj" - + "ects/*/instances/*/tables/*}:readRows:\001*" - + "\332A\ntable_name\332A\031table_name,app_profile_i" - + "d0\001\022\327\001\n\rSampleRowKeys\022(.google.bigtable." - + "v2.SampleRowKeysRequest\032).google.bigtabl" - + "e.v2.SampleRowKeysResponse\"o\202\323\344\223\002@\022>/v2/" + + "urce.proto\032\030google/api/routing.proto\032\035go" + + "ogle/bigtable/v2/data.proto\032&google/bigt" + + "able/v2/request_stats.proto\032\036google/prot" + + "obuf/duration.proto\032\037google/protobuf/tim" + + "estamp.proto\032\036google/protobuf/wrappers.p" + + "roto\032\027google/rpc/status.proto\"\365\003\n\017ReadRo" + + "wsRequest\022>\n\ntable_name\030\001 \001(\tB*\340A\001\372A$\n\"b" + + "igtableadmin.googleapis.com/Table\022Q\n\024aut" + + "horized_view_name\030\t \001(\tB3\340A\001\372A-\n+bigtabl" + + "eadmin.googleapis.com/AuthorizedView\022\026\n\016" + + "app_profile_id\030\005 \001(\t\022(\n\004rows\030\002 \001(\0132\032.goo" + + "gle.bigtable.v2.RowSet\022-\n\006filter\030\003 \001(\0132\035" + + ".google.bigtable.v2.RowFilter\022\022\n\nrows_li" + + "mit\030\004 \001(\003\022P\n\022request_stats_view\030\006 \001(\01624." + + "google.bigtable.v2.ReadRowsRequest.Reque" + + "stStatsView\022\020\n\010reversed\030\007 \001(\010\"f\n\020Request" + + "StatsView\022\"\n\036REQUEST_STATS_VIEW_UNSPECIF" + + "IED\020\000\022\026\n\022REQUEST_STATS_NONE\020\001\022\026\n\022REQUEST" + + "_STATS_FULL\020\002\"\261\003\n\020ReadRowsResponse\022>\n\006ch" + + "unks\030\001 \003(\0132..google.bigtable.v2.ReadRows" + + "Response.CellChunk\022\034\n\024last_scanned_row_k" + + "ey\030\002 \001(\014\0227\n\rrequest_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\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\"\301\001\n\024SampleRowKeysRequest\022>\n\nta" + + "ble_name\030\001 \001(\tB*\340A\001\372A$\n\"bigtableadmin.go" + + "ogleapis.com/Table\022Q\n\024authorized_view_na" + + "me\030\004 \001(\tB3\340A\001\372A-\n+bigtableadmin.googleap" + + "is.com/AuthorizedView\022\026\n\016app_profile_id\030" + + "\002 \001(\t\">\n\025SampleRowKeysResponse\022\017\n\007row_ke" + + "y\030\001 \001(\014\022\024\n\014offset_bytes\030\002 \001(\003\"\211\002\n\020Mutate" + + "RowRequest\022>\n\ntable_name\030\001 \001(\tB*\340A\001\372A$\n\"" + + "bigtableadmin.googleapis.com/Table\022Q\n\024au" + + "thorized_view_name\030\006 \001(\tB3\340A\001\372A-\n+bigtab" + + "leadmin.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\"\023\n\021MutateRowResponse\"\321" + + "\002\n\021MutateRowsRequest\022>\n\ntable_name\030\001 \001(\t" + + "B*\340A\001\372A$\n\"bigtableadmin.googleapis.com/T" + + "able\022Q\n\024authorized_view_name\030\005 \001(\tB3\340A\001\372" + + "A-\n+bigtableadmin.googleapis.com/Authori" + + "zedView\022\026\n\016app_profile_id\030\003 \001(\t\022A\n\007entri" + + "es\030\002 \003(\0132+.google.bigtable.v2.MutateRows" + + "Request.EntryB\003\340A\002\032N\n\005Entry\022\017\n\007row_key\030\001" + + " \001(\014\0224\n\tmutations\030\002 \003(\0132\034.google.bigtabl" + + "e.v2.MutationB\003\340A\002\"\344\001\n\022MutateRowsRespons" + + "e\022=\n\007entries\030\001 \003(\0132,.google.bigtable.v2." + + "MutateRowsResponse.Entry\022?\n\017rate_limit_i" + + "nfo\030\003 \001(\0132!.google.bigtable.v2.RateLimit" + + "InfoH\000\210\001\001\032:\n\005Entry\022\r\n\005index\030\001 \001(\003\022\"\n\006sta" + + "tus\030\002 \001(\0132\022.google.rpc.StatusB\022\n\020_rate_l" + + "imit_info\"J\n\rRateLimitInfo\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\nta" + + "ble_name\030\001 \001(\tB*\340A\001\372A$\n\"bigtableadmin.go" + + "ogleapis.com/Table\022Q\n\024authorized_view_na" + + "me\030\t \001(\tB3\340A\001\372A-\n+bigtableadmin.googleap" + + "is.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.RowFi" + + "lter\0224\n\016true_mutations\030\004 \003(\0132\034.google.bi" + + "gtable.v2.Mutation\0225\n\017false_mutations\030\005 " + + "\003(\0132\034.google.bigtable.v2.Mutation\"6\n\031Che" + + "ckAndMutateRowResponse\022\031\n\021predicate_matc" + + "hed\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\023" + + "PingAndWarmResponse\"\231\002\n\031ReadModifyWriteR" + + "owRequest\022>\n\ntable_name\030\001 \001(\tB*\340A\001\372A$\n\"b" + + "igtableadmin.googleapis.com/Table\022Q\n\024aut" + + "horized_view_name\030\006 \001(\tB3\340A\001\372A-\n+bigtabl" + + "eadmin.googleapis.com/AuthorizedView\022\026\n\016" + + "app_profile_id\030\004 \001(\t\022\024\n\007row_key\030\002 \001(\014B\003\340" + + "A\002\022;\n\005rules\030\003 \003(\0132\'.google.bigtable.v2.R" + + "eadModifyWriteRuleB\003\340A\002\"B\n\032ReadModifyWri" + + "teRowResponse\022$\n\003row\030\001 \001(\0132\027.google.bigt" + + "able.v2.Row\"\206\001\n,GenerateInitialChangeStr" + + "eamPartitionsRequest\022>\n\ntable_name\030\001 \001(\t" + + "B*\340A\002\372A$\n\"bigtableadmin.googleapis.com/T" + + "able\022\026\n\016app_profile_id\030\002 \001(\t\"g\n-Generate" + + "InitialChangeStreamPartitionsResponse\0226\n" + + "\tpartition\030\001 \001(\0132#.google.bigtable.v2.St" + + "reamPartition\"\233\003\n\027ReadChangeStreamReques" + + "t\022>\n\ntable_name\030\001 \001(\tB*\340A\002\372A$\n\"bigtablea" + + "dmin.googleapis.com/Table\022\026\n\016app_profile" + + "_id\030\002 \001(\t\0226\n\tpartition\030\003 \001(\0132#.google.bi" + + "gtable.v2.StreamPartition\0220\n\nstart_time\030" + + "\004 \001(\0132\032.google.protobuf.TimestampH\000\022K\n\023c" + + "ontinuation_tokens\030\006 \001(\0132,.google.bigtab" + + "le.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.prot" + + "obuf.DurationB\014\n\nstart_from\"\251\n\n\030ReadChan" + + "geStreamResponse\022N\n\013data_change\030\001 \001(\01327." + + "google.bigtable.v2.ReadChangeStreamRespo" + + "nse.DataChangeH\000\022K\n\theartbeat\030\002 \001(\01326.go" + + "ogle.bigtable.v2.ReadChangeStreamRespons" + + "e.HeartbeatH\000\022P\n\014close_stream\030\003 \001(\01328.go" + + "ogle.bigtable.v2.ReadChangeStreamRespons" + + "e.CloseStreamH\000\032\364\001\n\rMutationChunk\022X\n\nchu" + + "nk_info\030\001 \001(\0132D.google.bigtable.v2.ReadC" + + "hangeStreamResponse.MutationChunk.ChunkI" + + "nfo\022.\n\010mutation\030\002 \001(\0132\034.google.bigtable." + + "v2.Mutation\032Y\n\tChunkInfo\022\032\n\022chunked_valu" + + "e_size\030\001 \001(\005\022\034\n\024chunked_value_offset\030\002 \001" + + "(\005\022\022\n\nlast_chunk\030\003 \001(\010\032\306\003\n\nDataChange\022J\n" + + "\004type\030\001 \001(\0162<.google.bigtable.v2.ReadCha" + + "ngeStreamResponse.DataChange.Type\022\031\n\021sou" + + "rce_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.protobu" + + "f.Timestamp\022\022\n\ntiebreaker\030\005 \001(\005\022J\n\006chunk" + + "s\030\006 \003(\0132:.google.bigtable.v2.ReadChangeS" + + "treamResponse.MutationChunk\022\014\n\004done\030\010 \001(" + + "\010\022\r\n\005token\030\t \001(\t\022;\n\027estimated_low_waterm" + + "ark\030\n \001(\0132\032.google.protobuf.Timestamp\"P\n" + + "\004Type\022\024\n\020TYPE_UNSPECIFIED\020\000\022\010\n\004USER\020\001\022\026\n" + + "\022GARBAGE_COLLECTION\020\002\022\020\n\014CONTINUATION\020\003\032" + + "\221\001\n\tHeartbeat\022G\n\022continuation_token\030\001 \001(" + + "\0132+.google.bigtable.v2.StreamContinuatio" + + "nToken\022;\n\027estimated_low_watermark\030\002 \001(\0132" + + "\032.google.protobuf.Timestamp\032\270\001\n\013CloseStr" + + "eam\022\"\n\006status\030\001 \001(\0132\022.google.rpc.Status\022" + + "H\n\023continuation_tokens\030\002 \003(\0132+.google.bi" + + "gtable.v2.StreamContinuationToken\022;\n\016new" + + "_partitions\030\003 \003(\0132#.google.bigtable.v2.S" + + "treamPartitionB\017\n\rstream_record\"\203\003\n\023Exec" + + "uteQueryRequest\022D\n\rinstance_name\030\001 \001(\tB-" + + "\340A\002\372A\'\n%bigtableadmin.googleapis.com/Ins" + + "tance\022\033\n\016app_profile_id\030\002 \001(\tB\003\340A\001\022\022\n\005qu" + + "ery\030\003 \001(\tB\003\340A\002\0227\n\014proto_format\030\004 \001(\0132\037.g" + + "oogle.bigtable.v2.ProtoFormatH\000\022\031\n\014resum" + + "e_token\030\010 \001(\014B\003\340A\001\022H\n\006params\030\007 \003(\01323.goo" + + "gle.bigtable.v2.ExecuteQueryRequest.Para" + + "msEntryB\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.Val" + + "ue:\0028\001B\r\n\013data_format\"\226\001\n\024ExecuteQueryRe" + + "sponse\0229\n\010metadata\030\001 \001(\0132%.google.bigtab" + + "le.v2.ResultSetMetadataH\000\0227\n\007results\030\002 \001" + + "(\0132$.google.bigtable.v2.PartialResultSet" + + "H\000B\n\n\010response2\235$\n\010Bigtable\022\333\003\n\010ReadRows" + + "\022#.google.bigtable.v2.ReadRowsRequest\032$." + + "google.bigtable.v2.ReadRowsResponse\"\201\003\332A" + + "\ntable_name\332A\031table_name,app_profile_id\202" + + "\323\344\223\002\232\001\"9/v2/{table_name=projects/*/insta" + + "nces/*/tables/*}:readRows:\001*ZZ\"U/v2/{aut" + + "horized_view_name=projects/*/instances/*" + + "/tables/*/authorizedViews/*}:readRows:\001*" + + "\212\323\344\223\002\260\001\022:\n\ntable_name\022,{table_name=proje" + + "cts/*/instances/*/tables/*}\022\020\n\016app_profi" + + "le_id\022`\n\024authorized_view_name\022H{authoriz" + + "ed_view_name=projects/*/instances/*/tabl" + + "es/*/authorizedViews/*}0\001\022\356\003\n\rSampleRowK" + + "eys\022(.google.bigtable.v2.SampleRowKeysRe" + + "quest\032).google.bigtable.v2.SampleRowKeys" + + "Response\"\205\003\332A\ntable_name\332A\031table_name,ap" + + "p_profile_id\202\323\344\223\002\236\001\022>/v2/{table_name=pro" + + "jects/*/instances/*/tables/*}:sampleRowK" + + "eysZ\\\022Z/v2/{authorized_view_name=project" + + "s/*/instances/*/tables/*/authorizedViews" + + "/*}:sampleRowKeys\212\323\344\223\002\260\001\022:\n\ntable_name\022," + "{table_name=projects/*/instances/*/table" - + "s/*}:sampleRowKeys\332A\ntable_name\332A\031table_" - + "name,app_profile_id0\001\022\355\001\n\tMutateRow\022$.go" - + "ogle.bigtable.v2.MutateRowRequest\032%.goog" - + "le.bigtable.v2.MutateRowResponse\"\222\001\202\323\344\223\002" - + "?\":/v2/{table_name=projects/*/instances/" - + "*/tables/*}:mutateRow:\001*\332A\034table_name,ro" - + "w_key,mutations\332A+table_name,row_key,mut" - + "ations,app_profile_id\022\336\001\n\nMutateRows\022%.g" - + "oogle.bigtable.v2.MutateRowsRequest\032&.go" - + "ogle.bigtable.v2.MutateRowsResponse\"\177\202\323\344" - + "\223\002@\";/v2/{table_name=projects/*/instance" - + "s/*/tables/*}:mutateRows:\001*\332A\022table_name" - + ",entries\332A!table_name,entries,app_profil" - + "e_id0\001\022\331\002\n\021CheckAndMutateRow\022,.google.bi" - + "gtable.v2.CheckAndMutateRowRequest\032-.goo" - + "gle.bigtable.v2.CheckAndMutateRowRespons" - + "e\"\346\001\202\323\344\223\002G\"B/v2/{table_name=projects/*/i" - + "nstances/*/tables/*}:checkAndMutateRow:\001" - + "*\332ABtable_name,row_key,predicate_filter," - + "true_mutations,false_mutations\332AQtable_n" - + "ame,row_key,predicate_filter,true_mutati" - + "ons,false_mutations,app_profile_id\022\211\002\n\022R" - + "eadModifyWriteRow\022-.google.bigtable.v2.R" - + "eadModifyWriteRowRequest\032..google.bigtab" - + "le.v2.ReadModifyWriteRowResponse\"\223\001\202\323\344\223\002" - + "H\"C/v2/{table_name=projects/*/instances/" - + "*/tables/*}:readModifyWriteRow:\001*\332A\030tabl" - + "e_name,row_key,rules\332A\'table_name,row_ke" - + "y,rules,app_profile_id\032\333\002\312A\027bigtable.goo" - + "gleapis.com\322A\275\002https://www.googleapis.co" - + "m/auth/bigtable.data,https://www.googlea" - + "pis.com/auth/bigtable.data.readonly,http" - + "s://www.googleapis.com/auth/cloud-bigtab" - + "le.data,https://www.googleapis.com/auth/" - + "cloud-bigtable.data.readonly,https://www" - + ".googleapis.com/auth/cloud-platform,http" - + "s://www.googleapis.com/auth/cloud-platfo" - + "rm.read-onlyB\230\002\n\026com.google.bigtable.v2B" - + "\rBigtableProtoP\001Z:google.golang.org/genp" - + "roto/googleapis/bigtable/v2;bigtable\252\002\030G" + + "s/*}\022\020\n\016app_profile_id\022`\n\024authorized_vie" + + "w_name\022H{authorized_view_name=projects/*" + + "/instances/*/tables/*/authorizedViews/*}" + + "0\001\022\202\004\n\tMutateRow\022$.google.bigtable.v2.Mu" + + "tateRowRequest\032%.google.bigtable.v2.Muta" + + "teRowResponse\"\247\003\332A\034table_name,row_key,mu" + + "tations\332A+table_name,row_key,mutations,a" + + "pp_profile_id\202\323\344\223\002\234\001\":/v2/{table_name=pr" + + "ojects/*/instances/*/tables/*}:mutateRow" + + ":\001*Z[\"V/v2/{authorized_view_name=project" + + "s/*/instances/*/tables/*/authorizedViews" + + "/*}:mutateRow:\001*\212\323\344\223\002\260\001\022:\n\ntable_name\022,{" + + "table_name=projects/*/instances/*/tables" + + "/*}\022\020\n\016app_profile_id\022`\n\024authorized_view" + + "_name\022H{authorized_view_name=projects/*/" + + "instances/*/tables/*/authorizedViews/*}\022" + + "\365\003\n\nMutateRows\022%.google.bigtable.v2.Muta" + + "teRowsRequest\032&.google.bigtable.v2.Mutat" + + "eRowsResponse\"\225\003\332A\022table_name,entries\332A!" + + "table_name,entries,app_profile_id\202\323\344\223\002\236\001" + + "\";/v2/{table_name=projects/*/instances/*" + + "/tables/*}:mutateRows:\001*Z\\\"W/v2/{authori" + + "zed_view_name=projects/*/instances/*/tab" + + "les/*/authorizedViews/*}:mutateRows:\001*\212\323" + + "\344\223\002\260\001\022:\n\ntable_name\022,{table_name=project" + + "s/*/instances/*/tables/*}\022\020\n\016app_profile" + + "_id\022`\n\024authorized_view_name\022H{authorized" + + "_view_name=projects/*/instances/*/tables" + + "/*/authorizedViews/*}0\001\022\366\004\n\021CheckAndMuta" + + "teRow\022,.google.bigtable.v2.CheckAndMutat" + + "eRowRequest\032-.google.bigtable.v2.CheckAn" + + "dMutateRowResponse\"\203\004\332ABtable_name,row_k" + + "ey,predicate_filter,true_mutations,false" + + "_mutations\332AQtable_name,row_key,predicat" + + "e_filter,true_mutations,false_mutations," + + "app_profile_id\202\323\344\223\002\254\001\"B/v2/{table_name=p" + + "rojects/*/instances/*/tables/*}:checkAnd" + + "MutateRow:\001*Zc\"^/v2/{authorized_view_nam" + + "e=projects/*/instances/*/tables/*/author" + + "izedViews/*}:checkAndMutateRow:\001*\212\323\344\223\002\260\001" + + "\022:\n\ntable_name\022,{table_name=projects/*/i" + + "nstances/*/tables/*}\022\020\n\016app_profile_id\022`" + + "\n\024authorized_view_name\022H{authorized_view" + + "_name=projects/*/instances/*/tables/*/au" + + "thorizedViews/*}\022\356\001\n\013PingAndWarm\022&.googl" + + "e.bigtable.v2.PingAndWarmRequest\032\'.googl" + + "e.bigtable.v2.PingAndWarmResponse\"\215\001\332A\004n" + + "ame\332A\023name,app_profile_id\202\323\344\223\002+\"&/v2/{na" + + "me=projects/*/instances/*}:ping:\001*\212\323\344\223\0029" + + "\022%\n\004name\022\035{name=projects/*/instances/*}\022" + + "\020\n\016app_profile_id\022\247\004\n\022ReadModifyWriteRow" + + "\022-.google.bigtable.v2.ReadModifyWriteRow" + + "Request\032..google.bigtable.v2.ReadModifyW" + + "riteRowResponse\"\261\003\332A\030table_name,row_key," + + "rules\332A\'table_name,row_key,rules,app_pro" + + "file_id\202\323\344\223\002\256\001\"C/v2/{table_name=projects" + + "/*/instances/*/tables/*}:readModifyWrite" + + "Row:\001*Zd\"_/v2/{authorized_view_name=proj" + + "ects/*/instances/*/tables/*/authorizedVi" + + "ews/*}:readModifyWriteRow:\001*\212\323\344\223\002\260\001\022:\n\nt" + + "able_name\022,{table_name=projects/*/instan" + + "ces/*/tables/*}\022\020\n\016app_profile_id\022`\n\024aut" + + "horized_view_name\022H{authorized_view_name" + + "=projects/*/instances/*/tables/*/authori" + + "zedViews/*}\022\273\002\n%GenerateInitialChangeStr" + + "eamPartitions\022@.google.bigtable.v2.Gener" + + "ateInitialChangeStreamPartitionsRequest\032" + + "A.google.bigtable.v2.GenerateInitialChan" + + "geStreamPartitionsResponse\"\212\001\332A\ntable_na" + + "me\332A\031table_name,app_profile_id\202\323\344\223\002[\"V/v" + + "2/{table_name=projects/*/instances/*/tab" + + "les/*}:generateInitialChangeStreamPartit" + + "ions:\001*0\001\022\346\001\n\020ReadChangeStream\022+.google." + + "bigtable.v2.ReadChangeStreamRequest\032,.go" + + "ogle.bigtable.v2.ReadChangeStreamRespons" + + "e\"u\332A\ntable_name\332A\031table_name,app_profil" + + "e_id\202\323\344\223\002F\"A/v2/{table_name=projects/*/i" + + "nstances/*/tables/*}:readChangeStream:\001*" + + "0\001\022\253\002\n\014ExecuteQuery\022\'.google.bigtable.v2" + + ".ExecuteQueryRequest\032(.google.bigtable.v" + + "2.ExecuteQueryResponse\"\305\001\332A\023instance_nam" + + "e,query\332A\"instance_name,query,app_profil" + + "e_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/*/instance" + + "s/*}\022\020\n\016app_profile_id0\001\032\333\002\312A\027bigtable.g" + + "oogleapis.com\322A\275\002https://www.googleapis." + + "com/auth/bigtable.data,https://www.googl" + + "eapis.com/auth/bigtable.data.readonly,ht" + + "tps://www.googleapis.com/auth/cloud-bigt" + + "able.data,https://www.googleapis.com/aut" + + "h/cloud-bigtable.data.readonly,https://w" + + "ww.googleapis.com/auth/cloud-platform,ht" + + "tps://www.googleapis.com/auth/cloud-plat" + + "form.read-onlyB\364\003\n\026com.google.bigtable.v" + + "2B\rBigtableProtoP\001Z8cloud.google.com/go/" + + "bigtable/apiv2/bigtablepb;bigtablepb\252\002\030G" + "oogle.Cloud.Bigtable.V2\312\002\030Google\\Cloud\\B" + "igtable\\V2\352\002\033Google::Cloud::Bigtable::V2" - + "\352A\\\n\"bigtableadmin.googleapis.com/Table\022" - + "6projects/{project}/instances/{instance}" - + "/tables/{table}b\006proto3" + + "\352AP\n%bigtableadmin.googleapis.com/Instan" + + "ce\022\'projects/{project}/instances/{instan" + + "ce}\352A\\\n\"bigtableadmin.googleapis.com/Tab" + + "le\0226projects/{project}/instances/{instan" + + "ce}/tables/{table}\352A\207\001\n+bigtableadmin.go" + + "ogleapis.com/AuthorizedView\022Xprojects/{p" + + "roject}/instances/{instance}/tables/{tab" + + "le}/authorizedViews/{authorized_view}b\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -216,7 +445,11 @@ 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.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), com.google.protobuf.WrappersProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), }); @@ -226,7 +459,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_ReadRowsRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", "Rows", "Filter", "RowsLimit", + "TableName", + "AuthorizedViewName", + "AppProfileId", + "Rows", + "Filter", + "RowsLimit", + "RequestStatsView", + "Reversed", }); internal_static_google_bigtable_v2_ReadRowsResponse_descriptor = getDescriptor().getMessageTypes().get(1); @@ -234,7 +474,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.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); @@ -259,7 +499,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_SampleRowKeysRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", + "TableName", "AuthorizedViewName", "AppProfileId", }); internal_static_google_bigtable_v2_SampleRowKeysResponse_descriptor = getDescriptor().getMessageTypes().get(3); @@ -275,7 +515,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_MutateRowRequest_descriptor, new java.lang.String[] { - "TableName", "AppProfileId", "RowKey", "Mutations", + "TableName", "AuthorizedViewName", "AppProfileId", "RowKey", "Mutations", }); internal_static_google_bigtable_v2_MutateRowResponse_descriptor = getDescriptor().getMessageTypes().get(5); @@ -289,7 +529,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.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); @@ -305,7 +545,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.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); @@ -315,13 +555,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Index", "Status", }); - internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor = + internal_static_google_bigtable_v2_RateLimitInfo_descriptor = getDescriptor().getMessageTypes().get(8); + internal_static_google_bigtable_v2_RateLimitInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_RateLimitInfo_descriptor, + new java.lang.String[] { + "Period", "Factor", + }); + internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor = + getDescriptor().getMessageTypes().get(9); internal_static_google_bigtable_v2_CheckAndMutateRowRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_CheckAndMutateRowRequest_descriptor, new java.lang.String[] { "TableName", + "AuthorizedViewName", "AppProfileId", "RowKey", "PredicateFilter", @@ -329,29 +578,170 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FalseMutations", }); internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_google_bigtable_v2_CheckAndMutateRowResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor, new java.lang.String[] { "PredicateMatched", }); + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor, + new java.lang.String[] { + "Name", "AppProfileId", + }); + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor, + new java.lang.String[] {}); internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(13); internal_static_google_bigtable_v2_ReadModifyWriteRowRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(14); internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor, new java.lang.String[] { "Row", }); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsRequest_descriptor, + new java.lang.String[] { + "TableName", "AppProfileId", + }); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_GenerateInitialChangeStreamPartitionsResponse_descriptor, + new java.lang.String[] { + "Partition", + }); + internal_static_google_bigtable_v2_ReadChangeStreamRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_bigtable_v2_ReadChangeStreamRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(18); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(0); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(0); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_MutationChunk_ChunkInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(1); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_DataChange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(2); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_Heartbeat_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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 + .getNestedTypes() + .get(3); + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadChangeStreamResponse_CloseStream_descriptor, + new java.lang.String[] { + "Status", "ContinuationTokens", "NewPartitions", + }); + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_bigtable_v2_ExecuteQueryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor, + new java.lang.String[] { + "InstanceName", + "AppProfileId", + "Query", + "ProtoFormat", + "ResumeToken", + "Params", + "DataFormat", + }); + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_descriptor = + internal_static_google_bigtable_v2_ExecuteQueryRequest_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ExecuteQueryRequest_ParamsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_bigtable_v2_ExecuteQueryResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ExecuteQueryResponse_descriptor, + new java.lang.String[] { + "Metadata", "Results", "Response", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -361,13 +751,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { registry.add(com.google.api.ClientProto.oauthScopes); registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.api.RoutingProto.routing); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); com.google.bigtable.v2.DataProto.getDescriptor(); + com.google.bigtable.v2.RequestStatsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); com.google.protobuf.WrappersProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); } diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Cell.java index e9fcd3494b..d417de70cd 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,7 +40,7 @@ private Cell(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Cell() { value_ = com.google.protobuf.ByteString.EMPTY; - labels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + labels_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -48,72 +49,6 @@ 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Cell_descriptor; } @@ -128,7 +63,7 @@ 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 +86,7 @@ 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 +106,10 @@ 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(); /** * * @@ -254,7 +192,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < labels_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, labels_.getRaw(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -277,7 +215,7 @@ public int getSerializedSize() { size += dataSize; size += 1 * getLabelsList().size(); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -295,7 +233,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 +252,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; } @@ -440,28 +378,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) { 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,18 +416,27 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.Cell result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.timestampMicros_ = timestampMicros_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + labels_.makeImmutable(); + result.labels_ = labels_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -553,14 +491,14 @@ public Builder mergeFrom(com.google.bigtable.v2.Cell other) { 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,17 +513,50 @@ 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; } @@ -632,6 +603,7 @@ public long getTimestampMicros() { public Builder setTimestampMicros(long value) { timestampMicros_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -652,7 +624,7 @@ public Builder setTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000001); timestampMicros_ = 0L; onChanged(); return this; @@ -694,8 +666,8 @@ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -713,20 +685,20 @@ 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,7 +712,8 @@ private void ensureLabelsIsMutable() { * @return A list containing the labels. */ public com.google.protobuf.ProtocolStringList getLabelsList() { - return labels_.getUnmodifiableView(); + labels_.makeImmutable(); + return labels_; } /** * @@ -805,6 +778,7 @@ public Builder setLabels(int index, java.lang.String value) { } ensureLabelsIsMutable(); labels_.set(index, value); + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -826,6 +800,7 @@ public Builder addLabels(java.lang.String value) { } ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -844,6 +819,7 @@ 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,8 +835,9 @@ 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,6 +860,7 @@ public Builder addLabelsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -919,7 +897,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..ec034d15b2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface CellOrBuilder 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 412b8551d6..cd17ab20a4 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,6 +40,7 @@ private CheckAndMutateRowRequest(com.google.protobuf.GeneratedMessageV3.Builder< private CheckAndMutateRowRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; rowKey_ = com.google.protobuf.ByteString.EMPTY; trueMutations_ = java.util.Collections.emptyList(); @@ -51,109 +53,6 @@ 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; @@ -169,20 +68,24 @@ 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. @@ -203,14 +106,15 @@ public 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. @@ -228,8 +132,73 @@ 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_ = ""; /** * * @@ -280,12 +249,13 @@ 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]; @@ -315,7 +285,7 @@ public com.google.protobuf.ByteString getRowKey() { */ @java.lang.Override public boolean hasPredicateFilter() { - return predicateFilter_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -351,10 +321,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_MUTATIONS_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") private java.util.List trueMutations_; /** * @@ -444,6 +418,8 @@ 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_; /** * @@ -558,13 +534,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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, appProfileId_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, authorizedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -585,13 +564,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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -608,6 +590,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 +599,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 +612,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 +630,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; } @@ -785,6 +770,7 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPredicateFilterFieldBuilder(); getTrueMutationsFieldBuilder(); getFalseMutationsFieldBuilder(); } @@ -793,30 +779,30 @@ private void maybeForceBuilderInitialization() { @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,35 +830,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; + } + + 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,10 +931,17 @@ 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) { @@ -939,7 +954,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,7 +967,7 @@ 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() @@ -966,7 +981,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,7 +994,7 @@ 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() @@ -989,7 +1004,7 @@ public Builder mergeFrom(com.google.bigtable.v2.CheckAndMutateRowRequest other) } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1004,17 +1019,85 @@ 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(getPredicateFilterFieldBuilder().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; } @@ -1025,14 +1108,15 @@ public Builder mergeFrom( * * *
    -     * 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. @@ -1052,14 +1136,15 @@ public 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. @@ -1079,14 +1164,15 @@ public com.google.protobuf.ByteString getTableNameBytes() { * * *
    -     * 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,8 +1182,8 @@ public Builder setTableName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1105,21 +1191,22 @@ public Builder setTableName(java.lang.String value) { * * *
    -     * 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; } @@ -1127,14 +1214,15 @@ public Builder clearTableName() { * * *
    -     * 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,8 +1233,144 @@ 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; } @@ -1215,8 +1439,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1233,8 +1457,8 @@ 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,8 +1480,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1267,7 +1491,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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]; @@ -1282,7 +1507,8 @@ public com.google.protobuf.ByteString getRowKey() { * * *
    -     * 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,8 +1520,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1303,7 +1529,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * * *
    -     * 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,7 +1538,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; @@ -1338,7 +1565,7 @@ public Builder clearRowKey() { * @return Whether the predicateFilter field is set. */ public boolean hasPredicateFilter() { - return predicateFilterBuilder_ != null || predicateFilter_ != null; + return ((bitField0_ & 0x00000010) != 0); } /** * @@ -1381,11 +1608,11 @@ 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,11 +1630,11 @@ 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,19 +1651,20 @@ 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,14 +1680,13 @@ 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,7 +1702,7 @@ public Builder clearPredicateFilter() { * .google.bigtable.v2.RowFilter predicate_filter = 6; */ public com.google.bigtable.v2.RowFilter.Builder getPredicateFilterBuilder() { - + bitField0_ |= 0x00000010; onChanged(); return getPredicateFilterFieldBuilder().getBuilder(); } @@ -1533,9 +1760,9 @@ 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; } } @@ -1794,7 +2021,7 @@ public Builder addAllTrueMutations( public Builder clearTrueMutations() { if (trueMutationsBuilder_ == null) { trueMutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { trueMutationsBuilder_.clear(); @@ -1944,7 +2171,7 @@ public java.util.List getTrueMutationsB com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder>( trueMutations_, - ((bitField0_ & 0x00000001) != 0), + ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); trueMutations_ = null; @@ -1956,9 +2183,9 @@ 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; } } @@ -2217,7 +2444,7 @@ public Builder addAllFalseMutations( public Builder clearFalseMutations() { if (falseMutationsBuilder_ == null) { falseMutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { falseMutationsBuilder_.clear(); @@ -2367,7 +2594,7 @@ public java.util.List getFalseMutations com.google.bigtable.v2.Mutation.Builder, com.google.bigtable.v2.MutationOrBuilder>( falseMutations_, - ((bitField0_ & 0x00000002) != 0), + ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); falseMutations_ = null; @@ -2407,7 +2634,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..2f25b7ef07 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface CheckAndMutateRowRequestOrBuilder @@ -27,14 +28,15 @@ 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. @@ -44,20 +46,58 @@ 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 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(); + /** * * @@ -89,7 +129,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]; 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..dd037aa6b7 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,53 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new CheckAndMutateRowResponse(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_CheckAndMutateRowResponse_descriptor; @@ -108,7 +62,7 @@ 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 +97,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 +109,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 +126,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 +139,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; } @@ -314,24 +268,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) { 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,11 +306,20 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.CheckAndMutateRowResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.predicateMatched_ = predicateMatched_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -413,7 +369,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,20 +384,42 @@ 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_; /** * @@ -475,6 +453,7 @@ public boolean getPredicateMatched() { public Builder setPredicateMatched(boolean value) { predicateMatched_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -491,7 +470,7 @@ public Builder setPredicateMatched(boolean value) { * @return This builder for chaining. */ public Builder clearPredicateMatched() { - + bitField0_ = (bitField0_ & ~0x00000001); predicateMatched_ = false; onChanged(); return this; @@ -529,7 +508,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..9ae91ce6f4 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface CheckAndMutateRowResponseOrBuilder 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..a45e04f08d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -49,67 +50,6 @@ 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; } @@ -124,7 +64,7 @@ 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,6 +86,8 @@ public com.google.protobuf.ByteString getQualifier() { } public static final int CELLS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List cells_; /** * @@ -233,7 +175,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 +190,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 +207,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 +224,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; } @@ -409,32 +351,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) { 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,19 +394,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; + } + + private void buildPartial0(com.google.bigtable.v2.Column result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.qualifier_ = qualifier_; + } } @java.lang.Override @@ -527,7 +473,7 @@ public Builder mergeFrom(com.google.bigtable.v2.Column other) { if (!other.cells_.isEmpty()) { if (cells_.isEmpty()) { cells_ = other.cells_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureCellsIsMutable(); cells_.addAll(other.cells_); @@ -540,7 +486,7 @@ 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() @@ -550,7 +496,7 @@ public Builder mergeFrom(com.google.bigtable.v2.Column other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -565,17 +511,49 @@ 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; } @@ -621,8 +599,8 @@ public Builder setQualifier(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - qualifier_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -642,7 +620,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,9 +629,9 @@ 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; } } @@ -865,7 +843,7 @@ public Builder addAllCells(java.lang.Iterable getCellsBuilderList() 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_; @@ -1022,7 +1000,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..29e831f18d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadata.java @@ -0,0 +1,892 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Describes a column in a Bigtable Query Language result set.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ColumnMetadata} + */ +public final class ColumnMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ColumnMetadata) + ColumnMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ColumnMetadata.newBuilder() to construct. + private ColumnMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ColumnMetadata() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ColumnMetadata(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ColumnMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @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 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.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(getTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + @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.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..d346311a97 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ColumnMetadataOrBuilder.java @@ -0,0 +1,86 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..318d5e492b 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ColumnOrBuilder 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 e859f2472d..648bf8f502 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -50,79 +51,6 @@ 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; @@ -139,6 +67,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int startQualifierCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object startQualifier_; public enum StartQualifierCase @@ -186,6 +116,8 @@ public StartQualifierCase getStartQualifierCase() { } private int endQualifierCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object endQualifier_; public enum EndQualifierCase @@ -233,7 +165,9 @@ 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_ = ""; /** * * @@ -450,7 +384,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 @@ -482,7 +416,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 +454,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 +491,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -688,24 +622,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) { 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,23 +663,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 (bitField0_ != 0) { + buildPartial0(result); } - if (endQualifierCase_ == 4) { - result.endQualifier_ = endQualifier_; - } - if (endQualifierCase_ == 5) { - result.endQualifier_ = endQualifier_; + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.ColumnRange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; } + } + + private void buildPartialOneofs(com.google.bigtable.v2.ColumnRange result) { result.startQualifierCase_ = startQualifierCase_; + result.startQualifier_ = this.startQualifier_; result.endQualifierCase_ = endQualifierCase_; - onBuilt(); - return result; + result.endQualifier_ = this.endQualifier_; } @java.lang.Override @@ -802,6 +732,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 +767,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ColumnRange other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -851,17 +782,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,6 +868,8 @@ public Builder clearEndQualifier() { return this; } + private int bitField0_; + private java.lang.Object familyName_ = ""; /** * @@ -954,8 +931,8 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -971,8 +948,8 @@ 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 +970,8 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1319,7 +1296,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..de4e3fc569 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ColumnRangeOrBuilder @@ -148,7 +149,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..f85cec56ab 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public final class DataProto { @@ -43,6 +44,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_Cell_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -87,6 +96,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_Mutation_SetCell_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 @@ -103,6 +120,46 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_v2_ReadModifyWriteRule_descriptor; static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_PartialResultSet_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -113,85 +170,135 @@ 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" + + "bigtable.v2\032\037google/api/field_behavior.p" + + "roto\032\036google/bigtable/v2/types.proto\032\037go" + + "ogle/protobuf/timestamp.proto\032\026google/ty" + + "pe/date.proto\"@\n\003Row\022\013\n\003key\030\001 \001(\014\022,\n\010fam" + + "ilies\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(\013" + + "2\032.google.bigtable.v2.Column\"D\n\006Column\022\021" + + "\n\tqualifier\030\001 \001(\014\022\'\n\005cells\030\002 \003(\0132\030.googl" + + "e.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.big" + + "table.v2.Type\022\023\n\traw_value\030\010 \001(\014H\000\022\036\n\024ra" + + "w_timestamp_micros\030\t \001(\003H\000\022\025\n\013bytes_valu" + + "e\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\nbool_value\030\n \001(\010H\000\022\025\n\013" + + "float_value\030\013 \001(\001H\000\0225\n\017timestamp_value\030\014" + + " \001(\0132\032.google.protobuf.TimestampH\000\022\'\n\nda" + + "te_value\030\r \001(\0132\021.google.type.DateH\000\0225\n\013a" + + "rray_value\030\004 \001(\0132\036.google.bigtable.v2.Ar" + + "rayValueH\000B\006\n\004kind\"7\n\nArrayValue\022)\n\006valu" + + "es\030\001 \003(\0132\031.google.bigtable.v2.Value\"\212\001\n\010" + + "RowRange\022\032\n\020start_key_closed\030\001 \001(\014H\000\022\030\n\016" + + "start_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\tstar" + + "t_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.bigtab" + + "le.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_qua" + + "lifier_open\030\005 \001(\014H\001B\021\n\017start_qualifierB\017" + + "\n\rend_qualifier\"N\n\016TimestampRange\022\036\n\026sta" + + "rt_timestamp_micros\030\001 \001(\003\022\034\n\024end_timesta" + + "mp_micros\030\002 \001(\003\"\230\001\n\nValueRange\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\016" + + "end_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\ninterleave\030\002 \001(\0132(.google.bigtable.v2." + + "RowFilter.InterleaveH\000\022<\n\tcondition\030\003 \001(" + + "\0132\'.google.bigtable.v2.RowFilter.Conditi" + + "onH\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\024r" + + "ow_key_regex_filter\030\004 \001(\014H\000\022\033\n\021row_sampl" + + "e_filter\030\016 \001(\001H\000\022\"\n\030family_name_regex_fi" + + "lter\030\005 \001(\tH\000\022\'\n\035column_qualifier_regex_f" + + "ilter\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.b" + + "igtable.v2.TimestampRangeH\000\022\034\n\022value_reg" + + "ex_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\035" + + "cells_per_column_limit_filter\030\014 \001(\005H\000\022!\n" + + "\027strip_value_transformer\030\r \001(\010H\000\022!\n\027appl" + + "y_label_transformer\030\023 \001(\tH\000\0327\n\005Chain\022.\n\007" + + "filters\030\001 \003(\0132\035.google.bigtable.v2.RowFi" + + "lter\032<\n\nInterleave\022.\n\007filters\030\001 \003(\0132\035.go" + + "ogle.bigtable.v2.RowFilter\032\255\001\n\tCondition" + + "\0227\n\020predicate_filter\030\001 \001(\0132\035.google.bigt" + + "able.v2.RowFilter\0222\n\013true_filter\030\002 \001(\0132\035" + + ".google.bigtable.v2.RowFilter\0223\n\014false_f" + + "ilter\030\003 \001(\0132\035.google.bigtable.v2.RowFilt" + + "erB\010\n\006filter\"\255\010\n\010Mutation\0228\n\010set_cell\030\001 " + + "\001(\0132$.google.bigtable.v2.Mutation.SetCel" + + "lH\000\022=\n\013add_to_cell\030\005 \001(\0132&.google.bigtab" + + "le.v2.Mutation.AddToCellH\000\022A\n\rmerge_to_c" + + "ell\030\006 \001(\0132(.google.bigtable.v2.Mutation." + + "MergeToCellH\000\022K\n\022delete_from_column\030\002 \001(" + + "\0132-.google.bigtable.v2.Mutation.DeleteFr" + + "omColumnH\000\022K\n\022delete_from_family\030\003 \001(\0132-" + + ".google.bigtable.v2.Mutation.DeleteFromF" + + "amilyH\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\013famil" + + "y_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\013Me" + + "rgeToCell\022\023\n\013family_name\030\001 \001(\t\0223\n\020column" + + "_qualifier\030\002 \001(\0132\031.google.bigtable.v2.Va" + + "lue\022,\n\ttimestamp\030\003 \001(\0132\031.google.bigtable" + + ".v2.Value\022(\n\005input\030\004 \001(\0132\031.google.bigtab" + + "le.v2.Value\032y\n\020DeleteFromColumn\022\023\n\013famil" + + "y_name\030\001 \001(\t\022\030\n\020column_qualifier\030\002 \001(\014\0226" + + "\n\ntime_range\030\003 \001(\0132\".google.bigtable.v2." + + "TimestampRange\032\'\n\020DeleteFromFamily\022\023\n\013fa" + + "mily_name\030\001 \001(\t\032\017\n\rDeleteFromRowB\n\n\010muta" + + "tion\"\200\001\n\023ReadModifyWriteRule\022\023\n\013family_n" + + "ame\030\001 \001(\t\022\030\n\020column_qualifier\030\002 \001(\014\022\026\n\014a" + + "ppend_value\030\003 \001(\014H\000\022\032\n\020increment_amount\030" + + "\004 \001(\003H\000B\006\n\004rule\"B\n\017StreamPartition\022/\n\tro" + + "w_range\030\001 \001(\0132\034.google.bigtable.v2.RowRa" + + "nge\"W\n\030StreamContinuationTokens\022;\n\006token" + + "s\030\001 \003(\0132+.google.bigtable.v2.StreamConti" + + "nuationToken\"`\n\027StreamContinuationToken\022" + + "6\n\tpartition\030\001 \001(\0132#.google.bigtable.v2." + + "StreamPartition\022\r\n\005token\030\002 \001(\t\"\r\n\013ProtoF" + + "ormat\"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.b" + + "igtable.v2.ColumnMetadata\"V\n\021ResultSetMe" + + "tadata\0227\n\014proto_schema\030\001 \001(\0132\037.google.bi" + + "gtable.v2.ProtoSchemaH\000B\010\n\006schema\"6\n\tPro" + + "toRows\022)\n\006values\030\002 \003(\0132\031.google.bigtable" + + ".v2.Value\"$\n\016ProtoRowsBatch\022\022\n\nbatch_dat" + + "a\030\001 \001(\014\"\226\001\n\020PartialResultSet\022>\n\020proto_ro" + + "ws_batch\030\003 \001(\0132\".google.bigtable.v2.Prot" + + "oRowsBatchH\000\022\024\n\014resume_token\030\005 \001(\014\022\034\n\024es" + + "timated_batch_size\030\004 \001(\005B\016\n\014partial_rows" + + "B\263\001\n\026com.google.bigtable.v2B\tDataProtoP\001" + + "Z8cloud.google.com/go/bigtable/apiv2/big" + + "tablepb;bigtablepb\252\002\030Google.Cloud.Bigtab" + + "le.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033Googl" + + "e::Cloud::Bigtable::V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + 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().getMessageTypes().get(0); internal_static_google_bigtable_v2_Row_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( @@ -220,15 +327,41 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "TimestampMicros", "Value", "Labels", }); + internal_static_google_bigtable_v2_Value_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_google_bigtable_v2_Value_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(5); + internal_static_google_bigtable_v2_ArrayValue_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ArrayValue_descriptor, + new java.lang.String[] { + "Values", + }); internal_static_google_bigtable_v2_RowRange_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(6); internal_static_google_bigtable_v2_RowRange_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(7); internal_static_google_bigtable_v2_RowSet_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_RowSet_descriptor, @@ -236,7 +369,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "RowKeys", "RowRanges", }); internal_static_google_bigtable_v2_ColumnRange_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(8); internal_static_google_bigtable_v2_ColumnRange_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_ColumnRange_descriptor, @@ -250,7 +383,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndQualifier", }); internal_static_google_bigtable_v2_TimestampRange_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(9); internal_static_google_bigtable_v2_TimestampRange_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_TimestampRange_descriptor, @@ -258,7 +391,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "StartTimestampMicros", "EndTimestampMicros", }); internal_static_google_bigtable_v2_ValueRange_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(10); internal_static_google_bigtable_v2_ValueRange_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_ValueRange_descriptor, @@ -271,7 +404,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndValue", }); internal_static_google_bigtable_v2_RowFilter_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_google_bigtable_v2_RowFilter_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_RowFilter_descriptor, @@ -322,12 +455,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PredicateFilter", "TrueFilter", "FalseFilter", }); internal_static_google_bigtable_v2_Mutation_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_google_bigtable_v2_Mutation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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); @@ -337,8 +476,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "FamilyName", "ColumnQualifier", "TimestampMicros", "Value", }); - internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor = + internal_static_google_bigtable_v2_Mutation_AddToCell_descriptor = internal_static_google_bigtable_v2_Mutation_descriptor.getNestedTypes().get(1); + internal_static_google_bigtable_v2_Mutation_AddToCell_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_v2_Mutation_MergeToCell_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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(3); internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_Mutation_DeleteFromColumn_descriptor, @@ -346,7 +501,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "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.getNestedTypes().get(4); internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_v2_Mutation_DeleteFromFamily_descriptor, @@ -354,19 +509,100 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "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.getNestedTypes().get(5); internal_static_google_bigtable_v2_Mutation_DeleteFromRow_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(13); internal_static_google_bigtable_v2_ReadModifyWriteRule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.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().getMessageTypes().get(14); + internal_static_google_bigtable_v2_StreamPartition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_StreamPartition_descriptor, + new java.lang.String[] { + "RowRange", + }); + internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_bigtable_v2_StreamContinuationTokens_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_StreamContinuationTokens_descriptor, + new java.lang.String[] { + "Tokens", + }); + internal_static_google_bigtable_v2_StreamContinuationToken_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_bigtable_v2_StreamContinuationToken_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_StreamContinuationToken_descriptor, + new java.lang.String[] { + "Partition", "Token", + }); + internal_static_google_bigtable_v2_ProtoFormat_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_bigtable_v2_ProtoFormat_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoFormat_descriptor, new java.lang.String[] {}); + internal_static_google_bigtable_v2_ColumnMetadata_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_bigtable_v2_ColumnMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ColumnMetadata_descriptor, + new java.lang.String[] { + "Name", "Type", + }); + internal_static_google_bigtable_v2_ProtoSchema_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_bigtable_v2_ProtoSchema_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoSchema_descriptor, + new java.lang.String[] { + "Columns", + }); + internal_static_google_bigtable_v2_ResultSetMetadata_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_bigtable_v2_ResultSetMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ResultSetMetadata_descriptor, + new java.lang.String[] { + "ProtoSchema", "Schema", + }); + internal_static_google_bigtable_v2_ProtoRows_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_bigtable_v2_ProtoRows_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoRows_descriptor, + new java.lang.String[] { + "Values", + }); + internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_bigtable_v2_ProtoRowsBatch_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ProtoRowsBatch_descriptor, + new java.lang.String[] { + "BatchData", + }); + internal_static_google_bigtable_v2_PartialResultSet_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_bigtable_v2_PartialResultSet_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_PartialResultSet_descriptor, + new java.lang.String[] { + "ProtoRowsBatch", "ResumeToken", "EstimatedBatchSize", "PartialRows", + }); + 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..648cb50743 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequest.java @@ -0,0 +1,2172 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Request message for Bigtable.ExecuteQuery
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ExecuteQueryRequest} + */ +public final class ExecuteQueryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ExecuteQueryRequest) + ExecuteQueryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecuteQueryRequest.newBuilder() to construct. + private ExecuteQueryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExecuteQueryRequest() { + instanceName_ = ""; + appProfileId_ = ""; + query_ = ""; + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExecuteQueryRequest(); + } + + 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.GeneratedMessageV3.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 { + 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.
    +   * 
    + * + * 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 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.GeneratedMessageV3.isStringEmpty(instanceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, query_); + } + if (dataFormatCase_ == 4) { + output.writeMessage(4, (com.google.bigtable.v2.ProtoFormat) dataFormat_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetParams(), ParamsDefaultEntryHolder.defaultEntry, 7); + if (!resumeToken_.isEmpty()) { + output.writeBytes(8, resumeToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instanceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, instanceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appProfileId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!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) + 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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + instanceName_ = ""; + appProfileId_ = ""; + query_ = ""; + 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_ & 0x00000010) != 0)) { + result.resumeToken_ = resumeToken_; + } + if (((from_bitField0_ & 0x00000020) != 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 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.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.getResumeToken() != com.google.protobuf.ByteString.EMPTY) { + setResumeToken(other.getResumeToken()); + } + internalGetMutableParams().mergeFrom(other.internalGetParams()); + bitField0_ |= 0x00000020; + 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(getProtoFormatFieldBuilder().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_ |= 0x00000020; + break; + } // case 58 + case 66: + { + resumeToken_ = input.readBytes(); + bitField0_ |= 0x00000010; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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.
    +     * 
    + * + * 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.SingleFieldBuilderV3< + 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 getProtoFormatFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ProtoFormat, + com.google.bigtable.v2.ProtoFormat.Builder, + com.google.bigtable.v2.ProtoFormatOrBuilder> + getProtoFormatFieldBuilder() { + if (protoFormatBuilder_ == null) { + if (!(dataFormatCase_ == 4)) { + dataFormat_ = com.google.bigtable.v2.ProtoFormat.getDefaultInstance(); + } + protoFormatBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_ |= 0x00000010; + 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_ & ~0x00000010); + 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_ |= 0x00000020; + 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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_ & ~0x00000020); + 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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_ |= 0x00000020; + 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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_ |= 0x00000020; + 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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_ |= 0x00000020; + 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.
    +     *
    +     * In case of Value.kind is not set, it will be set to corresponding null
    +     * value in googlesql.
    +     *  `params["firstName"] =  type {string_type {}}`
    +     *  then `@firstName` will be replaced with googlesql null string.
    +     *
    +     * Value.type should always be set and no inference of type will be made from
    +     * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +     * error.
    +     * 
    + * + * + * 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; + } + + @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.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..58928d7d7f --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryRequestOrBuilder.java @@ -0,0 +1,328 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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.
    +   * 
    + * + * 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(); + + /** + * + * + *
    +   * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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.
    +   *
    +   * In case of Value.kind is not set, it will be set to corresponding null
    +   * value in googlesql.
    +   *  `params["firstName"] =  type {string_type {}}`
    +   *  then `@firstName` will be replaced with googlesql null string.
    +   *
    +   * Value.type should always be set and no inference of type will be made from
    +   * Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT
    +   * error.
    +   * 
    + * + * + * 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..9775cb2971 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponse.java @@ -0,0 +1,1145 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Response message for Bigtable.ExecuteQuery
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ExecuteQueryResponse} + */ +public final class ExecuteQueryResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ExecuteQueryResponse) + ExecuteQueryResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecuteQueryResponse.newBuilder() to construct. + private ExecuteQueryResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExecuteQueryResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ExecuteQueryResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getMetadataFieldBuilder().getBuilder(), extensionRegistry); + responseCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getResultsFieldBuilder().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.SingleFieldBuilderV3< + 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 getMetadataFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ResultSetMetadata, + com.google.bigtable.v2.ResultSetMetadata.Builder, + com.google.bigtable.v2.ResultSetMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + if (!(responseCase_ == 1)) { + response_ = com.google.bigtable.v2.ResultSetMetadata.getDefaultInstance(); + } + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getResultsFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.PartialResultSet, + com.google.bigtable.v2.PartialResultSet.Builder, + com.google.bigtable.v2.PartialResultSetOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + if (!(responseCase_ == 2)) { + response_ = com.google.bigtable.v2.PartialResultSet.getDefaultInstance(); + } + resultsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..ab711f3d31 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ExecuteQueryResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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 d39f7e5ae0..4dbf1eee9d 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -49,69 +50,6 @@ 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; } @@ -126,7 +64,9 @@ 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_ = ""; /** * * @@ -185,6 +125,8 @@ public com.google.protobuf.ByteString getNameBytes() { } public static final int COLUMNS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List columns_; /** * @@ -273,7 +215,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < columns_.size(); i++) { output.writeMessage(2, columns_.get(i)); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -288,7 +230,7 @@ public int getSerializedSize() { 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 +247,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 +264,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; } @@ -449,32 +391,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) { 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,19 +434,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; + } + + 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 +508,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,7 +528,7 @@ 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() @@ -591,7 +538,7 @@ public Builder mergeFrom(com.google.bigtable.v2.Family other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -606,17 +553,49 @@ 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; } @@ -698,8 +677,8 @@ public Builder setName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -720,8 +699,8 @@ 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 +726,8 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - name_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -757,9 +736,9 @@ 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; } } @@ -972,7 +951,7 @@ public Builder addAllColumns( public Builder clearColumns() { if (columnsBuilder_ == null) { columns_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { columnsBuilder_.clear(); @@ -1093,7 +1072,7 @@ public java.util.List getColumnsBuilderLi 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_; @@ -1131,7 +1110,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..eabf0f5dd6 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface FamilyOrBuilder 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..4d18dd4c1d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlags.java @@ -0,0 +1,1135 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/feature_flags.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class FeatureFlags extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.FeatureFlags) + FeatureFlagsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FeatureFlags.newBuilder() to construct. + private FeatureFlags(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FeatureFlags() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!getUnknownFields().equals(other.getUnknownFields())) 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 = (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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.FeatureFlags parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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; + 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_; + } + } + + @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.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()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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; + } + + @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.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..2a61edabdb --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/feature_flags.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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(); +} 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..e5875d27ee --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FeatureFlagsProto.java @@ -0,0 +1,77 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/feature_flags.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public final class FeatureFlagsProto { + private 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.GeneratedMessageV3.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\"\333\001\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" + + "(\010B\273\001\n\026com.google.bigtable.v2B\021FeatureFl" + + "agsProtoP\001Z8cloud.google.com/go/bigtable" + + "/apiv2/bigtablepb;bigtablepb\252\002\030Google.Cl" + + "oud.Bigtable.V2\312\002\030Google\\Cloud\\Bigtable\\" + + "V2\352\002\033Google::Cloud::Bigtable::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_bigtable_v2_FeatureFlags_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_bigtable_v2_FeatureFlags_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_FeatureFlags_descriptor, + new java.lang.String[] { + "ReverseScans", + "MutateRowsRateLimit", + "MutateRowsRateLimit2", + "LastScannedRowResponses", + "RoutingCookie", + "RetryInfo", + "ClientSideMetricsEnabled", + }); + } + + // @@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..abb086df46 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsView.java @@ -0,0 +1,1047 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * FullReadStatsView captures all known information about a read.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.FullReadStatsView} + */ +public final class FullReadStatsView extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.FullReadStatsView) + FullReadStatsViewOrBuilder { + private static final long serialVersionUID = 0L; + // Use FullReadStatsView.newBuilder() to construct. + private FullReadStatsView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FullReadStatsView() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.FullReadStatsView parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReadIterationStatsFieldBuilder(); + getRequestLatencyStatsFieldBuilder(); + } + } + + @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 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.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( + getReadIterationStatsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getRequestLatencyStatsFieldBuilder().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.SingleFieldBuilderV3< + 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 getReadIterationStatsFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ReadIterationStats, + com.google.bigtable.v2.ReadIterationStats.Builder, + com.google.bigtable.v2.ReadIterationStatsOrBuilder> + getReadIterationStatsFieldBuilder() { + if (readIterationStatsBuilder_ == null) { + readIterationStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getRequestLatencyStatsFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.RequestLatencyStats, + com.google.bigtable.v2.RequestLatencyStats.Builder, + com.google.bigtable.v2.RequestLatencyStatsOrBuilder> + getRequestLatencyStatsFieldBuilder() { + if (requestLatencyStatsBuilder_ == null) { + requestLatencyStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RequestLatencyStats, + com.google.bigtable.v2.RequestLatencyStats.Builder, + com.google.bigtable.v2.RequestLatencyStatsOrBuilder>( + getRequestLatencyStats(), getParentForChildren(), isClean()); + requestLatencyStats_ = null; + } + return requestLatencyStatsBuilder_; + } + + @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.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..b47036bad6 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/FullReadStatsViewOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..4063631006 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequest.java @@ -0,0 +1,875 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class GenerateInitialChangeStreamPartitionsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest) + GenerateInitialChangeStreamPartitionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateInitialChangeStreamPartitionsRequest.newBuilder() to construct. + private GenerateInitialChangeStreamPartitionsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateInitialChangeStreamPartitionsRequest() { + tableName_ = ""; + appProfileId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateInitialChangeStreamPartitionsRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..1753724f29 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..0d25a80f54 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponse.java @@ -0,0 +1,740 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class GenerateInitialChangeStreamPartitionsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) + GenerateInitialChangeStreamPartitionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateInitialChangeStreamPartitionsResponse.newBuilder() to construct. + private GenerateInitialChangeStreamPartitionsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateInitialChangeStreamPartitionsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPartitionFieldBuilder(); + } + } + + @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 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.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(getPartitionFieldBuilder().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.SingleFieldBuilderV3< + 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 getPartitionFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + getPartitionFieldBuilder() { + if (partitionBuilder_ == null) { + partitionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder>( + getPartition(), getParentForChildren(), isClean()); + partition_ = null; + } + return partitionBuilder_; + } + + @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.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..1bc0178d7d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/GenerateInitialChangeStreamPartitionsResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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/InstanceName.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java new file mode 100644 index 0000000000..cc4f7e627b --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/InstanceName.java @@ -0,0 +1,192 @@ +/* + * 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.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/MutateRowRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/MutateRowRequest.java index dbf266c82c..6574b7a2c2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,6 +40,7 @@ private MutateRowRequest(com.google.protobuf.GeneratedMessageV3.Builder build private MutateRowRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; rowKey_ = com.google.protobuf.ByteString.EMPTY; mutations_ = java.util.Collections.emptyList(); @@ -50,81 +52,6 @@ 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; @@ -141,18 +68,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 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. @@ -173,13 +104,15 @@ public 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. @@ -197,8 +130,73 @@ 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_ = ""; /** * * @@ -249,7 +247,7 @@ 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 +265,16 @@ 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.
        * 
    * * @@ -289,9 +289,9 @@ public 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.
        * 
    * * @@ -307,9 +307,9 @@ public 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.
        * 
    * * @@ -324,9 +324,9 @@ public 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.
        * 
    * * @@ -341,9 +341,9 @@ public 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.
        * 
    * * @@ -381,7 +381,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, appProfileId_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, authorizedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -402,7 +405,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -418,10 +424,11 @@ 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -434,6 +441,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 +451,7 @@ public int hashCode() { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -571,36 +580,27 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.MutateRowRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMutationsFieldBuilder(); - } } @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); return this; } @@ -628,21 +628,40 @@ 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; + } + + 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_; + } } @java.lang.Override @@ -692,10 +711,17 @@ 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) { @@ -705,7 +731,7 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowRequest other) { if (!other.mutations_.isEmpty()) { if (mutations_.isEmpty()) { mutations_ = other.mutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureMutationsIsMutable(); mutations_.addAll(other.mutations_); @@ -718,7 +744,7 @@ 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() @@ -728,7 +754,7 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowRequest other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -743,17 +769,67 @@ 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 + default: + { + 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; } @@ -764,13 +840,15 @@ public Builder mergeFrom( * * *
    -     * 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. @@ -790,13 +868,15 @@ public 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. @@ -816,13 +896,15 @@ public com.google.protobuf.ByteString getTableNameBytes() { * * *
    -     * 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,8 +914,8 @@ public Builder setTableName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -841,20 +923,22 @@ public Builder setTableName(java.lang.String value) { * * *
    -     * 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; } @@ -862,13 +946,15 @@ public Builder clearTableName() { * * *
    -     * 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,8 +965,144 @@ 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; } @@ -949,8 +1171,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -967,8 +1189,8 @@ 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,8 +1212,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1028,8 +1250,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1045,7 +1267,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,9 +1277,9 @@ 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; } } @@ -1071,9 +1293,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.
          * 
    * * @@ -1091,9 +1313,9 @@ public 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.
          * 
    * * @@ -1111,9 +1333,9 @@ public 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.
          * 
    * * @@ -1131,9 +1353,9 @@ public 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.
          * 
    * * @@ -1157,9 +1379,9 @@ public Builder setMutations(int index, com.google.bigtable.v2.Mutation value) { * * *
    -     * 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.
          * 
    * * @@ -1181,9 +1403,9 @@ public Builder setMutations( * * *
    -     * 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.
          * 
    * * @@ -1207,9 +1429,9 @@ public Builder addMutations(com.google.bigtable.v2.Mutation value) { * * *
    -     * 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.
          * 
    * * @@ -1233,9 +1455,9 @@ public Builder addMutations(int index, com.google.bigtable.v2.Mutation value) { * * *
    -     * 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.
          * 
    * * @@ -1256,9 +1478,9 @@ public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForVa * * *
    -     * 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.
          * 
    * * @@ -1280,9 +1502,9 @@ public Builder addMutations( * * *
    -     * 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.
          * 
    * * @@ -1304,9 +1526,9 @@ public Builder addAllMutations( * * *
    -     * 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,7 +1538,7 @@ public Builder addAllMutations( public Builder clearMutations() { if (mutationsBuilder_ == null) { mutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { mutationsBuilder_.clear(); @@ -1327,9 +1549,9 @@ public Builder clearMutations() { * * *
    -     * 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.
          * 
    * * @@ -1350,9 +1572,9 @@ public Builder removeMutations(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.
          * 
    * * @@ -1366,9 +1588,9 @@ public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(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.
          * 
    * * @@ -1386,9 +1608,9 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(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.
          * 
    * * @@ -1407,9 +1629,9 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(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.
          * 
    * * @@ -1424,9 +1646,9 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { * * *
    -     * 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.
          * 
    * * @@ -1441,9 +1663,9 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(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.
          * 
    * * @@ -1465,7 +1687,7 @@ public java.util.List getMutationsBuild 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_; @@ -1503,7 +1725,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..7b78573247 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface MutateRowRequestOrBuilder @@ -27,13 +28,15 @@ 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. @@ -43,19 +46,58 @@ 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 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(); + /** * * @@ -100,9 +142,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.
        * 
    * * @@ -114,9 +156,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.
        * 
    * * @@ -128,9 +170,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.
        * 
    * * @@ -142,9 +184,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.
        * 
    * * @@ -156,9 +198,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.
        * 
    * * 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..01386b7fe8 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,48 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new MutateRowResponse(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowResponse_descriptor; @@ -116,7 +75,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 +84,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -140,7 +99,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 +110,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; } @@ -280,17 +239,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) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -372,7 +324,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,17 +339,31 @@ 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; } @@ -433,7 +399,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..813b703e26 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface MutateRowResponseOrBuilder 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 b6c3554b35..412d8a5337 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,6 +40,7 @@ private MutateRowsRequest(com.google.protobuf.GeneratedMessageV3.Builder buil private MutateRowsRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; entries_ = java.util.Collections.emptyList(); } @@ -49,78 +51,6 @@ 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; @@ -158,10 +88,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.
          * 
    * * @@ -173,10 +102,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.
          * 
    * * @@ -188,10 +116,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.
          * 
    * * @@ -203,10 +130,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.
          * 
    * * @@ -218,10 +144,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.
          * 
    * * @@ -260,67 +185,6 @@ 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; @@ -337,7 +201,7 @@ 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; /** * * @@ -355,15 +219,16 @@ 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.
          * 
    * * @@ -378,10 +243,9 @@ public 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.
          * 
    * * @@ -397,10 +261,9 @@ public 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.
          * 
    * * @@ -415,10 +278,9 @@ public 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.
          * 
    * * @@ -433,10 +295,9 @@ public 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.
          * 
    * * @@ -468,7 +329,7 @@ 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); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -483,7 +344,7 @@ public int getSerializedSize() { for (int i = 0; i < mutations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, mutations_.get(i)); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -501,7 +362,7 @@ 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 (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -518,7 +379,7 @@ public int hashCode() { hash = (37 * hash) + MUTATIONS_FIELD_NUMBER; hash = (53 * hash) + getMutationsList().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -649,32 +510,24 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } // Construct using com.google.bigtable.v2.MutateRowsRequest.Entry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getMutationsFieldBuilder(); - } } @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); return this; } @@ -702,19 +555,32 @@ 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; + } + + private void buildPartial0(com.google.bigtable.v2.MutateRowsRequest.Entry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowKey_ = rowKey_; + } } @java.lang.Override @@ -772,7 +638,7 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest.Entry other) { if (!other.mutations_.isEmpty()) { if (mutations_.isEmpty()) { mutations_ = other.mutations_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureMutationsIsMutable(); mutations_.addAll(other.mutations_); @@ -785,7 +651,7 @@ 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() @@ -795,7 +661,7 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest.Entry other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -810,17 +676,50 @@ 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 + default: + { + 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; } @@ -858,8 +757,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -875,7 +774,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,9 +784,9 @@ 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; } } @@ -901,10 +800,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.
            * 
    * * @@ -922,10 +820,9 @@ public 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.
            * 
    * * @@ -943,10 +840,9 @@ public 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.
            * 
    * * @@ -964,10 +860,9 @@ public 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.
            * 
    * * @@ -991,10 +886,9 @@ public Builder setMutations(int index, com.google.bigtable.v2.Mutation value) { * * *
    -       * 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.
            * 
    * * @@ -1016,10 +910,9 @@ public Builder setMutations( * * *
    -       * 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.
            * 
    * * @@ -1043,10 +936,9 @@ public Builder addMutations(com.google.bigtable.v2.Mutation value) { * * *
    -       * 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.
            * 
    * * @@ -1070,10 +962,9 @@ public Builder addMutations(int index, com.google.bigtable.v2.Mutation value) { * * *
    -       * 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.
            * 
    * * @@ -1094,10 +985,9 @@ public Builder addMutations(com.google.bigtable.v2.Mutation.Builder builderForVa * * *
    -       * 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.
            * 
    * * @@ -1119,10 +1009,9 @@ public Builder addMutations( * * *
    -       * 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.
            * 
    * * @@ -1144,10 +1033,9 @@ public Builder addAllMutations( * * *
    -       * 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,7 +1045,7 @@ public Builder addAllMutations( public Builder clearMutations() { if (mutationsBuilder_ == null) { mutations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { mutationsBuilder_.clear(); @@ -1168,10 +1056,9 @@ public Builder clearMutations() { * * *
    -       * 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.
            * 
    * * @@ -1192,10 +1079,9 @@ public Builder removeMutations(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.
            * 
    * * @@ -1209,10 +1095,9 @@ public com.google.bigtable.v2.Mutation.Builder getMutationsBuilder(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.
            * 
    * * @@ -1230,10 +1115,9 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(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.
            * 
    * * @@ -1252,10 +1136,9 @@ public com.google.bigtable.v2.MutationOrBuilder getMutationsOrBuilder(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.
            * 
    * * @@ -1270,10 +1153,9 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder() { * * *
    -       * 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.
            * 
    * * @@ -1288,10 +1170,9 @@ public com.google.bigtable.v2.Mutation.Builder addMutationsBuilder(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.
            * 
    * * @@ -1313,7 +1194,7 @@ public java.util.List getMutationsBuild 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_; @@ -1352,7 +1233,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(); } }; @@ -1372,16 +1265,22 @@ public com.google.bigtable.v2.MutateRowsRequest.Entry getDefaultInstanceForType( } 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 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. @@ -1402,11 +1301,15 @@ public 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. @@ -1424,8 +1327,73 @@ public com.google.protobuf.ByteString getTableNameBytes() { } } + public static final int AUTHORIZED_VIEW_NAME_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object authorizedViewName_ = ""; + /** + * + * + *
    +   * Optional. The unique name of the AuthorizedView to which the mutations
    +   * should be applied.
    +   *
    +   * Values are of the form
    +   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +   * 
    + * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + @java.lang.Override + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } + } + /** + * + * + *
    +   * Optional. The unique name of the AuthorizedView to which the mutations
    +   * should be applied.
    +   *
    +   * Values are of the form
    +   * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +   * 
    + * + * + * string authorized_view_name = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int APP_PROFILE_ID_FIELD_NUMBER = 3; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; /** * * @@ -1476,6 +1444,8 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { } public static final int ENTRIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List entries_; /** * @@ -1597,7 +1567,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, appProfileId_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, authorizedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1615,7 +1588,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1631,9 +1607,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 +1623,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; } @@ -1781,34 +1760,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) { 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,20 +1807,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; + } + + 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 +1887,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,7 +1917,7 @@ 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() @@ -1932,7 +1927,7 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsRequest other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1947,17 +1942,62 @@ 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; } @@ -1968,11 +2008,15 @@ public Builder mergeFrom( * * *
    -     * 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. @@ -1992,11 +2036,15 @@ public 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. @@ -2016,11 +2064,15 @@ public com.google.protobuf.ByteString getTableNameBytes() { * * *
    -     * 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,8 +2082,8 @@ public Builder setTableName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2039,18 +2091,22 @@ public Builder setTableName(java.lang.String value) { * * *
    -     * 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; } @@ -2058,11 +2114,15 @@ public Builder clearTableName() { * * *
    -     * 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,8 +2133,144 @@ 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; } @@ -2143,8 +2339,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -2161,8 +2357,8 @@ 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 +2380,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -2194,10 +2390,10 @@ 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; } } @@ -2479,7 +2675,7 @@ public Builder addAllEntries( public Builder clearEntries() { if (entriesBuilder_ == null) { entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); } else { entriesBuilder_.clear(); @@ -2643,7 +2839,7 @@ public com.google.bigtable.v2.MutateRowsRequest.Entry.Builder addEntriesBuilder( 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_; @@ -2681,7 +2877,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..a57537d453 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface MutateRowsRequestOrBuilder @@ -27,11 +28,15 @@ 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. @@ -41,17 +46,58 @@ 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 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(); + /** * * 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..7f782ed0d8 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -47,64 +48,6 @@ 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; @@ -210,67 +153,6 @@ 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(); - } - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_MutateRowsResponse_Entry_descriptor; @@ -286,8 +168,9 @@ 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; /** * * @@ -323,7 +206,7 @@ public long getIndex() { */ @java.lang.Override public boolean hasStatus() { - return status_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -357,7 +240,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 +260,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 +275,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 +299,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 +316,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; } @@ -574,18 +457,19 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusFieldBuilder(); + } } @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,16 +499,26 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.MutateRowsResponse.Entry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.index_ = index_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -679,7 +573,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,21 +588,48 @@ 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(getStatusFieldBuilder().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_; /** * @@ -742,6 +663,7 @@ public long getIndex() { public Builder setIndex(long value) { index_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -758,7 +680,7 @@ public Builder setIndex(long value) { * @return This builder for chaining. */ public Builder clearIndex() { - + bitField0_ = (bitField0_ & ~0x00000001); index_ = 0L; onChanged(); return this; @@ -783,7 +705,7 @@ public Builder clearIndex() { * @return Whether the status field is set. */ public boolean hasStatus() { - return statusBuilder_ != null || status_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -824,11 +746,11 @@ public Builder setStatus(com.google.rpc.Status value) { throw new NullPointerException(); } status_ = value; - onChanged(); } else { statusBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -846,11 +768,11 @@ 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,16 +789,20 @@ 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,14 +818,13 @@ 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,7 +840,7 @@ public Builder clearStatus() { * .google.rpc.Status status = 2; */ public com.google.rpc.Status.Builder getStatusBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getStatusFieldBuilder().getBuilder(); } @@ -997,7 +922,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,7 +953,10 @@ 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_; /** * @@ -1085,6 +1025,62 @@ 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 +1098,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 +1113,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 +1133,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 +1152,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; } @@ -1287,18 +1297,26 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getEntriesFieldBuilder(); + getRateLimitInfoFieldBuilder(); } } @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 +1344,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,8 +1362,17 @@ public com.google.bigtable.v2.MutateRowsResponse buildPartial() { } else { result.entries_ = entriesBuilder_.build(); } - onBuilt(); - return result; + } + + 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 @@ -1412,7 +1447,10 @@ public Builder mergeFrom(com.google.bigtable.v2.MutateRowsResponse other) { } } } - this.mergeUnknownFields(other.unknownFields); + if (other.hasRateLimitInfo()) { + mergeRateLimitInfo(other.getRateLimitInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1427,17 +1465,51 @@ 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(getRateLimitInfoFieldBuilder().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; } @@ -1794,6 +1866,209 @@ public com.google.bigtable.v2.MutateRowsResponse.Entry.Builder addEntriesBuilder return entriesBuilder_; } + private com.google.bigtable.v2.RateLimitInfo rateLimitInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RateLimitInfo, + com.google.bigtable.v2.RateLimitInfo.Builder, + com.google.bigtable.v2.RateLimitInfoOrBuilder> + rateLimitInfoBuilder_; + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return Whether the rateLimitInfo field is set. + */ + public boolean hasRateLimitInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + * + * @return The rateLimitInfo. + */ + public com.google.bigtable.v2.RateLimitInfo getRateLimitInfo() { + if (rateLimitInfoBuilder_ == null) { + return rateLimitInfo_ == null + ? com.google.bigtable.v2.RateLimitInfo.getDefaultInstance() + : rateLimitInfo_; + } else { + return rateLimitInfoBuilder_.getMessage(); + } + } + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder setRateLimitInfo(com.google.bigtable.v2.RateLimitInfo value) { + if (rateLimitInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rateLimitInfo_ = value; + } else { + rateLimitInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder setRateLimitInfo(com.google.bigtable.v2.RateLimitInfo.Builder builderForValue) { + if (rateLimitInfoBuilder_ == null) { + rateLimitInfo_ = builderForValue.build(); + } else { + rateLimitInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder mergeRateLimitInfo(com.google.bigtable.v2.RateLimitInfo value) { + if (rateLimitInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rateLimitInfo_ != null + && rateLimitInfo_ != com.google.bigtable.v2.RateLimitInfo.getDefaultInstance()) { + getRateLimitInfoBuilder().mergeFrom(value); + } else { + rateLimitInfo_ = value; + } + } else { + rateLimitInfoBuilder_.mergeFrom(value); + } + if (rateLimitInfo_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public Builder clearRateLimitInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + rateLimitInfo_ = null; + if (rateLimitInfoBuilder_ != null) { + rateLimitInfoBuilder_.dispose(); + rateLimitInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
    +     * Information about how client should limit the rate (QPS). Primirily used by
    +     * supported official Cloud Bigtable clients. If unset, the rate limit info is
    +     * not provided by the server.
    +     * 
    + * + * optional .google.bigtable.v2.RateLimitInfo rate_limit_info = 3; + */ + public com.google.bigtable.v2.RateLimitInfo.Builder getRateLimitInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRateLimitInfoFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.RateLimitInfo, + com.google.bigtable.v2.RateLimitInfo.Builder, + com.google.bigtable.v2.RateLimitInfoOrBuilder> + getRateLimitInfoFieldBuilder() { + if (rateLimitInfoBuilder_ == null) { + rateLimitInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RateLimitInfo, + com.google.bigtable.v2.RateLimitInfo.Builder, + com.google.bigtable.v2.RateLimitInfoOrBuilder>( + getRateLimitInfo(), getParentForChildren(), isClean()); + rateLimitInfo_ = null; + } + return rateLimitInfoBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -1826,7 +2101,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..89b0d1dc5c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface MutateRowsResponseOrBuilder @@ -74,4 +75,45 @@ 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 8ddf803098..bd1afd1252 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,115 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new Mutation(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_Mutation_descriptor; } @@ -274,70 +166,6 @@ 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; @@ -354,7 +182,9 @@ 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_ = ""; /** * * @@ -405,7 +235,7 @@ 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 +254,7 @@ public com.google.protobuf.ByteString getColumnQualifier() { } public static final int TIMESTAMP_MICROS_FIELD_NUMBER = 3; - private long timestampMicros_; + private long timestampMicros_ = 0L; /** * * @@ -446,7 +276,7 @@ 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; /** * * @@ -489,7 +319,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 @@ -510,7 +340,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 +359,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 +378,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; } @@ -679,30 +509,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) { 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,14 +550,29 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.Mutation.SetCell result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = columnQualifier_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.timestampMicros_ = timestampMicros_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.value_ = value_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -787,6 +622,7 @@ 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) { @@ -798,7 +634,7 @@ public Builder mergeFrom(com.google.bigtable.v2.Mutation.SetCell other) { if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { setValue(other.getValue()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -813,20 +649,60 @@ 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_ = ""; /** * @@ -891,8 +767,8 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -909,8 +785,8 @@ 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,8 +808,8 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -973,8 +849,8 @@ public Builder setColumnQualifier(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - columnQualifier_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -991,7 +867,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; @@ -1036,6 +912,7 @@ public long getTimestampMicros() { public Builder setTimestampMicros(long value) { timestampMicros_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1055,7 +932,7 @@ public Builder setTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000004); timestampMicros_ = 0L; onChanged(); return this; @@ -1093,8 +970,8 @@ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1110,7 +987,7 @@ 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; @@ -1149,7 +1026,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 +1057,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; @@ -1190,8 +1080,9 @@ public interface DeleteFromColumnOrBuilder * * *
    -     * 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 +1095,172 @@ 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 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 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 Whether the timeRange field is set. + * @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.GeneratedMessageV3 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) { + // Use AddToCell.newBuilder() to construct. + private AddToCell(com.google.protobuf.GeneratedMessageV3.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(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } + return new AddToCell(); } 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 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); } + 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; @@ -1395,8 +1283,9 @@ public 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; @@ -1417,77 +1306,161 @@ 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 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_ & 0x00000001) != 0); } - - 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; * - * @return Whether the timeRange field is set. + * @return The columnQualifier. */ @java.lang.Override - public boolean hasTimeRange() { - return timeRange_ != null; + public com.google.bigtable.v2.Value getColumnQualifier() { + 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; - * - * @return The timeRange. + * .google.bigtable.v2.Value column_qualifier = 2; */ @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.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 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 Whether the timestamp field is set. */ @java.lang.Override - public com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder() { - return getTimeRange(); + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; + /** + * + * + *
    +     * The timestamp of the cell to which new data should be added. This must
    +     * be a `raw_timestamp_micros` that matches the table's `granularity`.
    +     * 
    + * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getTimestamp() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + /** + * + * + *
    +     * The timestamp of the cell to which new data should be added. This must
    +     * be a `raw_timestamp_micros` that matches the table's `granularity`.
    +     * 
    + * + * .google.bigtable.v2.Value timestamp = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + + public static final int INPUT_FIELD_NUMBER = 4; + private com.google.bigtable.v2.Value input_; + /** + * + * + *
    +     * The input value to be accumulated into the specified cell. This must be
    +     * compatible with the family's `value_type.input_type`.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + @java.lang.Override + public boolean hasInput() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
    +     * The input value to be accumulated into the specified cell. This must be
    +     * compatible with the family's `value_type.input_type`.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getInput() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + /** + * + * + *
    +     * The input value to be accumulated into the specified cell. This must be
    +     * compatible with the family's `value_type.input_type`.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; @@ -1500,13 +1473,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(familyName_)) { com.google.protobuf.GeneratedMessageV3.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()); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getInput()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1518,13 +1494,16 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(familyName_)) { size += com.google.protobuf.GeneratedMessageV3.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()); } - size += unknownFields.getSerializedSize(); + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getInput()); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1534,19 +1513,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 (hasInput() != other.hasInput()) return false; + if (hasInput()) { + if (!getInput().equals(other.getInput())) return false; } - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -1559,82 +1545,88 @@ 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(); } - hash = (29 * hash) + unknownFields.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.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 { + public static com.google.bigtable.v2.Mutation.AddToCell parseFrom(java.io.InputStream input) + throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.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( 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); } - 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( 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); } - 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 { @@ -1651,7 +1643,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); } @@ -1670,33 +1662,32 @@ protected Builder newBuilderForType( * * *
    -     * 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 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 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(); } @@ -1707,21 +1698,32 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getColumnQualifierFieldBuilder(); + getTimestampFieldBuilder(); + getInputFieldBuilder(); + } } @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 +1731,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,20 +1749,38 @@ 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; } + 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 clone() { return super.clone(); @@ -1798,28 +1818,31 @@ public Builder addRepeatedField( @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()); } - this.mergeUnknownFields(other.unknownFields); + if (other.hasInput()) { + mergeInput(other.getInput()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1834,28 +1857,69 @@ 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( + getColumnQualifierFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getInputFieldBuilder().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; @@ -1877,8 +1941,9 @@ public 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; @@ -1900,8 +1965,9 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { * * *
    -       * 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,8 +1979,8 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1922,8 +1988,9 @@ public Builder setFamilyName(java.lang.String value) { * * *
    -       * 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,8 +1998,8 @@ public Builder setFamilyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFamilyName() { - familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -1940,8 +2007,9 @@ public Builder clearFamilyName() { * * *
    -       * 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,254 +2022,588 @@ 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.SingleFieldBuilderV3< + 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; - 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; - * - * @return This builder for chaining. + * .google.bigtable.v2.Value column_qualifier = 2; */ - public Builder clearColumnQualifier() { - - columnQualifier_ = getDefaultInstance().getColumnQualifier(); + 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; } - - 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; - * - * @return Whether the timeRange field is set. + * .google.bigtable.v2.Value column_qualifier = 2; */ - public boolean hasTimeRange() { - return timeRangeBuilder_ != null || timeRange_ != null; + 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 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; - * - * @return The timeRange. + * .google.bigtable.v2.Value column_qualifier = 2; */ - public com.google.bigtable.v2.TimestampRange getTimeRange() { - if (timeRangeBuilder_ == null) { - return timeRange_ == null - ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() - : timeRange_; + 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 { - return timeRangeBuilder_.getMessage(); + columnQualifierBuilder_.mergeFrom(value); + } + if (columnQualifier_ != null) { + bitField0_ |= 0x00000002; + onChanged(); } + return this; } /** * * *
    -       * 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 Builder setTimeRange(com.google.bigtable.v2.TimestampRange value) { - if (timeRangeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - timeRange_ = value; - onChanged(); - } else { - timeRangeBuilder_.setMessage(value); + public Builder clearColumnQualifier() { + bitField0_ = (bitField0_ & ~0x00000002); + columnQualifier_ = null; + if (columnQualifierBuilder_ != null) { + columnQualifierBuilder_.dispose(); + columnQualifierBuilder_ = null; } - + onChanged(); return this; } /** * * *
    -       * 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 Builder setTimeRange(com.google.bigtable.v2.TimestampRange.Builder builderForValue) { - if (timeRangeBuilder_ == null) { - timeRange_ = builderForValue.build(); - onChanged(); - } else { - timeRangeBuilder_.setMessage(builderForValue.build()); - } - + public com.google.bigtable.v2.Value.Builder getColumnQualifierBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getColumnQualifierFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getColumnQualifierFieldBuilder() { + if (columnQualifierBuilder_ == null) { + columnQualifierBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 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 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 { - timeRange_ = value; + 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 getTimestampFieldBuilder().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 { - timeRangeBuilder_.mergeFrom(value); + 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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + inputBuilder_; + /** + * + * + *
    +       * The input value to be accumulated into the specified cell. This must be
    +       * compatible with the family's `value_type.input_type`.
    +       * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + public boolean hasInput() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
    +       * The input value to be accumulated into the specified cell. This must be
    +       * compatible with the family's `value_type.input_type`.
    +       * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + public com.google.bigtable.v2.Value getInput() { + if (inputBuilder_ == null) { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } else { + return inputBuilder_.getMessage(); + } + } + /** + * + * + *
    +       * The input value to be accumulated into the specified cell. This must be
    +       * compatible with the family's `value_type.input_type`.
    +       * 
    + * + * .google.bigtable.v2.Value input = 4; + */ + public Builder setInput(com.google.bigtable.v2.Value value) { + if (inputBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + } else { + inputBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); return this; } /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value input = 4; */ - public Builder clearTimeRange() { - if (timeRangeBuilder_ == null) { - timeRange_ = null; - onChanged(); + public Builder setInput(com.google.bigtable.v2.Value.Builder builderForValue) { + if (inputBuilder_ == null) { + input_ = builderForValue.build(); } else { - timeRange_ = null; - timeRangeBuilder_ = null; + inputBuilder_.setMessage(builderForValue.build()); } - + bitField0_ |= 0x00000008; + onChanged(); return this; } /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value input = 4; */ - public com.google.bigtable.v2.TimestampRange.Builder getTimeRangeBuilder() { - + 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 getTimeRangeFieldBuilder().getBuilder(); + return this; } /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value input = 4; */ - public com.google.bigtable.v2.TimestampRangeOrBuilder getTimeRangeOrBuilder() { - if (timeRangeBuilder_ != null) { - return timeRangeBuilder_.getMessageOrBuilder(); + public com.google.bigtable.v2.Value.Builder getInputBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getInputFieldBuilder().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 timeRange_ == null - ? com.google.bigtable.v2.TimestampRange.getDefaultInstance() - : timeRange_; + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; } } /** * * *
    -       * The range of timestamps within which cells should be deleted.
    +       * 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.TimestampRange time_range = 3; + * .google.bigtable.v2.Value input = 4; */ 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_ = + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getInputFieldBuilder() { + if (inputBuilder_ == null) { + inputBuilder_ = 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; + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getInput(), getParentForChildren(), isClean()); + input_ = null; } - return timeRangeBuilder_; + return inputBuilder_; } @java.lang.Override @@ -2216,57 +2618,70 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.DeleteFromColumn) + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.Mutation.AddToCell) } - // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromColumn) - private static final com.google.bigtable.v2.Mutation.DeleteFromColumn DEFAULT_INSTANCE; + // @@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.DeleteFromColumn(); + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.AddToCell(); } - public static com.google.bigtable.v2.Mutation.DeleteFromColumn getDefaultInstance() { + 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() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public DeleteFromColumn parsePartialFrom( + public AddToCell parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteFromColumn(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.v2.Mutation.DeleteFromColumn getDefaultInstanceForType() { + 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; @@ -2278,8 +2693,9 @@ public interface DeleteFromFamilyOrBuilder * * *
    -     * 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 +2703,181 @@ public interface DeleteFromFamilyOrBuilder * @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.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromFamily) - DeleteFromFamilyOrBuilder { - private static final long serialVersionUID = 0L; - // Use DeleteFromFamily.newBuilder() to construct. - private DeleteFromFamily(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteFromFamily() { - familyName_ = ""; - } + /** + * + * + *
    +     * 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(); - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new DeleteFromFamily(); - } + /** + * + * + *
    +     * 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(); - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + /** + * + * + *
    +     * The input value to be merged into the specified cell. This must be
    +     * compatible with the family's `value_type.state_type`. Merging `NULL` is
    +     * allowed, but has no effect.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + boolean hasInput(); + /** + * + * + *
    +     * The input value to be merged into the specified cell. This must be
    +     * compatible with the family's `value_type.state_type`. Merging `NULL` is
    +     * allowed, but has no effect.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + com.google.bigtable.v2.Value getInput(); + /** + * + * + *
    +     * The input value to be merged into the specified cell. This must be
    +     * compatible with the family's `value_type.state_type`. Merging `NULL` is
    +     * allowed, but has no effect.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + */ + com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder(); + } + /** + * + * + *
    +   * A Mutation which merges accumulated state into a cell in an `Aggregate`
    +   * family.
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.Mutation.MergeToCell} + */ + public static final class MergeToCell extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.MergeToCell) + MergeToCellOrBuilder { + private static final long serialVersionUID = 0L; + // Use MergeToCell.newBuilder() to construct. + private MergeToCell(com.google.protobuf.GeneratedMessageV3.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(); + private MergeToCell() { + familyName_ = ""; + } - 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(); - } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MergeToCell(); } 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 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; @@ -2411,8 +2900,9 @@ public 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; @@ -2432,6 +2922,160 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { } } + public static final int COLUMN_QUALIFIER_FIELD_NUMBER = 2; + private com.google.bigtable.v2.Value columnQualifier_; + /** + * + * + *
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
    +     * 
    + * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + @java.lang.Override + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
    +     * 
    + * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return The columnQualifier. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getColumnQualifier() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + /** + * + * + *
    +     * The qualifier of the column into which new data should be added. This
    +     * must be a `raw_value`.
    +     * 
    + * + * .google.bigtable.v2.Value column_qualifier = 2; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getColumnQualifierOrBuilder() { + return columnQualifier_ == null + ? com.google.bigtable.v2.Value.getDefaultInstance() + : columnQualifier_; + } + + public static final int TIMESTAMP_FIELD_NUMBER = 3; + private com.google.bigtable.v2.Value timestamp_; + /** + * + * + *
    +     * The timestamp of the cell to which new data should be added. This must
    +     * be a `raw_timestamp_micros` that matches the table's `granularity`.
    +     * 
    + * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
    +     * The timestamp of the cell to which new data should be added. This must
    +     * be a `raw_timestamp_micros` that matches the table's `granularity`.
    +     * 
    + * + * .google.bigtable.v2.Value timestamp = 3; + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getTimestamp() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + /** + * + * + *
    +     * The timestamp of the cell to which new data should be added. This must
    +     * be a `raw_timestamp_micros` that matches the table's `granularity`.
    +     * 
    + * + * .google.bigtable.v2.Value timestamp = 3; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : timestamp_; + } + + public static final int INPUT_FIELD_NUMBER = 4; + private com.google.bigtable.v2.Value input_; + /** + * + * + *
    +     * The input value to be merged into the specified cell. This must be
    +     * compatible with the family's `value_type.state_type`. Merging `NULL` is
    +     * allowed, but has no effect.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return Whether the input field is set. + */ + @java.lang.Override + public boolean hasInput() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
    +     * The input value to be merged into the specified cell. This must be
    +     * compatible with the family's `value_type.state_type`. Merging `NULL` is
    +     * allowed, but has no effect.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + * + * @return The input. + */ + @java.lang.Override + public com.google.bigtable.v2.Value getInput() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + /** + * + * + *
    +     * The input value to be merged into the specified cell. This must be
    +     * compatible with the family's `value_type.state_type`. Merging `NULL` is
    +     * allowed, but has no effect.
    +     * 
    + * + * .google.bigtable.v2.Value input = 4; + */ + @java.lang.Override + public com.google.bigtable.v2.ValueOrBuilder getInputOrBuilder() { + return input_ == null ? com.google.bigtable.v2.Value.getDefaultInstance() : input_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2449,7 +3093,16 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(familyName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, familyName_); } - unknownFields.writeTo(output); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getColumnQualifier()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getTimestamp()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(4, getInput()); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -2461,7 +3114,16 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(familyName_)) { size += com.google.protobuf.GeneratedMessageV3.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 +3133,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,76 +3165,88 @@ 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 { + public static com.google.bigtable.v2.Mutation.MergeToCell parseFrom(java.io.InputStream input) + throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.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( 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); } - 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( 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); } - 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 { @@ -2577,7 +3263,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); } @@ -2596,32 +3282,33 @@ protected Builder newBuilderForType( * * *
    -     * 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 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 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(); } @@ -2632,31 +3319,50 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getColumnQualifierFieldBuilder(); + getTimestampFieldBuilder(); + getInputFieldBuilder(); + } } @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,14 +3370,38 @@ 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; } + 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 clone() { return super.clone(); @@ -2709,22 +3439,31 @@ public Builder addRepeatedField( @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 +3478,69 @@ 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( + getColumnQualifierFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getInputFieldBuilder().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; @@ -2782,8 +3562,9 @@ public 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; @@ -2805,8 +3586,9 @@ public com.google.protobuf.ByteString getFamilyNameBytes() { * * *
    -       * 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,8 +3600,8 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2827,8 +3609,9 @@ public Builder setFamilyName(java.lang.String value) { * * *
    -       * 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,8 +3619,8 @@ public Builder setFamilyName(java.lang.String value) { * @return This builder for chaining. */ public Builder clearFamilyName() { - familyName_ = getDefaultInstance().getFamilyName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -2845,8 +3628,9 @@ public Builder clearFamilyName() { * * *
    -       * 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,138 +3643,2426 @@ 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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + columnQualifierBuilder_; + /** + * + * + *
    +       * The qualifier of the column into which new data should be added. This
    +       * must be a `raw_value`.
    +       * 
    + * + * .google.bigtable.v2.Value column_qualifier = 2; + * + * @return Whether the columnQualifier field is set. + */ + public boolean hasColumnQualifier() { + return ((bitField0_ & 0x00000002) != 0); } - - @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 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(builder_scope:google.bigtable.v2.Mutation.DeleteFromFamily) - } - - // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromFamily) - private static final com.google.bigtable.v2.Mutation.DeleteFromFamily DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.DeleteFromFamily(); - } - - public static com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteFromFamily parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteFromFamily(input, extensionRegistry); + /** + * + * + *
    +       * 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(); } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface DeleteFromRowOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromRow) - com.google.protobuf.MessageOrBuilder {} - /** - * - * - *
    -   * A Mutation which deletes all cells from the containing row.
    -   * 
    - * - * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromRow} - */ - public static final class DeleteFromRow extends com.google.protobuf.GeneratedMessageV3 - 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(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); + columnQualifier_ = value; + } else { + columnQualifierBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; } - 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; - } + /** + * + * + *
    +       * 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); } - } 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(); + 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 getColumnQualifierFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getColumnQualifierFieldBuilder() { + if (columnQualifierBuilder_ == null) { + columnQualifierBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getColumnQualifier(), getParentForChildren(), isClean()); + columnQualifier_ = null; + } + return columnQualifierBuilder_; } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + private com.google.bigtable.v2.Value timestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + 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 getTimestampFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getTimestampFieldBuilder() { + if (timestampBuilder_ == null) { + timestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getInputFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getInputFieldBuilder() { + if (inputBuilder_ == null) { + inputBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder>( + getInput(), getParentForChildren(), isClean()); + input_ = null; + } + return inputBuilder_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromColumn) + DeleteFromColumnOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFromColumn.newBuilder() to construct. + private DeleteFromColumn(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFromColumn() { + 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_DeleteFromColumn_descriptor; + } + + @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); + } + + 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.GeneratedMessageV3.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.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); + } + + // Construct using com.google.bigtable.v2.Mutation.DeleteFromColumn.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTimeRangeFieldBuilder(); + } + } + + @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 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.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() != com.google.protobuf.ByteString.EMPTY) { + 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(getTimeRangeFieldBuilder().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.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.
    +       * 
    + * + * .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 getTimeRangeFieldBuilder().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.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; + } + return timeRangeBuilder_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Mutation.DeleteFromFamily) + DeleteFromFamilyOrBuilder { + 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(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(familyName_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(familyName_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.DeleteFromFamily) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.Mutation.DeleteFromFamily) + private static final com.google.bigtable.v2.Mutation.DeleteFromFamily DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.Mutation.DeleteFromFamily(); + } + + public static com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFromFamily parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation.DeleteFromFamily getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface DeleteFromRowOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.Mutation.DeleteFromRow) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
    +   * A Mutation which deletes all cells from the containing row.
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.Mutation.DeleteFromRow} + */ + public static final class DeleteFromRow extends com.google.protobuf.GeneratedMessageV3 + 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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_Mutation_DeleteFromRow_descriptor; } @@ -3019,7 +6091,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 +6100,7 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3044,7 +6116,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 +6127,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; } @@ -3186,17 +6258,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) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override @@ -3281,7 +6346,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,17 +6361,31 @@ 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); - } - } + onChanged(); + } // finally return this; } @@ -3343,7 +6422,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 +6454,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 +6463,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), @@ -3393,6 +6488,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: @@ -3447,23 +6546,125 @@ public com.google.bigtable.v2.Mutation.SetCell getSetCell() { if (mutationCase_ == 1) { return (com.google.bigtable.v2.Mutation.SetCell) mutation_; } - return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + /** + * + * + *
    +   * Set a cell's value.
    +   * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { + if (mutationCase_ == 1) { + return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + + public static final int ADD_TO_CELL_FIELD_NUMBER = 5; + /** + * + * + *
    +   * Incrementally updates an `Aggregate` cell.
    +   * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return Whether the addToCell field is set. + */ + @java.lang.Override + public boolean hasAddToCell() { + return mutationCase_ == 5; + } + /** + * + * + *
    +   * Incrementally updates an `Aggregate` cell.
    +   * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + * + * @return The addToCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCell getAddToCell() { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + /** + * + * + *
    +   * Incrementally updates an `Aggregate` cell.
    +   * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.AddToCellOrBuilder getAddToCellOrBuilder() { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + + public static final int MERGE_TO_CELL_FIELD_NUMBER = 6; + /** + * + * + *
    +   * Merges accumulated state to an `Aggregate` cell.
    +   * 
    + * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return Whether the mergeToCell field is set. + */ + @java.lang.Override + public boolean hasMergeToCell() { + return mutationCase_ == 6; + } + /** + * + * + *
    +   * Merges accumulated state to an `Aggregate` cell.
    +   * 
    + * + * .google.bigtable.v2.Mutation.MergeToCell merge_to_cell = 6; + * + * @return The mergeToCell. + */ + @java.lang.Override + public com.google.bigtable.v2.Mutation.MergeToCell getMergeToCell() { + if (mutationCase_ == 6) { + return (com.google.bigtable.v2.Mutation.MergeToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); } /** * * *
    -   * 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) { - return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + 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.SetCell.getDefaultInstance(); + return com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); } public static final int DELETE_FROM_COLUMN_FIELD_NUMBER = 2; @@ -3645,7 +6846,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 +6881,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 +6911,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 +6929,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 +6945,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 +6968,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3853,310 +7084,805 @@ 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 + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.Mutation.class, com.google.bigtable.v2.Mutation.Builder.class); + } + + // Construct using com.google.bigtable.v2.Mutation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (setCellBuilder_ != null) { + setCellBuilder_.clear(); + } + if (addToCellBuilder_ != null) { + addToCellBuilder_.clear(); + } + if (mergeToCellBuilder_ != null) { + mergeToCellBuilder_.clear(); + } + if (deleteFromColumnBuilder_ != null) { + deleteFromColumnBuilder_.clear(); + } + if (deleteFromFamilyBuilder_ != null) { + deleteFromFamilyBuilder_.clear(); + } + if (deleteFromRowBuilder_ != null) { + deleteFromRowBuilder_.clear(); + } + mutationCase_ = 0; + mutation_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.v2.DataProto + .internal_static_google_bigtable_v2_Mutation_descriptor; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation getDefaultInstanceForType() { + return com.google.bigtable.v2.Mutation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation build() { + com.google.bigtable.v2.Mutation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.v2.Mutation buildPartial() { + com.google.bigtable.v2.Mutation result = new com.google.bigtable.v2.Mutation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.Mutation result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.Mutation result) { + result.mutationCase_ = mutationCase_; + result.mutation_ = this.mutation_; + if (mutationCase_ == 1 && setCellBuilder_ != null) { + result.mutation_ = setCellBuilder_.build(); + } + if (mutationCase_ == 5 && addToCellBuilder_ != null) { + result.mutation_ = addToCellBuilder_.build(); + } + if (mutationCase_ == 6 && mergeToCellBuilder_ != null) { + result.mutation_ = mergeToCellBuilder_.build(); + } + if (mutationCase_ == 2 && deleteFromColumnBuilder_ != null) { + result.mutation_ = deleteFromColumnBuilder_.build(); + } + if (mutationCase_ == 3 && deleteFromFamilyBuilder_ != null) { + result.mutation_ = deleteFromFamilyBuilder_.build(); + } + if (mutationCase_ == 4 && deleteFromRowBuilder_ != null) { + result.mutation_ = deleteFromRowBuilder_.build(); + } + } + + @java.lang.Override + public Builder 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) { + 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(getSetCellFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getDeleteFromColumnFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage( + getDeleteFromFamilyFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getDeleteFromRowFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getAddToCellFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getMergeToCellFieldBuilder().getBuilder(), extensionRegistry); + mutationCase_ = 6; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int mutationCase_ = 0; + private java.lang.Object mutation_; + + public MutationCase getMutationCase() { + return MutationCase.forNumber(mutationCase_); + } + + public Builder clearMutation() { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Mutation.SetCell, + com.google.bigtable.v2.Mutation.SetCell.Builder, + com.google.bigtable.v2.Mutation.SetCellOrBuilder> + setCellBuilder_; + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return Whether the setCell field is set. + */ + @java.lang.Override + public boolean hasSetCell() { + return mutationCase_ == 1; + } + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + * + * @return The setCell. + */ @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.bigtable.v2.Mutation.class, com.google.bigtable.v2.Mutation.Builder.class); + public 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(); + } } - - // Construct using com.google.bigtable.v2.Mutation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * + * + *
    +     * 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; } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder setSetCell(com.google.bigtable.v2.Mutation.SetCell.Builder builderForValue) { + if (setCellBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + setCellBuilder_.setMessage(builderForValue.build()); + } + mutationCase_ = 1; + return this; } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder mergeSetCell(com.google.bigtable.v2.Mutation.SetCell value) { + if (setCellBuilder_ == null) { + if (mutationCase_ == 1 + && mutation_ != com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance()) { + mutation_ = + com.google.bigtable.v2.Mutation.SetCell.newBuilder( + (com.google.bigtable.v2.Mutation.SetCell) mutation_) + .mergeFrom(value) + .buildPartial(); + } else { + mutation_ = value; + } + onChanged(); + } else { + if (mutationCase_ == 1) { + setCellBuilder_.mergeFrom(value); + } else { + setCellBuilder_.setMessage(value); + } + } + mutationCase_ = 1; + return this; } - - @java.lang.Override - public Builder clear() { - super.clear(); - mutationCase_ = 0; - mutation_ = null; + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public Builder clearSetCell() { + if (setCellBuilder_ == null) { + if (mutationCase_ == 1) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); + } + } else { + if (mutationCase_ == 1) { + mutationCase_ = 0; + mutation_ = null; + } + setCellBuilder_.clear(); + } return this; } - + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + public com.google.bigtable.v2.Mutation.SetCell.Builder getSetCellBuilder() { + return getSetCellFieldBuilder().getBuilder(); + } + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.bigtable.v2.DataProto - .internal_static_google_bigtable_v2_Mutation_descriptor; + public com.google.bigtable.v2.Mutation.SetCellOrBuilder getSetCellOrBuilder() { + if ((mutationCase_ == 1) && (setCellBuilder_ != null)) { + return setCellBuilder_.getMessageOrBuilder(); + } else { + if (mutationCase_ == 1) { + return (com.google.bigtable.v2.Mutation.SetCell) mutation_; + } + return com.google.bigtable.v2.Mutation.SetCell.getDefaultInstance(); + } + } + /** + * + * + *
    +     * Set a cell's value.
    +     * 
    + * + * .google.bigtable.v2.Mutation.SetCell set_cell = 1; + */ + private com.google.protobuf.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(); + } + 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_, + getParentForChildren(), + isClean()); + mutation_ = null; + } + mutationCase_ = 1; + onChanged(); + return setCellBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + 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 com.google.bigtable.v2.Mutation getDefaultInstanceForType() { - return com.google.bigtable.v2.Mutation.getDefaultInstance(); + 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 build() { - com.google.bigtable.v2.Mutation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + public com.google.bigtable.v2.Mutation.AddToCell getAddToCell() { + if (addToCellBuilder_ == null) { + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } else { + if (mutationCase_ == 5) { + return addToCellBuilder_.getMessage(); + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); + } + } + /** + * + * + *
    +     * Incrementally updates an `Aggregate` cell.
    +     * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder setAddToCell(com.google.bigtable.v2.Mutation.AddToCell value) { + if (addToCellBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + mutation_ = value; + onChanged(); + } else { + addToCellBuilder_.setMessage(value); + } + mutationCase_ = 5; + return this; + } + /** + * + * + *
    +     * Incrementally updates an `Aggregate` cell.
    +     * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder setAddToCell(com.google.bigtable.v2.Mutation.AddToCell.Builder builderForValue) { + if (addToCellBuilder_ == null) { + mutation_ = builderForValue.build(); + onChanged(); + } else { + addToCellBuilder_.setMessage(builderForValue.build()); } - return result; + mutationCase_ = 5; + return this; } - - @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_; + /** + * + * + *
    +     * 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 { - result.mutation_ = setCellBuilder_.build(); + mutation_ = value; } - } - if (mutationCase_ == 2) { - if (deleteFromColumnBuilder_ == null) { - result.mutation_ = mutation_; + onChanged(); + } else { + if (mutationCase_ == 5) { + addToCellBuilder_.mergeFrom(value); } else { - result.mutation_ = deleteFromColumnBuilder_.build(); + addToCellBuilder_.setMessage(value); } } - if (mutationCase_ == 3) { - if (deleteFromFamilyBuilder_ == null) { - result.mutation_ = mutation_; - } else { - result.mutation_ = deleteFromFamilyBuilder_.build(); + mutationCase_ = 5; + return this; + } + /** + * + * + *
    +     * Incrementally updates an `Aggregate` cell.
    +     * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + public Builder clearAddToCell() { + if (addToCellBuilder_ == null) { + if (mutationCase_ == 5) { + mutationCase_ = 0; + mutation_ = null; + onChanged(); } - } - if (mutationCase_ == 4) { - if (deleteFromRowBuilder_ == null) { - result.mutation_ = mutation_; - } else { - result.mutation_ = deleteFromRowBuilder_.build(); + } else { + if (mutationCase_ == 5) { + mutationCase_ = 0; + mutation_ = null; } + addToCellBuilder_.clear(); } - result.mutationCase_ = mutationCase_; - 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); + 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 com.google.bigtable.v2.Mutation.AddToCell.Builder getAddToCellBuilder() { + return getAddToCellFieldBuilder().getBuilder(); } - + /** + * + * + *
    +     * Incrementally updates an `Aggregate` cell.
    +     * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ @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); + public com.google.bigtable.v2.Mutation.AddToCellOrBuilder getAddToCellOrBuilder() { + if ((mutationCase_ == 5) && (addToCellBuilder_ != null)) { + return addToCellBuilder_.getMessageOrBuilder(); } 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 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; - } + if (mutationCase_ == 5) { + return (com.google.bigtable.v2.Mutation.AddToCell) mutation_; + } + return com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.bigtable.v2.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); + /** + * + * + *
    +     * Incrementally updates an `Aggregate` cell.
    +     * 
    + * + * .google.bigtable.v2.Mutation.AddToCell add_to_cell = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Mutation.AddToCell, + com.google.bigtable.v2.Mutation.AddToCell.Builder, + com.google.bigtable.v2.Mutation.AddToCellOrBuilder> + getAddToCellFieldBuilder() { + if (addToCellBuilder_ == null) { + if (!(mutationCase_ == 5)) { + mutation_ = com.google.bigtable.v2.Mutation.AddToCell.getDefaultInstance(); } + addToCellBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; } - 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; + 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_; + 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,36 +7890,37 @@ 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; } @@ -4201,66 +7928,65 @@ public Builder clearSetCell() { * * *
    -     * 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 getMergeToCellFieldBuilder().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(); + com.google.bigtable.v2.Mutation.MergeToCell, + com.google.bigtable.v2.Mutation.MergeToCell.Builder, + com.google.bigtable.v2.Mutation.MergeToCellOrBuilder> + getMergeToCellFieldBuilder() { + if (mergeToCellBuilder_ == null) { + if (!(mutationCase_ == 6)) { + mutation_ = com.google.bigtable.v2.Mutation.MergeToCell.getDefaultInstance(); } - setCellBuilder_ = + mergeToCellBuilder_ = 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_, + 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< @@ -4375,8 +8101,9 @@ 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; @@ -4469,7 +8196,6 @@ public com.google.bigtable.v2.Mutation.DeleteFromColumn.Builder getDeleteFromCol } mutationCase_ = 2; onChanged(); - ; return deleteFromColumnBuilder_; } @@ -4585,8 +8311,9 @@ 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; @@ -4679,7 +8406,6 @@ public com.google.bigtable.v2.Mutation.DeleteFromFamily.Builder getDeleteFromFam } mutationCase_ = 3; onChanged(); - ; return deleteFromFamilyBuilder_; } @@ -4795,8 +8521,9 @@ 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; @@ -4888,7 +8615,6 @@ public com.google.bigtable.v2.Mutation.DeleteFromRowOrBuilder getDeleteFromRowOr } mutationCase_ = 4; onChanged(); - ; return deleteFromRowBuilder_; } @@ -4924,7 +8650,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..6b125b4f20 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface MutationOrBuilder @@ -58,6 +59,76 @@ 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(); + /** * * @@ -163,5 +234,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..aef89f676d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSet.java @@ -0,0 +1,1105 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * A partial result set from the streaming query API.
    + * CBT client will buffer partial_rows from result_sets until it gets a
    + * resumption_token.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.PartialResultSet} + */ +public final class PartialResultSet extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PartialResultSet) + PartialResultSetOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartialResultSet.newBuilder() to construct. + private PartialResultSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartialResultSet() { + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartialResultSet(); + } + + 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.GeneratedMessageV3.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 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 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
    +   * the client to accumulate `partial_rows` since the last non-empty
    +   * `resume_token`. On resumption, the resumed query will return the remaining
    +   * rows for this query.
    +   *
    +   * If there is a batch in progress, a non-empty `resume_token`
    +   * means that that the batch of `partial_rows` will be complete after merging
    +   * the `partial_rows` from this response. The client must only yield
    +   * completed batches to the application, and must ensure that any future
    +   * retries send the latest token to avoid returning duplicate data.
    +   *
    +   * The server may set 'resume_token' without a 'partial_rows'. If there is a
    +   * batch in progress the client should yield it.
    +   *
    +   * 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
    +   * `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 ESTIMATED_BATCH_SIZE_FIELD_NUMBER = 4; + private int estimatedBatchSize_ = 0; + /** + * + * + *
    +   * Estimated size of a new batch. The server will always set this when
    +   * returning the first `partial_rows` of a batch, and will not set it at any
    +   * other time.
    +   *
    +   * The client can use this estimate to allocate an initial buffer for the
    +   * batched 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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!getResumeToken().equals(other.getResumeToken())) 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(); + hash = (37 * hash) + RESUME_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getResumeToken().hashCode(); + 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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PartialResultSet parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +   * A partial result set from the streaming query API.
    +   * CBT client will buffer partial_rows from result_sets until it gets a
    +   * resumption_token.
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.PartialResultSet} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (protoRowsBatchBuilder_ != null) { + protoRowsBatchBuilder_.clear(); + } + resumeToken_ = com.google.protobuf.ByteString.EMPTY; + 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_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resumeToken_ = resumeToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.estimatedBatchSize_ = estimatedBatchSize_; + } + } + + 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 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.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.getResumeToken() != com.google.protobuf.ByteString.EMPTY) { + setResumeToken(other.getResumeToken()); + } + 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(getProtoRowsBatchFieldBuilder().getBuilder(), extensionRegistry); + partialRowsCase_ = 3; + break; + } // case 26 + case 32: + { + estimatedBatchSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + resumeToken_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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.SingleFieldBuilderV3< + 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 getProtoRowsBatchFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ProtoRowsBatch, + com.google.bigtable.v2.ProtoRowsBatch.Builder, + com.google.bigtable.v2.ProtoRowsBatchOrBuilder> + getProtoRowsBatchFieldBuilder() { + if (protoRowsBatchBuilder_ == null) { + if (!(partialRowsCase_ == 3)) { + partialRows_ = com.google.bigtable.v2.ProtoRowsBatch.getDefaultInstance(); + } + protoRowsBatchBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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 com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
    +     * An opaque token sent by the server to allow query resumption and signal
    +     * the client to accumulate `partial_rows` since the last non-empty
    +     * `resume_token`. On resumption, the resumed query will return the remaining
    +     * rows for this query.
    +     *
    +     * If there is a batch in progress, a non-empty `resume_token`
    +     * means that that the batch of `partial_rows` will be complete after merging
    +     * the `partial_rows` from this response. The client must only yield
    +     * completed batches to the application, and must ensure that any future
    +     * retries send the latest token to avoid returning duplicate data.
    +     *
    +     * The server may set 'resume_token' without a 'partial_rows'. If there is a
    +     * batch in progress the client should yield it.
    +     *
    +     * 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
    +     * `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
    +     * the client to accumulate `partial_rows` since the last non-empty
    +     * `resume_token`. On resumption, the resumed query will return the remaining
    +     * rows for this query.
    +     *
    +     * If there is a batch in progress, a non-empty `resume_token`
    +     * means that that the batch of `partial_rows` will be complete after merging
    +     * the `partial_rows` from this response. The client must only yield
    +     * completed batches to the application, and must ensure that any future
    +     * retries send the latest token to avoid returning duplicate data.
    +     *
    +     * The server may set 'resume_token' without a 'partial_rows'. If there is a
    +     * batch in progress the client should yield it.
    +     *
    +     * 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
    +     * `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_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
    +     * An opaque token sent by the server to allow query resumption and signal
    +     * the client to accumulate `partial_rows` since the last non-empty
    +     * `resume_token`. On resumption, the resumed query will return the remaining
    +     * rows for this query.
    +     *
    +     * If there is a batch in progress, a non-empty `resume_token`
    +     * means that that the batch of `partial_rows` will be complete after merging
    +     * the `partial_rows` from this response. The client must only yield
    +     * completed batches to the application, and must ensure that any future
    +     * retries send the latest token to avoid returning duplicate data.
    +     *
    +     * The server may set 'resume_token' without a 'partial_rows'. If there is a
    +     * batch in progress the client should yield it.
    +     *
    +     * 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
    +     * `partial_rows`, then return OK.
    +     * 
    + * + * bytes resume_token = 5; + * + * @return This builder for chaining. + */ + public Builder clearResumeToken() { + bitField0_ = (bitField0_ & ~0x00000002); + resumeToken_ = getDefaultInstance().getResumeToken(); + onChanged(); + return this; + } + + private int estimatedBatchSize_; + /** + * + * + *
    +     * Estimated size of a new batch. The server will always set this when
    +     * returning the first `partial_rows` of a batch, and will not set it at any
    +     * other time.
    +     *
    +     * The client can use this estimate to allocate an initial buffer for the
    +     * batched 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 a new batch. The server will always set this when
    +     * returning the first `partial_rows` of a batch, and will not set it at any
    +     * other time.
    +     *
    +     * The client can use this estimate to allocate an initial buffer for the
    +     * batched 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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
    +     * Estimated size of a new batch. The server will always set this when
    +     * returning the first `partial_rows` of a batch, and will not set it at any
    +     * other time.
    +     *
    +     * The client can use this estimate to allocate an initial buffer for the
    +     * batched 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_ & ~0x00000004); + estimatedBatchSize_ = 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.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..bdefed8c00 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PartialResultSetOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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(); + + /** + * + * + *
    +   * An opaque token sent by the server to allow query resumption and signal
    +   * the client to accumulate `partial_rows` since the last non-empty
    +   * `resume_token`. On resumption, the resumed query will return the remaining
    +   * rows for this query.
    +   *
    +   * If there is a batch in progress, a non-empty `resume_token`
    +   * means that that the batch of `partial_rows` will be complete after merging
    +   * the `partial_rows` from this response. The client must only yield
    +   * completed batches to the application, and must ensure that any future
    +   * retries send the latest token to avoid returning duplicate data.
    +   *
    +   * The server may set 'resume_token' without a 'partial_rows'. If there is a
    +   * batch in progress the client should yield it.
    +   *
    +   * 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
    +   * `partial_rows`, then return OK.
    +   * 
    + * + * bytes resume_token = 5; + * + * @return The resumeToken. + */ + com.google.protobuf.ByteString getResumeToken(); + + /** + * + * + *
    +   * Estimated size of a new batch. The server will always set this when
    +   * returning the first `partial_rows` of a batch, and will not set it at any
    +   * other time.
    +   *
    +   * The client can use this estimate to allocate an initial buffer for the
    +   * batched 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/PingAndWarmRequest.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java new file mode 100644 index 0000000000..1d06c8e3b9 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequest.java @@ -0,0 +1,841 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Request message for client connection keep-alive and warming.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.PingAndWarmRequest} + */ +public final class PingAndWarmRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PingAndWarmRequest) + PingAndWarmRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PingAndWarmRequest.newBuilder() to construct. + private PingAndWarmRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PingAndWarmRequest() { + name_ = ""; + appProfileId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PingAndWarmRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmRequest.class, + com.google.bigtable.v2.PingAndWarmRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @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.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appProfileId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appProfileId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.PingAndWarmRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +   * Request message for client connection keep-alive and warming.
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.PingAndWarmRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PingAndWarmRequest) + com.google.bigtable.v2.PingAndWarmRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmRequest.class, + com.google.bigtable.v2.PingAndWarmRequest.Builder.class); + } + + // Construct using com.google.bigtable.v2.PingAndWarmRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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 clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PingAndWarmRequest) { + return mergeFrom((com.google.bigtable.v2.PingAndWarmRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PingAndWarmRequest other) { + if (other == com.google.bigtable.v2.PingAndWarmRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PingAndWarmRequest) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PingAndWarmRequest) + private static final com.google.bigtable.v2.PingAndWarmRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PingAndWarmRequest(); + } + + public static com.google.bigtable.v2.PingAndWarmRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PingAndWarmRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.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..35b3b774d9 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmRequestOrBuilder.java @@ -0,0 +1,86 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public interface PingAndWarmRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PingAndWarmRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
    +   * Required. The unique name of the instance to check permissions for as well
    +   * as respond. Values are of the form
    +   * `projects/<project>/instances/<instance>`.
    +   * 
    + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
    +   * Required. The unique name of the instance to check permissions for as well
    +   * as respond. Values are of the form
    +   * `projects/<project>/instances/<instance>`.
    +   * 
    + * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
    +   * This value specifies routing for replication. If not specified, the
    +   * "default" application profile will be used.
    +   * 
    + * + * string app_profile_id = 2; + * + * @return The appProfileId. + */ + java.lang.String getAppProfileId(); + /** + * + * + *
    +   * This value specifies routing for replication. If not specified, the
    +   * "default" application profile will be used.
    +   * 
    + * + * string app_profile_id = 2; + * + * @return The bytes for appProfileId. + */ + com.google.protobuf.ByteString getAppProfileIdBytes(); +} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java new file mode 100644 index 0000000000..110febb084 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponse.java @@ -0,0 +1,431 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Response message for Bigtable.PingAndWarm connection keepalive and warming.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.PingAndWarmResponse} + */ +public final class PingAndWarmResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.PingAndWarmResponse) + PingAndWarmResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use PingAndWarmResponse.newBuilder() to construct. + private PingAndWarmResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PingAndWarmResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PingAndWarmResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmResponse.class, + com.google.bigtable.v2.PingAndWarmResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + 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.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.v2.PingAndWarmResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.PingAndWarmResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +   * Response message for Bigtable.PingAndWarm connection keepalive and warming.
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.PingAndWarmResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.v2.PingAndWarmResponse) + com.google.bigtable.v2.PingAndWarmResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.v2.BigtableProto + .internal_static_google_bigtable_v2_PingAndWarmResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.v2.PingAndWarmResponse.class, + com.google.bigtable.v2.PingAndWarmResponse.Builder.class); + } + + // Construct using com.google.bigtable.v2.PingAndWarmResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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 clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.PingAndWarmResponse) { + return mergeFrom((com.google.bigtable.v2.PingAndWarmResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.v2.PingAndWarmResponse other) { + if (other == com.google.bigtable.v2.PingAndWarmResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.v2.PingAndWarmResponse) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.v2.PingAndWarmResponse) + private static final com.google.bigtable.v2.PingAndWarmResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.v2.PingAndWarmResponse(); + } + + public static com.google.bigtable.v2.PingAndWarmResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PingAndWarmResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.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..35f1f2746f --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/PingAndWarmResponseOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public interface PingAndWarmResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.PingAndWarmResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java new file mode 100644 index 0000000000..1414a33e39 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormat.java @@ -0,0 +1,430 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Protocol buffers format descriptor, as described by Messages ProtoSchema and
    + * ProtoRows
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ProtoFormat} + */ +public final class ProtoFormat extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoFormat) + ProtoFormatOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProtoFormat.newBuilder() to construct. + private ProtoFormat(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProtoFormat() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoFormat parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..6565e1eaf4 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoFormatOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..4be0f73e0e --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRows.java @@ -0,0 +1,976 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class ProtoRows extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoRows) + ProtoRowsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProtoRows.newBuilder() to construct. + private ProtoRows(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProtoRows() { + values_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProtoRows(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRows parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getValuesFieldBuilder() + : 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.RepeatedFieldBuilderV3< + 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 getValuesFieldBuilder().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 getValuesFieldBuilder().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 getValuesFieldBuilder() + .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 getValuesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.Value, + com.google.bigtable.v2.Value.Builder, + com.google.bigtable.v2.ValueOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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..343d0f0cb1 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatch.java @@ -0,0 +1,540 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Batch of serialized ProtoRows.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ProtoRowsBatch} + */ +public final class ProtoRowsBatch extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoRowsBatch) + ProtoRowsBatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProtoRowsBatch.newBuilder() to construct. + private ProtoRowsBatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProtoRowsBatch() { + batchData_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProtoRowsBatch(); + } + + 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.GeneratedMessageV3.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; + /** + * + * + *
    +   * Merge partial results by concatenating these bytes, then parsing the
    +   * overall value as a `ProtoRows` message.
    +   * 
    + * + * 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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoRowsBatch parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +   * Batch of serialized ProtoRows.
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.ProtoRowsBatch} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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() != com.google.protobuf.ByteString.EMPTY) { + 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; + /** + * + * + *
    +     * Merge partial results by concatenating these bytes, then parsing the
    +     * overall value as a `ProtoRows` message.
    +     * 
    + * + * bytes batch_data = 1; + * + * @return The batchData. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBatchData() { + return batchData_; + } + /** + * + * + *
    +     * Merge partial results by concatenating these bytes, then parsing the
    +     * overall value as a `ProtoRows` message.
    +     * 
    + * + * 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; + } + /** + * + * + *
    +     * Merge partial results by concatenating these bytes, then parsing the
    +     * overall value as a `ProtoRows` message.
    +     * 
    + * + * bytes batch_data = 1; + * + * @return This builder for chaining. + */ + public Builder clearBatchData() { + bitField0_ = (bitField0_ & ~0x00000001); + batchData_ = getDefaultInstance().getBatchData(); + 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.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..4cfbe61e46 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsBatchOrBuilder.java @@ -0,0 +1,40 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public interface ProtoRowsBatchOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.v2.ProtoRowsBatch) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
    +   * Merge partial results by concatenating these bytes, then parsing the
    +   * overall value as a `ProtoRows` message.
    +   * 
    + * + * 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..1d9c4604f4 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoRowsOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..c8a2665553 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchema.java @@ -0,0 +1,930 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * ResultSet schema in proto format
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ProtoSchema} + */ +public final class ProtoSchema extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ProtoSchema) + ProtoSchemaOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProtoSchema.newBuilder() to construct. + private ProtoSchema(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProtoSchema() { + columns_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProtoSchema(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ProtoSchema parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getColumnsFieldBuilder() + : 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.RepeatedFieldBuilderV3< + 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 getColumnsFieldBuilder().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 getColumnsFieldBuilder() + .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 getColumnsFieldBuilder() + .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 getColumnsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.ColumnMetadata, + com.google.bigtable.v2.ColumnMetadata.Builder, + com.google.bigtable.v2.ColumnMetadataOrBuilder> + getColumnsFieldBuilder() { + if (columnsBuilder_ == null) { + columnsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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..25d5c2623f --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ProtoSchemaOrBuilder.java @@ -0,0 +1,78 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..8a599e039f --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfo.java @@ -0,0 +1,897 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Information about how client should adjust the load to Bigtable.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.RateLimitInfo} + */ +public final class RateLimitInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RateLimitInfo) + RateLimitInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use RateLimitInfo.newBuilder() to construct. + private RateLimitInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RateLimitInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RateLimitInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPeriodFieldBuilder(); + } + } + + @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 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.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 (other.getFactor() != 0D) { + 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(getPeriodFieldBuilder().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.SingleFieldBuilderV3< + 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 getPeriodFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getPeriodFieldBuilder() { + if (periodBuilder_ == null) { + periodBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; + } + + @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.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..c0bcfa687d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RateLimitInfoOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..18562a5c39 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequest.java @@ -0,0 +1,2516 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class ReadChangeStreamRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamRequest) + ReadChangeStreamRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadChangeStreamRequest.newBuilder() to construct. + private ReadChangeStreamRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadChangeStreamRequest() { + tableName_ = ""; + appProfileId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadChangeStreamRequest(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(tableName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(tableName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tableName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPartitionFieldBuilder(); + getEndTimeFieldBuilder(); + getHeartbeatDurationFieldBuilder(); + } + } + + @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 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.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(getPartitionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + startFromCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + input.readMessage( + getContinuationTokensFieldBuilder().getBuilder(), extensionRegistry); + startFromCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage( + getHeartbeatDurationFieldBuilder().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.SingleFieldBuilderV3< + 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 getPartitionFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + getPartitionFieldBuilder() { + if (partitionBuilder_ == null) { + partitionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getStartTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + if (!(startFromCase_ == 4)) { + startFrom_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getContinuationTokensFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.StreamContinuationTokens, + com.google.bigtable.v2.StreamContinuationTokens.Builder, + com.google.bigtable.v2.StreamContinuationTokensOrBuilder> + getContinuationTokensFieldBuilder() { + if (continuationTokensBuilder_ == null) { + if (!(startFromCase_ == 6)) { + startFrom_ = com.google.bigtable.v2.StreamContinuationTokens.getDefaultInstance(); + } + continuationTokensBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getEndTimeFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getHeartbeatDurationFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getHeartbeatDurationFieldBuilder() { + if (heartbeatDurationBuilder_ == null) { + heartbeatDurationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getHeartbeatDuration(), getParentForChildren(), isClean()); + heartbeatDuration_ = null; + } + return heartbeatDurationBuilder_; + } + + @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.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..f9b1ecbd9c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamRequestOrBuilder.java @@ -0,0 +1,312 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..1d3e040b39 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponse.java @@ -0,0 +1,9430 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class ReadChangeStreamResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse) + ReadChangeStreamResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadChangeStreamResponse.newBuilder() to construct. + private ReadChangeStreamResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadChangeStreamResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk) + MutationChunkOrBuilder { + private static final long serialVersionUID = 0L; + // Use MutationChunk.newBuilder() to construct. + private MutationChunk(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MutationChunk() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo) + ChunkInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ChunkInfo.newBuilder() to construct. + private ChunkInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChunkInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getChunkInfoFieldBuilder(); + getMutationFieldBuilder(); + } + } + + @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 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.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(getChunkInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMutationFieldBuilder().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.SingleFieldBuilderV3< + 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 getChunkInfoFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfoOrBuilder> + getChunkInfoFieldBuilder() { + if (chunkInfoBuilder_ == null) { + chunkInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMutationFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder> + getMutationFieldBuilder() { + if (mutationBuilder_ == null) { + mutationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Mutation, + com.google.bigtable.v2.Mutation.Builder, + com.google.bigtable.v2.MutationOrBuilder>( + getMutation(), getParentForChildren(), isClean()); + mutation_ = null; + } + return mutationBuilder_; + } + + @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.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 is 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 is 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 is 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.DataChange) + DataChangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use DataChange.newBuilder() to construct. + private DataChange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DataChange() { + type_ = 0; + sourceClusterId_ = ""; + rowKey_ = com.google.protobuf.ByteString.EMPTY; + chunks_ = java.util.Collections.emptyList(); + token_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DataChange(); + } + + 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.GeneratedMessageV3.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), + ; + + /** + * + * + *
    +       * 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 final 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 is 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 is 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 is 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.GeneratedMessageV3.isStringEmpty(sourceClusterId_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(sourceClusterId_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCommitTimestampFieldBuilder(); + getChunksFieldBuilder(); + getEstimatedLowWatermarkFieldBuilder(); + } + } + + @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 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.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() != com.google.protobuf.ByteString.EMPTY) { + 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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getChunksFieldBuilder() + : 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( + getCommitTimestampFieldBuilder().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( + getEstimatedLowWatermarkFieldBuilder().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.SingleFieldBuilderV3< + 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 getCommitTimestampFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCommitTimestampFieldBuilder() { + if (commitTimestampBuilder_ == null) { + commitTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.RepeatedFieldBuilderV3< + 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 getChunksFieldBuilder().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 getChunksFieldBuilder() + .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 getChunksFieldBuilder() + .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 getChunksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.MutationChunkOrBuilder> + getChunksFieldBuilder() { + if (chunksBuilder_ == null) { + chunksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 is 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 is 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 is 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 is 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 is 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 is 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 is 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 getEstimatedLowWatermarkFieldBuilder().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 is 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 is 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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEstimatedLowWatermarkFieldBuilder() { + if (estimatedLowWatermarkBuilder_ == null) { + estimatedLowWatermarkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEstimatedLowWatermark(), getParentForChildren(), isClean()); + estimatedLowWatermark_ = null; + } + return estimatedLowWatermarkBuilder_; + } + + @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.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 is 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 is 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 is 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.Heartbeat) + HeartbeatOrBuilder { + private static final long serialVersionUID = 0L; + // Use Heartbeat.newBuilder() to construct. + private Heartbeat(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Heartbeat() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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 is 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 is 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 is 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getContinuationTokenFieldBuilder(); + getEstimatedLowWatermarkFieldBuilder(); + } + } + + @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 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.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( + getContinuationTokenFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage( + getEstimatedLowWatermarkFieldBuilder().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.SingleFieldBuilderV3< + 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 getContinuationTokenFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + getContinuationTokenFieldBuilder() { + if (continuationTokenBuilder_ == null) { + continuationTokenBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 is 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 is 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 is 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 is 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 is 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 is 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 is 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 getEstimatedLowWatermarkFieldBuilder().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 is 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 is 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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEstimatedLowWatermarkFieldBuilder() { + if (estimatedLowWatermarkBuilder_ == null) { + estimatedLowWatermarkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEstimatedLowWatermark(), getParentForChildren(), isClean()); + estimatedLowWatermark_ = null; + } + return estimatedLowWatermarkBuilder_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadChangeStreamResponse.CloseStream) + CloseStreamOrBuilder { + private static final long serialVersionUID = 0L; + // Use CloseStream.newBuilder() to construct. + private CloseStream(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CloseStream() { + continuationTokens_ = java.util.Collections.emptyList(); + newPartitions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloseStream(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStatusFieldBuilder(); + getContinuationTokensFieldBuilder(); + getNewPartitionsFieldBuilder(); + } + } + + @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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getContinuationTokensFieldBuilder() + : 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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getNewPartitionsFieldBuilder() + : 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(getStatusFieldBuilder().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.SingleFieldBuilderV3< + 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 getStatusFieldBuilder().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.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getStatusFieldBuilder() { + if (statusBuilder_ == null) { + statusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.RepeatedFieldBuilderV3< + 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 getContinuationTokensFieldBuilder().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 getContinuationTokensFieldBuilder() + .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 getContinuationTokensFieldBuilder() + .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 getContinuationTokensFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + getContinuationTokensFieldBuilder() { + if (continuationTokensBuilder_ == null) { + continuationTokensBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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.RepeatedFieldBuilderV3< + 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 getNewPartitionsFieldBuilder().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 getNewPartitionsFieldBuilder() + .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 getNewPartitionsFieldBuilder() + .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 getNewPartitionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + getNewPartitionsFieldBuilder() { + if (newPartitionsBuilder_ == null) { + newPartitionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadChangeStreamResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getDataChangeFieldBuilder().getBuilder(), extensionRegistry); + streamRecordCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getHeartbeatFieldBuilder().getBuilder(), extensionRegistry); + streamRecordCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getCloseStreamFieldBuilder().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.SingleFieldBuilderV3< + 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 getDataChangeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.DataChangeOrBuilder> + getDataChangeFieldBuilder() { + if (dataChangeBuilder_ == null) { + if (!(streamRecordCase_ == 1)) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.DataChange.getDefaultInstance(); + } + dataChangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getHeartbeatFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat, + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.HeartbeatOrBuilder> + getHeartbeatFieldBuilder() { + if (heartbeatBuilder_ == null) { + if (!(streamRecordCase_ == 2)) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat.getDefaultInstance(); + } + heartbeatBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getCloseStreamFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.Builder, + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStreamOrBuilder> + getCloseStreamFieldBuilder() { + if (closeStreamBuilder_ == null) { + if (!(streamRecordCase_ == 3)) { + streamRecord_ = + com.google.bigtable.v2.ReadChangeStreamResponse.CloseStream.getDefaultInstance(); + } + closeStreamBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..a6a337c85b --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadChangeStreamResponseOrBuilder.java @@ -0,0 +1,133 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/bigtable.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..901ff63c80 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStats.java @@ -0,0 +1,825 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class ReadIterationStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ReadIterationStats) + ReadIterationStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadIterationStats.newBuilder() to construct. + private ReadIterationStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadIterationStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ReadIterationStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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..54d75c5c4d --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ReadIterationStatsOrBuilder.java @@ -0,0 +1,80 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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 896d3c9f4b..3e43c472a9 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,6 +40,7 @@ private ReadModifyWriteRowRequest(com.google.protobuf.GeneratedMessageV3.Builder private ReadModifyWriteRowRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; rowKey_ = com.google.protobuf.ByteString.EMPTY; rules_ = java.util.Collections.emptyList(); @@ -50,82 +52,6 @@ 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; @@ -142,19 +68,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 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. @@ -175,14 +104,15 @@ public 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. @@ -200,8 +130,73 @@ 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_ = ""; /** * * @@ -252,12 +247,13 @@ 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 +266,16 @@ 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.
        * 
    * * @@ -292,9 +290,9 @@ public 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.
        * 
    * * @@ -310,9 +308,9 @@ public 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.
        * 
    * * @@ -327,9 +325,9 @@ public 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.
        * 
    * * @@ -344,9 +342,9 @@ public 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.
        * 
    * * @@ -384,7 +382,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, appProfileId_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, authorizedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -405,7 +406,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -422,10 +426,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 +443,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 +453,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; } @@ -575,36 +582,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) { 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,21 +630,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; + } + + 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,10 +715,17 @@ 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) { @@ -710,7 +735,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowRequest other) if (!other.rules_.isEmpty()) { if (rules_.isEmpty()) { rules_ = other.rules_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureRulesIsMutable(); rules_.addAll(other.rules_); @@ -723,7 +748,7 @@ 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() @@ -733,7 +758,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRowRequest other) } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -748,17 +773,68 @@ 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; } @@ -769,14 +845,15 @@ public Builder mergeFrom( * * *
    -     * 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. @@ -796,14 +873,15 @@ public 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. @@ -823,14 +901,15 @@ public com.google.protobuf.ByteString getTableNameBytes() { * * *
    -     * 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,8 +919,8 @@ public Builder setTableName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -849,21 +928,22 @@ public Builder setTableName(java.lang.String value) { * * *
    -     * 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; } @@ -871,14 +951,15 @@ public Builder clearTableName() { * * *
    -     * 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,8 +970,144 @@ 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; } @@ -959,8 +1176,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -977,8 +1194,8 @@ 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,8 +1217,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1011,7 +1228,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * * *
    -     * 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]; @@ -1026,7 +1244,8 @@ public com.google.protobuf.ByteString getRowKey() { * * *
    -     * 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,8 +1257,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -1047,7 +1266,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { * * *
    -     * 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 +1275,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,9 +1285,9 @@ 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; } } @@ -1081,9 +1301,9 @@ 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.
          * 
    * * @@ -1101,9 +1321,9 @@ public 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.
          * 
    * * @@ -1121,9 +1341,9 @@ public 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.
          * 
    * * @@ -1141,9 +1361,9 @@ public 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.
          * 
    * * @@ -1167,9 +1387,9 @@ public Builder setRules(int index, com.google.bigtable.v2.ReadModifyWriteRule va * * *
    -     * 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.
          * 
    * * @@ -1191,9 +1411,9 @@ public Builder setRules( * * *
    -     * 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.
          * 
    * * @@ -1217,9 +1437,9 @@ public Builder addRules(com.google.bigtable.v2.ReadModifyWriteRule value) { * * *
    -     * 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.
          * 
    * * @@ -1243,9 +1463,9 @@ public Builder addRules(int index, com.google.bigtable.v2.ReadModifyWriteRule va * * *
    -     * 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.
          * 
    * * @@ -1266,9 +1486,9 @@ public Builder addRules(com.google.bigtable.v2.ReadModifyWriteRule.Builder build * * *
    -     * 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.
          * 
    * * @@ -1290,9 +1510,9 @@ public Builder addRules( * * *
    -     * 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.
          * 
    * * @@ -1314,9 +1534,9 @@ public Builder addAllRules( * * *
    -     * 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.
          * 
    * * @@ -1326,7 +1546,7 @@ public Builder addAllRules( public Builder clearRules() { if (rulesBuilder_ == null) { rules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { rulesBuilder_.clear(); @@ -1337,9 +1557,9 @@ public Builder clearRules() { * * *
    -     * 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.
          * 
    * * @@ -1360,9 +1580,9 @@ public Builder removeRules(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.
          * 
    * * @@ -1376,9 +1596,9 @@ public com.google.bigtable.v2.ReadModifyWriteRule.Builder getRulesBuilder(int in * * *
    -     * 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.
          * 
    * * @@ -1396,9 +1616,9 @@ public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int * * *
    -     * 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.
          * 
    * * @@ -1417,9 +1637,9 @@ public com.google.bigtable.v2.ReadModifyWriteRuleOrBuilder getRulesOrBuilder(int * * *
    -     * 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.
          * 
    * * @@ -1434,9 +1654,9 @@ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder() { * * *
    -     * 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.
          * 
    * * @@ -1451,9 +1671,9 @@ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder(int in * * *
    -     * 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.
          * 
    * * @@ -1476,7 +1696,7 @@ public com.google.bigtable.v2.ReadModifyWriteRule.Builder addRulesBuilder(int in 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_; @@ -1514,7 +1734,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..bc23948373 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ReadModifyWriteRowRequestOrBuilder @@ -27,14 +28,15 @@ 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. @@ -44,20 +46,58 @@ 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 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(); + /** * * @@ -89,7 +129,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 +143,9 @@ 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.
        * 
    * * @@ -116,9 +157,9 @@ 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.
        * 
    * * @@ -130,9 +171,9 @@ 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.
        * 
    * * @@ -144,9 +185,9 @@ 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.
        * 
    * * @@ -159,9 +200,9 @@ 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.
        * 
    * * 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..834d8414b8 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,62 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ReadModifyWriteRowResponse(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.BigtableProto .internal_static_google_bigtable_v2_ReadModifyWriteRowResponse_descriptor; @@ -116,6 +61,7 @@ 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,7 +77,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { */ @java.lang.Override public boolean hasRow() { - return row_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -159,7 +105,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 +122,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 +134,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 +157,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 +172,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; } @@ -365,16 +311,18 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRowFieldBuilder(); + } } @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,15 +352,23 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.ReadModifyWriteRowResponse result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.row_ = rowBuilder_ == null ? row_ : rowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -462,7 +418,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,21 +433,42 @@ 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(getRowFieldBuilder().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< com.google.bigtable.v2.Row, @@ -510,7 +487,7 @@ public Builder mergeFrom( * @return Whether the row field is set. */ public boolean hasRow() { - return rowBuilder_ != null || row_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -545,11 +522,11 @@ 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,11 +541,11 @@ 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,16 +559,20 @@ 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,14 +585,13 @@ 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,7 +604,7 @@ public Builder clearRow() { * .google.bigtable.v2.Row row = 1; */ public com.google.bigtable.v2.Row.Builder getRowBuilder() { - + bitField0_ |= 0x00000001; onChanged(); return getRowFieldBuilder().getBuilder(); } @@ -701,7 +681,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..9c3114a569 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ReadModifyWriteRowResponseOrBuilder 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 35fe453ea1..e0c694b68c 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -49,72 +50,6 @@ 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; @@ -131,6 +66,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int ruleCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object rule_; public enum RuleCase @@ -178,7 +115,9 @@ 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_ = ""; /** * * @@ -229,7 +168,7 @@ 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; /** * * @@ -354,7 +293,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 @@ -379,7 +318,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 +347,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 +374,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -565,26 +504,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) { 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,19 +545,29 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.ReadModifyWriteRule result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.familyName_ = familyName_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.columnQualifier_ = columnQualifier_; + } + } + + private void buildPartialOneofs(com.google.bigtable.v2.ReadModifyWriteRule result) { + result.ruleCase_ = ruleCase_; + result.rule_ = this.rule_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -674,6 +615,7 @@ 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) { @@ -695,7 +637,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadModifyWriteRule other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -710,17 +652,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,6 +718,8 @@ public Builder clearRule() { return this; } + private int bitField0_; + private java.lang.Object familyName_ = ""; /** * @@ -802,8 +784,8 @@ public Builder setFamilyName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -820,8 +802,8 @@ 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,8 +825,8 @@ public Builder setFamilyNameBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - familyName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -885,8 +867,8 @@ public Builder setColumnQualifier(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - columnQualifier_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -904,7 +886,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; @@ -1043,6 +1025,7 @@ public long getIncrementAmount() { * @return This builder for chaining. */ public Builder setIncrementAmount(long value) { + ruleCase_ = 4; rule_ = value; onChanged(); @@ -1103,7 +1086,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..c3e0b52246 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ReadModifyWriteRuleOrBuilder @@ -125,5 +126,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 5b1b58b6a0..a30fe6d86a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,7 +40,9 @@ private ReadRowsRequest(com.google.protobuf.GeneratedMessageV3.Builder builde private ReadRowsRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; + requestStatsView_ = 0; } @java.lang.Override @@ -48,96 +51,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ReadRowsRequest(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - - 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(); - } - - break; - } - case 32: - { - rowsLimit_ = input.readInt64(); - break; - } - case 42: - { - 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_ReadRowsRequest_descriptor; @@ -153,19 +66,188 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.bigtable.v2.ReadRowsRequest.Builder.class); } + /** + * + * + *
    +   * The desired view into RequestStats that should be returned in the response.
    +   *
    +   * See also: RequestStats message.
    +   * 
    + * + * Protobuf enum {@code google.bigtable.v2.ReadRowsRequest.RequestStatsView} + */ + public enum RequestStatsView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
    +     * The default / unset value. The API will default to the NONE option below.
    +     * 
    + * + * REQUEST_STATS_VIEW_UNSPECIFIED = 0; + */ + REQUEST_STATS_VIEW_UNSPECIFIED(0), + /** + * + * + *
    +     * Do not include any RequestStats in the response. This will leave the
    +     * RequestStats embedded message unset in the response.
    +     * 
    + * + * REQUEST_STATS_NONE = 1; + */ + REQUEST_STATS_NONE(1), + /** + * + * + *
    +     * Include the full set of available RequestStats in the response,
    +     * applicable to this read.
    +     * 
    + * + * REQUEST_STATS_FULL = 2; + */ + REQUEST_STATS_FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
    +     * The default / unset value. The API will default to the NONE option below.
    +     * 
    + * + * REQUEST_STATS_VIEW_UNSPECIFIED = 0; + */ + public static final int REQUEST_STATS_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
    +     * Do not include any RequestStats in the response. This will leave the
    +     * RequestStats embedded message unset in the response.
    +     * 
    + * + * REQUEST_STATS_NONE = 1; + */ + public static final int REQUEST_STATS_NONE_VALUE = 1; + /** + * + * + *
    +     * Include the full set of available RequestStats in the response,
    +     * applicable to this read.
    +     * 
    + * + * REQUEST_STATS_FULL = 2; + */ + public static final int REQUEST_STATS_FULL_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RequestStatsView valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RequestStatsView forNumber(int value) { + switch (value) { + case 0: + return REQUEST_STATS_VIEW_UNSPECIFIED; + case 1: + return REQUEST_STATS_NONE; + case 2: + return REQUEST_STATS_FULL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RequestStatsView findValueByNumber(int number) { + return RequestStatsView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final 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. @@ -186,13 +268,14 @@ public 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. @@ -210,8 +293,71 @@ 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 APP_PROFILE_ID_FIELD_NUMBER = 5; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; /** * * @@ -267,7 +413,8 @@ public com.google.protobuf.ByteString getAppProfileIdBytes() { * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -276,13 +423,14 @@ 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; @@ -297,14 +445,15 @@ public com.google.bigtable.v2.RowSet getRows() { * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; */ @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; @@ -323,7 +472,7 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { */ @java.lang.Override public boolean hasFilter() { - return filter_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -353,16 +502,16 @@ 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,6 +524,72 @@ public long getRowsLimit() { return rowsLimit_; } + public static final int REQUEST_STATS_VIEW_FIELD_NUMBER = 6; + private int requestStatsView_ = 0; + /** + * + * + *
    +   * The view into RequestStats, as described above.
    +   * 
    + * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The enum numeric value on the wire for requestStatsView. + */ + @java.lang.Override + public int getRequestStatsViewValue() { + return requestStatsView_; + } + /** + * + * + *
    +   * The view into RequestStats, as described above.
    +   * 
    + * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The requestStatsView. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest.RequestStatsView getRequestStatsView() { + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView result = + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.forNumber(requestStatsView_); + return result == null + ? com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.UNRECOGNIZED + : result; + } + + public static final int REVERSED_FIELD_NUMBER = 7; + private boolean reversed_ = false; + /** + * + * + *
    +   * Experimental API - Please note that this API is currently experimental
    +   * and can change in the future.
    +   *
    +   * Return rows in lexiographical descending order of the row keys. The row
    +   * contents will not be affected by this flag.
    +   *
    +   * Example result set:
    +   *
    +   *     [
    +   *       {key: "k2", "f:col1": "v1", "f:col2": "v1"},
    +   *       {key: "k1", "f:col1": "v2", "f:col2": "v2"}
    +   *     ]
    +   * 
    + * + * bool reversed = 7; + * + * @return The reversed. + */ + @java.lang.Override + public boolean getReversed() { + return reversed_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -392,10 +607,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableName_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tableName_); } - if (rows_ != null) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getRows()); } - if (filter_ != null) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getFilter()); } if (rowsLimit_ != 0L) { @@ -404,7 +619,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, appProfileId_); } - unknownFields.writeTo(output); + 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.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, authorizedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -416,10 +642,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableName_)) { size += com.google.protobuf.GeneratedMessageV3.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) { @@ -428,7 +654,18 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -444,6 +681,7 @@ 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 (!getAppProfileId().equals(other.getAppProfileId())) return false; if (hasRows() != other.hasRows()) return false; if (hasRows()) { @@ -454,7 +692,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 +707,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(); if (hasRows()) { @@ -479,7 +721,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; } @@ -618,30 +864,32 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRowsFieldBuilder(); + getFilterFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; tableName_ = ""; - + authorizedViewName_ = ""; 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,23 +917,45 @@ 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; } + 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.appProfileId_ = appProfileId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rows_ = rowsBuilder_ == null ? rows_ : rowsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.filter_ = filterBuilder_ == null ? filter_ : filterBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.rowsLimit_ = rowsLimit_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.requestStatsView_ = requestStatsView_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.reversed_ = reversed_; + } + result.bitField0_ |= to_bitField0_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -733,10 +1003,17 @@ 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.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000004; onChanged(); } if (other.hasRows()) { @@ -748,7 +1025,13 @@ 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; } @@ -763,32 +1046,97 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.bigtable.v2.ReadRowsRequest 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: + { + input.readMessage(getRowsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 18 + case 26: + { + input.readMessage(getFilterFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 26 + case 32: + { + rowsLimit_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 32 + case 42: + { + appProfileId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 48: + { + requestStatsView_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 56: + { + reversed_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 56 + 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.ReadRowsRequest) 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 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. @@ -808,13 +1156,14 @@ public 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. @@ -834,13 +1183,14 @@ public com.google.protobuf.ByteString getTableNameBytes() { * * *
    -     * 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) = { ... } * * * @param value The tableName to set. @@ -850,8 +1200,8 @@ public Builder setTableName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -859,20 +1209,21 @@ public Builder setTableName(java.lang.String value) { * * *
    -     * 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 This builder for chaining. */ public Builder clearTableName() { - tableName_ = getDefaultInstance().getTableName(); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -880,13 +1231,14 @@ public Builder clearTableName() { * * *
    -     * 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) = { ... } * * * @param value The bytes for tableName to set. @@ -897,8 +1249,139 @@ 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 read.
    +     *
    +     * Values are of the form
    +     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +     * 
    + * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The authorizedViewName. + */ + public java.lang.String getAuthorizedViewName() { + java.lang.Object ref = authorizedViewName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedViewName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
    +     * Optional. The unique name of the AuthorizedView from which to read.
    +     *
    +     * Values are of the form
    +     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +     * 
    + * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for authorizedViewName. + */ + public com.google.protobuf.ByteString getAuthorizedViewNameBytes() { + java.lang.Object ref = authorizedViewName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + authorizedViewName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
    +     * Optional. The unique name of the AuthorizedView from which to read.
    +     *
    +     * Values are of the form
    +     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +     * 
    + * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + authorizedViewName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
    +     * Optional. The unique name of the AuthorizedView from which to read.
    +     *
    +     * Values are of the form
    +     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +     * 
    + * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizedViewName() { + authorizedViewName_ = getDefaultInstance().getAuthorizedViewName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
    +     * Optional. The unique name of the AuthorizedView from which to read.
    +     *
    +     * Values are of the form
    +     * `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
    +     * 
    + * + * + * string authorized_view_name = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for authorizedViewName to set. + * @return This builder for chaining. + */ + public Builder setAuthorizedViewNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + authorizedViewName_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -967,8 +1450,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -985,8 +1468,8 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -1008,8 +1491,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -1024,7 +1507,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1032,13 +1516,14 @@ 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_ & 0x00000008) != 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; @@ -1056,7 +1541,8 @@ public com.google.bigtable.v2.RowSet getRows() { * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1067,18 +1553,19 @@ public Builder setRows(com.google.bigtable.v2.RowSet value) { throw new NullPointerException(); } rows_ = value; - onChanged(); } else { rowsBuilder_.setMessage(value); } - + bitField0_ |= 0x00000008; + 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,67 +1573,73 @@ 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_ |= 0x00000008; + 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_ & 0x00000008) != 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_ |= 0x00000008; + 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_ & ~0x00000008); + 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_ |= 0x00000008; onChanged(); return getRowsFieldBuilder().getBuilder(); } @@ -1154,7 +1647,8 @@ public com.google.bigtable.v2.RowSet.Builder getRowsBuilder() { * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1170,7 +1664,8 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { * * *
    -     * The row keys and/or ranges to read. If not specified, reads from all rows.
    +     * The row keys and/or ranges to read sequentially. If not specified, reads
    +     * from all rows.
          * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -1211,7 +1706,7 @@ public com.google.bigtable.v2.RowSetOrBuilder getRowsOrBuilder() { * @return Whether the filter field is set. */ public boolean hasFilter() { - return filterBuilder_ != null || filter_ != null; + return ((bitField0_ & 0x00000010) != 0); } /** * @@ -1248,11 +1743,11 @@ public Builder setFilter(com.google.bigtable.v2.RowFilter value) { throw new NullPointerException(); } filter_ = value; - onChanged(); } else { filterBuilder_.setMessage(value); } - + bitField0_ |= 0x00000010; + onChanged(); return this; } /** @@ -1268,11 +1763,11 @@ 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_ |= 0x00000010; + onChanged(); return this; } /** @@ -1287,17 +1782,20 @@ 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_ & 0x00000010) != 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_ |= 0x00000010; + onChanged(); + } return this; } /** @@ -1311,14 +1809,13 @@ 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_ & ~0x00000010); + filter_ = null; + if (filterBuilder_ != null) { + filterBuilder_.dispose(); filterBuilder_ = null; } - + onChanged(); return this; } /** @@ -1332,7 +1829,7 @@ public Builder clearFilter() { * .google.bigtable.v2.RowFilter filter = 3; */ public com.google.bigtable.v2.RowFilter.Builder getFilterBuilder() { - + bitField0_ |= 0x00000010; onChanged(); return getFilterFieldBuilder().getBuilder(); } @@ -1385,7 +1882,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFilterOrBuilder() { * * *
    -     * The read will terminate after committing to N rows' worth of results. The
    +     * The read will stop after committing to N rows' worth of results. The
          * default (zero) is to return all results.
          * 
    * @@ -1401,7 +1898,7 @@ public long getRowsLimit() { * * *
    -     * The read will terminate after committing to N rows' worth of results. The
    +     * The read will stop after committing to N rows' worth of results. The
          * default (zero) is to return all results.
          * 
    * @@ -1413,6 +1910,7 @@ public long getRowsLimit() { public Builder setRowsLimit(long value) { rowsLimit_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -1420,7 +1918,7 @@ public Builder setRowsLimit(long value) { * * *
    -     * The read will terminate after committing to N rows' worth of results. The
    +     * The read will stop after committing to N rows' worth of results. The
          * default (zero) is to return all results.
          * 
    * @@ -1429,12 +1927,191 @@ public Builder setRowsLimit(long value) { * @return This builder for chaining. */ public Builder clearRowsLimit() { - + bitField0_ = (bitField0_ & ~0x00000020); 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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
    +     * The view into RequestStats, as described above.
    +     * 
    + * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @return The requestStatsView. + */ + @java.lang.Override + public com.google.bigtable.v2.ReadRowsRequest.RequestStatsView getRequestStatsView() { + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView result = + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.forNumber(requestStatsView_); + return result == null + ? com.google.bigtable.v2.ReadRowsRequest.RequestStatsView.UNRECOGNIZED + : result; + } + /** + * + * + *
    +     * The view into RequestStats, as described above.
    +     * 
    + * + * .google.bigtable.v2.ReadRowsRequest.RequestStatsView request_stats_view = 6; + * + * @param value The requestStatsView to set. + * @return This builder for chaining. + */ + public Builder setRequestStatsView( + com.google.bigtable.v2.ReadRowsRequest.RequestStatsView value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + 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_ & ~0x00000040); + requestStatsView_ = 0; + onChanged(); + return this; + } + + private boolean reversed_; + /** + * + * + *
    +     * Experimental API - Please note that this API is currently experimental
    +     * and can change in the future.
    +     *
    +     * Return rows in lexiographical descending order of the row keys. The row
    +     * contents will not be affected by this flag.
    +     *
    +     * Example result set:
    +     *
    +     *     [
    +     *       {key: "k2", "f:col1": "v1", "f:col2": "v1"},
    +     *       {key: "k1", "f:col1": "v2", "f:col2": "v2"}
    +     *     ]
    +     * 
    + * + * bool reversed = 7; + * + * @return The reversed. + */ + @java.lang.Override + public boolean getReversed() { + return reversed_; + } + /** + * + * + *
    +     * Experimental API - Please note that this API is currently experimental
    +     * and can change in the future.
    +     *
    +     * Return rows in lexiographical descending order of the row keys. The row
    +     * contents will not be affected by this flag.
    +     *
    +     * Example result set:
    +     *
    +     *     [
    +     *       {key: "k2", "f:col1": "v1", "f:col2": "v1"},
    +     *       {key: "k1", "f:col1": "v2", "f:col2": "v2"}
    +     *     ]
    +     * 
    + * + * bool reversed = 7; + * + * @param value The reversed to set. + * @return This builder for chaining. + */ + public Builder setReversed(boolean value) { + + reversed_ = value; + bitField0_ |= 0x00000080; + 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_ & ~0x00000080); + reversed_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -1467,7 +2144,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..deba46ad56 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ReadRowsRequestOrBuilder @@ -27,13 +28,14 @@ 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. @@ -43,19 +45,55 @@ 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 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(); + /** * * @@ -87,7 +125,8 @@ public interface ReadRowsRequestOrBuilder * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -99,7 +138,8 @@ public interface ReadRowsRequestOrBuilder * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -111,7 +151,8 @@ public interface ReadRowsRequestOrBuilder * * *
    -   * The row keys and/or ranges to read. If not specified, reads from all rows.
    +   * The row keys and/or ranges to read sequentially. If not specified, reads
    +   * from all rows.
        * 
    * * .google.bigtable.v2.RowSet rows = 2; @@ -160,7 +201,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 +210,53 @@ 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..792e4f7ed7 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -48,70 +49,6 @@ 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; @@ -411,7 +348,7 @@ public interface CellChunkOrBuilder */ boolean getCommitRow(); - public com.google.bigtable.v2.ReadRowsResponse.CellChunk.RowStatusCase getRowStatusCase(); + com.google.bigtable.v2.ReadRowsResponse.CellChunk.RowStatusCase getRowStatusCase(); } /** * @@ -435,7 +372,7 @@ private CellChunk(com.google.protobuf.GeneratedMessageV3.Builder 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; } @@ -445,124 +382,6 @@ 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; @@ -578,7 +397,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 @@ -626,7 +448,7 @@ 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; /** * * @@ -666,7 +488,7 @@ public com.google.protobuf.ByteString getRowKey() { */ @java.lang.Override public boolean hasFamilyName() { - return familyName_ != null; + return ((bitField0_ & 0x00000001) != 0); } /** * @@ -706,7 +528,9 @@ 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; @@ -728,7 +552,7 @@ public com.google.protobuf.StringValueOrBuilder getFamilyNameOrBuilder() { */ @java.lang.Override public boolean hasQualifier() { - return qualifier_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -764,11 +588,11 @@ 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 +617,10 @@ 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(); /** * * @@ -862,7 +689,7 @@ 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 +711,7 @@ public com.google.protobuf.ByteString getValue() { } public static final int VALUE_SIZE_FIELD_NUMBER = 7; - private int valueSize_; + private int valueSize_ = 0; /** * * @@ -995,10 +822,10 @@ 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) { @@ -1019,7 +846,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 +858,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 +891,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 +931,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 +974,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1289,34 +1116,31 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFamilyNameFieldBuilder(); + getQualifierFieldBuilder(); + } } @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,35 +1170,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_; } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.value_ = value_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.valueSize_ = valueSize_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ReadRowsResponse.CellChunk result) { result.rowStatusCase_ = rowStatusCase_; - onBuilt(); - return result; + result.rowStatus_ = this.rowStatus_; } @java.lang.Override @@ -1440,7 +1277,7 @@ 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_); @@ -1469,7 +1306,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 +1321,86 @@ 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(getFamilyNameFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getQualifierFieldBuilder().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; } @@ -1553,8 +1458,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1573,7 +1478,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; @@ -1602,7 +1507,7 @@ public Builder clearRowKey() { * @return Whether the familyName field is set. */ public boolean hasFamilyName() { - return familyNameBuilder_ != null || familyName_ != null; + return ((bitField0_ & 0x00000002) != 0); } /** * @@ -1649,11 +1554,11 @@ public Builder setFamilyName(com.google.protobuf.StringValue value) { throw new NullPointerException(); } familyName_ = value; - onChanged(); } else { familyNameBuilder_.setMessage(value); } - + bitField0_ |= 0x00000002; + onChanged(); return this; } /** @@ -1673,11 +1578,11 @@ 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,19 +1601,20 @@ 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,14 +1632,13 @@ 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,7 +1656,7 @@ public Builder clearFamilyName() { * .google.protobuf.StringValue family_name = 2; */ public com.google.protobuf.StringValue.Builder getFamilyNameBuilder() { - + bitField0_ |= 0x00000002; onChanged(); return getFamilyNameFieldBuilder().getBuilder(); } @@ -1831,7 +1736,7 @@ 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); } /** * @@ -1876,11 +1781,11 @@ public Builder setQualifier(com.google.protobuf.BytesValue value) { throw new NullPointerException(); } qualifier_ = value; - onChanged(); } else { qualifierBuilder_.setMessage(value); } - + bitField0_ |= 0x00000004; + onChanged(); return this; } /** @@ -1899,11 +1804,11 @@ 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,19 +1826,20 @@ 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,14 +1856,13 @@ 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,7 +1879,7 @@ public Builder clearQualifier() { * .google.protobuf.BytesValue qualifier = 3; */ public com.google.protobuf.BytesValue.Builder getQualifierBuilder() { - + bitField0_ |= 0x00000004; onChanged(); return getQualifierFieldBuilder().getBuilder(); } @@ -2075,6 +1980,7 @@ public long getTimestampMicros() { public Builder setTimestampMicros(long value) { timestampMicros_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } @@ -2097,20 +2003,20 @@ 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,7 +2032,8 @@ private void ensureLabelsIsMutable() { * @return A list containing the labels. */ public com.google.protobuf.ProtocolStringList getLabelsList() { - return labels_.getUnmodifiableView(); + labels_.makeImmutable(); + return labels_; } /** * @@ -2199,6 +2106,7 @@ public Builder setLabels(int index, java.lang.String value) { } ensureLabelsIsMutable(); labels_.set(index, value); + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -2222,6 +2130,7 @@ public Builder addLabels(java.lang.String value) { } ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -2242,6 +2151,7 @@ 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,8 +2169,9 @@ 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,6 +2196,7 @@ public Builder addLabelsBytes(com.google.protobuf.ByteString value) { checkByteStringIsUtf8(value); ensureLabelsIsMutable(); labels_.add(value); + bitField0_ |= 0x00000010; onChanged(); return this; } @@ -2329,8 +2241,8 @@ public Builder setValue(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - value_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } @@ -2350,7 +2262,7 @@ 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; @@ -2393,6 +2305,7 @@ public int getValueSize() { public Builder setValueSize(int value) { valueSize_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } @@ -2411,7 +2324,7 @@ public Builder setValueSize(int value) { * @return This builder for chaining. */ public Builder clearValueSize() { - + bitField0_ = (bitField0_ & ~0x00000040); valueSize_ = 0; onChanged(); return this; @@ -2464,6 +2377,7 @@ public boolean getResetRow() { * @return This builder for chaining. */ public Builder setResetRow(boolean value) { + rowStatusCase_ = 8; rowStatus_ = value; onChanged(); @@ -2537,6 +2451,7 @@ public boolean getCommitRow() { * @return This builder for chaining. */ public Builder setCommitRow(boolean value) { + rowStatusCase_ = 9; rowStatus_ = value; onChanged(); @@ -2596,7 +2511,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,7 +2542,10 @@ 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_; /** * @@ -2685,7 +2615,7 @@ 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 +2638,113 @@ 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, provide enhanced query performance statistics. The semantics
    +   * dictate:
    +   *   * request_stats is empty on every (streamed) response, except
    +   *   * request_stats has non-empty information after all chunks have been
    +   *     streamed, where the ReadRowsResponse message only contains
    +   *     request_stats.
    +   *       * For example, if a read request would have returned an empty
    +   *         response instead a single ReadRowsResponse is streamed with empty
    +   *         chunks and request_stats filled.
    +   *
    +   * Visually, response messages will stream as follows:
    +   *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +   *   \______________________/  \________________________________/
    +   *       Primary response         Trailer of RequestStats info
    +   *
    +   * Or if the read did not return any values:
    +   *   {chunks: [], request_stats: {...}}
    +   *   \________________________________/
    +   *      Trailer of RequestStats info
    +   * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +   * dictate:
    +   *   * request_stats is empty on every (streamed) response, except
    +   *   * request_stats has non-empty information after all chunks have been
    +   *     streamed, where the ReadRowsResponse message only contains
    +   *     request_stats.
    +   *       * For example, if a read request would have returned an empty
    +   *         response instead a single ReadRowsResponse is streamed with empty
    +   *         chunks and request_stats filled.
    +   *
    +   * Visually, response messages will stream as follows:
    +   *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +   *   \______________________/  \________________________________/
    +   *       Primary response         Trailer of RequestStats info
    +   *
    +   * Or if the read did not return any values:
    +   *   {chunks: [], request_stats: {...}}
    +   *   \________________________________/
    +   *      Trailer of RequestStats info
    +   * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +   * dictate:
    +   *   * request_stats is empty on every (streamed) response, except
    +   *   * request_stats has non-empty information after all chunks have been
    +   *     streamed, where the ReadRowsResponse message only contains
    +   *     request_stats.
    +   *       * For example, if a read request would have returned an empty
    +   *         response instead a single ReadRowsResponse is streamed with empty
    +   *         chunks and request_stats filled.
    +   *
    +   * Visually, response messages will stream as follows:
    +   *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +   *   \______________________/  \________________________________/
    +   *       Primary response         Trailer of RequestStats info
    +   *
    +   * Or if the read did not return any values:
    +   *   {chunks: [], request_stats: {...}}
    +   *   \________________________________/
    +   *      Trailer of RequestStats info
    +   * 
    + * + * .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 +2765,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 +2783,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 +2803,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 +2824,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; } @@ -2918,20 +2969,27 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getChunksFieldBuilder(); + getRequestStatsFieldBuilder(); } } @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 +3017,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,9 +3035,20 @@ public com.google.bigtable.v2.ReadRowsResponse buildPartial() { } else { result.chunks_ = chunksBuilder_.build(); } - result.lastScannedRowKey_ = lastScannedRowKey_; - onBuilt(); - return result; + } + + 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 @@ -3049,7 +3126,10 @@ public Builder mergeFrom(com.google.bigtable.v2.ReadRowsResponse other) { if (other.getLastScannedRowKey() != com.google.protobuf.ByteString.EMPTY) { setLastScannedRowKey(other.getLastScannedRowKey()); } - this.mergeUnknownFields(other.unknownFields); + if (other.hasRequestStats()) { + mergeRequestStats(other.getRequestStats()); + } + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3064,17 +3144,57 @@ 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(getRequestStatsFieldBuilder().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; } @@ -3478,8 +3598,8 @@ public Builder setLastScannedRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - lastScannedRowKey_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -3501,12 +3621,368 @@ 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; } + private com.google.bigtable.v2.RequestStats requestStats_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + requestStatsBuilder_; + /** + * + * + *
    +     *
    +     * If requested, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return Whether the requestStats field is set. + */ + public boolean hasRequestStats() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
    +     *
    +     * If requested, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + public com.google.bigtable.v2.RequestStats.Builder getRequestStatsBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getRequestStatsFieldBuilder().getBuilder(); + } + /** + * + * + *
    +     *
    +     * If requested, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .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, provide enhanced query performance statistics. The semantics
    +     * dictate:
    +     *   * request_stats is empty on every (streamed) response, except
    +     *   * request_stats has non-empty information after all chunks have been
    +     *     streamed, where the ReadRowsResponse message only contains
    +     *     request_stats.
    +     *       * For example, if a read request would have returned an empty
    +     *         response instead a single ReadRowsResponse is streamed with empty
    +     *         chunks and request_stats filled.
    +     *
    +     * Visually, response messages will stream as follows:
    +     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +     *   \______________________/  \________________________________/
    +     *       Primary response         Trailer of RequestStats info
    +     *
    +     * Or if the read did not return any values:
    +     *   {chunks: [], request_stats: {...}}
    +     *   \________________________________/
    +     *      Trailer of RequestStats info
    +     * 
    + * + * .google.bigtable.v2.RequestStats request_stats = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder> + getRequestStatsFieldBuilder() { + if (requestStatsBuilder_ == null) { + requestStatsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RequestStats, + com.google.bigtable.v2.RequestStats.Builder, + com.google.bigtable.v2.RequestStatsOrBuilder>( + getRequestStats(), getParentForChildren(), isClean()); + requestStats_ = null; + } + return requestStatsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); @@ -3539,7 +4015,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..84a8f0f9b2 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ReadRowsResponseOrBuilder @@ -93,4 +94,96 @@ public interface ReadRowsResponseOrBuilder * @return The lastScannedRowKey. */ com.google.protobuf.ByteString getLastScannedRowKey(); + + /** + * + * + *
    +   *
    +   * If requested, provide enhanced query performance statistics. The semantics
    +   * dictate:
    +   *   * request_stats is empty on every (streamed) response, except
    +   *   * request_stats has non-empty information after all chunks have been
    +   *     streamed, where the ReadRowsResponse message only contains
    +   *     request_stats.
    +   *       * For example, if a read request would have returned an empty
    +   *         response instead a single ReadRowsResponse is streamed with empty
    +   *         chunks and request_stats filled.
    +   *
    +   * Visually, response messages will stream as follows:
    +   *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +   *   \______________________/  \________________________________/
    +   *       Primary response         Trailer of RequestStats info
    +   *
    +   * Or if the read did not return any values:
    +   *   {chunks: [], request_stats: {...}}
    +   *   \________________________________/
    +   *      Trailer of RequestStats info
    +   * 
    + * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return Whether the requestStats field is set. + */ + boolean hasRequestStats(); + /** + * + * + *
    +   *
    +   * If requested, provide enhanced query performance statistics. The semantics
    +   * dictate:
    +   *   * request_stats is empty on every (streamed) response, except
    +   *   * request_stats has non-empty information after all chunks have been
    +   *     streamed, where the ReadRowsResponse message only contains
    +   *     request_stats.
    +   *       * For example, if a read request would have returned an empty
    +   *         response instead a single ReadRowsResponse is streamed with empty
    +   *         chunks and request_stats filled.
    +   *
    +   * Visually, response messages will stream as follows:
    +   *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +   *   \______________________/  \________________________________/
    +   *       Primary response         Trailer of RequestStats info
    +   *
    +   * Or if the read did not return any values:
    +   *   {chunks: [], request_stats: {...}}
    +   *   \________________________________/
    +   *      Trailer of RequestStats info
    +   * 
    + * + * .google.bigtable.v2.RequestStats request_stats = 3; + * + * @return The requestStats. + */ + com.google.bigtable.v2.RequestStats getRequestStats(); + /** + * + * + *
    +   *
    +   * If requested, provide enhanced query performance statistics. The semantics
    +   * dictate:
    +   *   * request_stats is empty on every (streamed) response, except
    +   *   * request_stats has non-empty information after all chunks have been
    +   *     streamed, where the ReadRowsResponse message only contains
    +   *     request_stats.
    +   *       * For example, if a read request would have returned an empty
    +   *         response instead a single ReadRowsResponse is streamed with empty
    +   *         chunks and request_stats filled.
    +   *
    +   * Visually, response messages will stream as follows:
    +   *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
    +   *   \______________________/  \________________________________/
    +   *       Primary response         Trailer of RequestStats info
    +   *
    +   * Or if the read did not return any values:
    +   *   {chunks: [], request_stats: {...}}
    +   *   \________________________________/
    +   *      Trailer of RequestStats info
    +   * 
    + * + * .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..b3ebf87e65 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStats.java @@ -0,0 +1,921 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class RequestLatencyStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RequestLatencyStats) + RequestLatencyStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use RequestLatencyStats.newBuilder() to construct. + private RequestLatencyStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RequestLatencyStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestLatencyStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFrontendServerLatencyFieldBuilder(); + } + } + + @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 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.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( + getFrontendServerLatencyFieldBuilder().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.SingleFieldBuilderV3< + 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 getFrontendServerLatencyFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getFrontendServerLatencyFieldBuilder() { + if (frontendServerLatencyBuilder_ == null) { + frontendServerLatencyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getFrontendServerLatency(), getParentForChildren(), isClean()); + frontendServerLatency_ = null; + } + return frontendServerLatencyBuilder_; + } + + @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.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..9fcea828aa --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestLatencyStatsOrBuilder.java @@ -0,0 +1,109 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..9ab3ef48a5 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStats.java @@ -0,0 +1,832 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +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, there are the following supported methods:
    + *   * google.bigtable.v2.ReadRows
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.RequestStats} + */ +public final class RequestStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.RequestStats) + RequestStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use RequestStats.newBuilder() to construct. + private RequestStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RequestStats() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.RequestStats parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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, there are the following supported methods:
    +   *   * google.bigtable.v2.ReadRows
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.RequestStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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( + getFullReadStatsViewFieldBuilder().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.SingleFieldBuilderV3< + 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 getFullReadStatsViewFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.FullReadStatsView, + com.google.bigtable.v2.FullReadStatsView.Builder, + com.google.bigtable.v2.FullReadStatsViewOrBuilder> + getFullReadStatsViewFieldBuilder() { + if (fullReadStatsViewBuilder_ == null) { + if (!(statsViewCase_ == 1)) { + statsView_ = com.google.bigtable.v2.FullReadStatsView.getDefaultInstance(); + } + fullReadStatsViewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..163dc30674 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsOrBuilder.java @@ -0,0 +1,66 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..fd80fccbf7 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/RequestStatsProto.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/request_stats.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public final class RequestStatsProto { + private 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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().getMessageTypes().get(0); + internal_static_google_bigtable_v2_ReadIterationStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ReadIterationStats_descriptor, + new java.lang.String[] { + "RowsSeenCount", "RowsReturnedCount", "CellsSeenCount", "CellsReturnedCount", + }); + internal_static_google_bigtable_v2_RequestLatencyStats_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_bigtable_v2_RequestLatencyStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_RequestLatencyStats_descriptor, + new java.lang.String[] { + "FrontendServerLatency", + }); + internal_static_google_bigtable_v2_FullReadStatsView_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_bigtable_v2_FullReadStatsView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_FullReadStatsView_descriptor, + new java.lang.String[] { + "ReadIterationStats", "RequestLatencyStats", + }); + internal_static_google_bigtable_v2_RequestStats_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_bigtable_v2_RequestStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_RequestStats_descriptor, + new java.lang.String[] { + "FullReadStatsView", "StatsView", + }); + 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..6632653629 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParams.java @@ -0,0 +1,892 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/response_params.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Response metadata proto
    + * This is an experimental feature that will be used to get zone_id and
    + * cluster_id from response trailers to tag the metrics. This should not be
    + * used by customers directly
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ResponseParams} + */ +public final class ResponseParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ResponseParams) + ResponseParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResponseParams.newBuilder() to construct. + private ResponseParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResponseParams() { + zoneId_ = ""; + clusterId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResponseParams(); + } + + 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.GeneratedMessageV3.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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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.GeneratedMessageV3.writeString(output, 1, zoneId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterId_); + } + 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.GeneratedMessageV3.computeStringSize(1, zoneId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterId_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!getUnknownFields().equals(other.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(); + } + 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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ResponseParams parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +   * Response metadata proto
    +   * This is an experimental feature that will be used to get zone_id and
    +   * cluster_id from response trailers to tag the metrics. This should not be
    +   * used by customers directly
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.ResponseParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zoneId_ = ""; + clusterId_ = ""; + 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; + } + result.bitField0_ |= to_bitField0_; + } + + @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.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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; + } + + @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.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..e387449bff --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/response_params.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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(); +} 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..634cfad298 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResponseParamsProto.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/response_params.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public final class ResponseParamsProto { + private 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.GeneratedMessageV3.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.pro" + + "to\022\022google.bigtable.v2\"Z\n\016ResponseParams" + + "\022\024\n\007zone_id\030\001 \001(\tH\000\210\001\001\022\027\n\ncluster_id\030\002 \001" + + "(\tH\001\210\001\001B\n\n\010_zone_idB\r\n\013_cluster_idB\275\001\n\026c" + + "om.google.bigtable.v2B\023ResponseParamsPro" + + "toP\001Z8cloud.google.com/go/bigtable/apiv2" + + "/bigtablepb;bigtablepb\252\002\030Google.Cloud.Bi" + + "gtable.V2\312\002\030Google\\Cloud\\Bigtable\\V2\352\002\033G" + + "oogle::Cloud::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().getMessageTypes().get(0); + internal_static_google_bigtable_v2_ResponseParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_ResponseParams_descriptor, + new java.lang.String[] { + "ZoneId", "ClusterId", + }); + } + + // @@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..a667054f63 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadata.java @@ -0,0 +1,812 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +/** + * + * + *
    + * Describes the structure of a Bigtable result set.
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.ResultSetMetadata} + */ +public final class ResultSetMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.ResultSetMetadata) + ResultSetMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResultSetMetadata.newBuilder() to construct. + private ResultSetMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResultSetMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.ResultSetMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getProtoSchemaFieldBuilder().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.SingleFieldBuilderV3< + 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 getProtoSchemaFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ProtoSchema, + com.google.bigtable.v2.ProtoSchema.Builder, + com.google.bigtable.v2.ProtoSchemaOrBuilder> + getProtoSchemaFieldBuilder() { + if (protoSchemaBuilder_ == null) { + if (!(schemaCase_ == 1)) { + schema_ = com.google.bigtable.v2.ProtoSchema.getDefaultInstance(); + } + protoSchemaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..4aa0bdbce6 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ResultSetMetadataOrBuilder.java @@ -0,0 +1,63 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..b1e88b1f2a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -49,67 +50,6 @@ 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; } @@ -124,7 +64,7 @@ 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,6 +84,8 @@ public com.google.protobuf.ByteString getKey() { } public static final int FAMILIES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List families_; /** * @@ -237,7 +179,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 +194,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 +211,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 +228,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; } @@ -413,32 +355,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) { 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,19 +398,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; + } + + private void buildPartial0(com.google.bigtable.v2.Row result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.key_ = key_; + } } @java.lang.Override @@ -531,7 +477,7 @@ public Builder mergeFrom(com.google.bigtable.v2.Row other) { if (!other.families_.isEmpty()) { if (families_.isEmpty()) { families_ = other.families_; - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureFamiliesIsMutable(); families_.addAll(other.families_); @@ -544,7 +490,7 @@ 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() @@ -554,7 +500,7 @@ public Builder mergeFrom(com.google.bigtable.v2.Row other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -569,17 +515,49 @@ 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; } @@ -621,8 +599,8 @@ public Builder setKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - key_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -640,7 +618,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,9 +628,9 @@ 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; } } @@ -876,7 +854,7 @@ public Builder addAllFamilies( public Builder clearFamilies() { if (familiesBuilder_ == null) { families_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { familiesBuilder_.clear(); @@ -1004,7 +982,7 @@ public java.util.List getFamiliesBuilderL 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_; @@ -1042,7 +1020,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..a28f84adb9 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -29,9 +30,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,14 +44,17 @@ * `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. * * @@ -72,222 +78,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new RowFilter(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowFilter_descriptor; } @@ -396,63 +186,6 @@ 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; @@ -469,6 +202,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } public static final int FILTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") private java.util.List filters_; /** * @@ -564,7 +299,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 +311,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 +327,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 +342,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; } @@ -738,30 +473,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) { 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 +517,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,8 +535,10 @@ public com.google.bigtable.v2.RowFilter.Chain buildPartial() { } else { result.filters_ = filtersBuilder_.build(); } - onBuilt(); - return result; + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter.Chain result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -877,7 +615,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Chain other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -892,17 +630,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; } @@ -1325,7 +1090,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,6 +1135,7 @@ 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 * | * ----------------------------------------------------- @@ -1375,6 +1153,7 @@ public interface InterleaveOrBuilder * 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. * * @@ -1390,6 +1169,7 @@ 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 * | * ----------------------------------------------------- @@ -1407,6 +1187,7 @@ public interface InterleaveOrBuilder * 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. * * @@ -1422,6 +1203,7 @@ 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 * | * ----------------------------------------------------- @@ -1439,6 +1221,7 @@ public interface InterleaveOrBuilder * 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. * * @@ -1454,6 +1237,7 @@ 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 * | * ----------------------------------------------------- @@ -1471,6 +1255,7 @@ public interface InterleaveOrBuilder * 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. * * @@ -1486,6 +1271,7 @@ 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 * | * ----------------------------------------------------- @@ -1503,6 +1289,7 @@ public interface InterleaveOrBuilder * 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. * * @@ -1540,63 +1327,6 @@ 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; @@ -1613,6 +1343,8 @@ 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,6 +1355,7 @@ 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 * | * ----------------------------------------------------- @@ -1640,6 +1373,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * 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. * * @@ -1658,6 +1392,7 @@ 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 * | * ----------------------------------------------------- @@ -1675,6 +1410,7 @@ public java.util.List getFiltersList() { * 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. * * @@ -1694,6 +1430,7 @@ 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 * | * ----------------------------------------------------- @@ -1711,6 +1448,7 @@ public java.util.List getFiltersList() { * 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. * * @@ -1729,6 +1467,7 @@ 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 * | * ----------------------------------------------------- @@ -1746,6 +1485,7 @@ public int getFiltersCount() { * 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. * * @@ -1764,6 +1504,7 @@ 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 * | * ----------------------------------------------------- @@ -1781,6 +1522,7 @@ public com.google.bigtable.v2.RowFilter getFilters(int index) { * 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 +1550,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 +1562,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 +1579,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 +1594,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; } @@ -1984,30 +1726,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) { 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 +1770,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,8 +1788,10 @@ public com.google.bigtable.v2.RowFilter.Interleave buildPartial() { } else { result.filters_ = filtersBuilder_.build(); } - onBuilt(); - return result; + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter.Interleave result) { + int from_bitField0_ = bitField0_; } @java.lang.Override @@ -2123,7 +1868,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter.Interleave other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2138,17 +1883,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; } @@ -2179,6 +1951,7 @@ 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 * | * ----------------------------------------------------- @@ -2196,6 +1969,7 @@ private void ensureFiltersIsMutable() { * 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. * * @@ -2217,6 +1991,7 @@ 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 * | * ----------------------------------------------------- @@ -2234,6 +2009,7 @@ public java.util.List getFiltersList() { * 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. * * @@ -2255,6 +2031,7 @@ 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 * | * ----------------------------------------------------- @@ -2272,6 +2049,7 @@ public int getFiltersCount() { * 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. * * @@ -2293,6 +2071,7 @@ 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 * | * ----------------------------------------------------- @@ -2310,6 +2089,7 @@ public com.google.bigtable.v2.RowFilter getFilters(int index) { * 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. * * @@ -2337,6 +2117,7 @@ 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 * | * ----------------------------------------------------- @@ -2354,6 +2135,7 @@ public Builder setFilters(int index, com.google.bigtable.v2.RowFilter value) { * 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. * * @@ -2379,6 +2161,7 @@ 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 * | * ----------------------------------------------------- @@ -2396,6 +2179,7 @@ public Builder setFilters( * 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. * * @@ -2423,6 +2207,7 @@ 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 * | * ----------------------------------------------------- @@ -2440,6 +2225,7 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter value) { * 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. * * @@ -2467,6 +2253,7 @@ 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 * | * ----------------------------------------------------- @@ -2484,6 +2271,7 @@ public Builder addFilters(int index, com.google.bigtable.v2.RowFilter value) { * 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. * * @@ -2508,6 +2296,7 @@ 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 * | * ----------------------------------------------------- @@ -2525,6 +2314,7 @@ public Builder addFilters(com.google.bigtable.v2.RowFilter.Builder builderForVal * 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. * * @@ -2550,6 +2340,7 @@ 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 * | * ----------------------------------------------------- @@ -2567,6 +2358,7 @@ public Builder addFilters( * 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. * * @@ -2592,6 +2384,7 @@ 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 * | * ----------------------------------------------------- @@ -2609,6 +2402,7 @@ public Builder addAllFilters( * 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. * * @@ -2633,6 +2427,7 @@ 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 * | * ----------------------------------------------------- @@ -2650,6 +2445,7 @@ public Builder clearFilters() { * 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. * * @@ -2674,6 +2470,7 @@ 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 * | * ----------------------------------------------------- @@ -2691,6 +2488,7 @@ public Builder removeFilters(int index) { * 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. * * @@ -2708,6 +2506,7 @@ 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 * | * ----------------------------------------------------- @@ -2725,6 +2524,7 @@ public com.google.bigtable.v2.RowFilter.Builder getFiltersBuilder(int index) { * 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. * * @@ -2746,6 +2546,7 @@ 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 * | * ----------------------------------------------------- @@ -2763,6 +2564,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) * 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. * * @@ -2785,6 +2587,7 @@ 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 * | * ----------------------------------------------------- @@ -2802,6 +2605,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getFiltersOrBuilder(int index) * 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. * * @@ -2820,6 +2624,7 @@ 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 * | * ----------------------------------------------------- @@ -2837,6 +2642,7 @@ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder() { * 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. * * @@ -2855,6 +2661,7 @@ 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 * | * ----------------------------------------------------- @@ -2872,6 +2679,7 @@ public com.google.bigtable.v2.RowFilter.Builder addFiltersBuilder(int index) { * 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. * * @@ -2931,7 +2739,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(); } }; @@ -3078,6 +2898,7 @@ public interface ConditionOrBuilder *
        * 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
    @@ -3104,93 +2925,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
           return new Condition();
         }
     
    -    @java.lang.Override
    -    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    -      return this.unknownFields;
    -    }
    -
    -    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();
    -      }
    -    }
    -
         public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
           return com.google.bigtable.v2.DataProto
               .internal_static_google_bigtable_v2_RowFilter_Condition_descriptor;
    @@ -3206,6 +2940,7 @@ 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,7 +2957,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
          */
         @java.lang.Override
         public boolean hasPredicateFilter() {
    -      return predicateFilter_ != null;
    +      return ((bitField0_ & 0x00000001) != 0);
         }
         /**
          *
    @@ -3254,7 +2989,9 @@ 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;
    @@ -3273,7 +3010,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getPredicateFilterOrBuilder() {
          */
         @java.lang.Override
         public boolean hasTrueFilter() {
    -      return trueFilter_ != null;
    +      return ((bitField0_ & 0x00000002) != 0);
         }
         /**
          *
    @@ -3305,7 +3042,9 @@ 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;
    @@ -3325,7 +3064,7 @@ public com.google.bigtable.v2.RowFilterOrBuilder getTrueFilterOrBuilder() {
          */
         @java.lang.Override
         public boolean hasFalseFilter() {
    -      return falseFilter_ != null;
    +      return ((bitField0_ & 0x00000004) != 0);
         }
         /**
          *
    @@ -3359,7 +3098,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 +3117,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 +3135,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 +3172,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 +3195,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;
         }
    @@ -3561,6 +3302,7 @@ protected Builder newBuilderForType(
          * 
          * 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
    @@ -3600,28 +3342,30 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
           }
     
           private void maybeForceBuilderInitialization() {
    -        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    +        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
    +          getPredicateFilterFieldBuilder();
    +          getTrueFilterFieldBuilder();
    +          getFalseFilterFieldBuilder();
    +        }
           }
     
           @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;
    @@ -3651,25 +3395,34 @@ public com.google.bigtable.v2.RowFilter.Condition build() {
           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();
    +        if (bitField0_ != 0) {
    +          buildPartial0(result);
             }
             onBuilt();
             return result;
           }
     
    +      private void buildPartial0(com.google.bigtable.v2.RowFilter.Condition result) {
    +        int from_bitField0_ = bitField0_;
    +        int to_bitField0_ = 0;
    +        if (((from_bitField0_ & 0x00000001) != 0)) {
    +          result.predicateFilter_ =
    +              predicateFilterBuilder_ == null ? predicateFilter_ : predicateFilterBuilder_.build();
    +          to_bitField0_ |= 0x00000001;
    +        }
    +        if (((from_bitField0_ & 0x00000002) != 0)) {
    +          result.trueFilter_ =
    +              trueFilterBuilder_ == null ? trueFilter_ : trueFilterBuilder_.build();
    +          to_bitField0_ |= 0x00000002;
    +        }
    +        if (((from_bitField0_ & 0x00000004) != 0)) {
    +          result.falseFilter_ =
    +              falseFilterBuilder_ == null ? falseFilter_ : falseFilterBuilder_.build();
    +          to_bitField0_ |= 0x00000004;
    +        }
    +        result.bitField0_ |= to_bitField0_;
    +      }
    +
           @java.lang.Override
           public Builder clone() {
             return super.clone();
    @@ -3726,7 +3479,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,20 +3494,55 @@ 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(
    +                      getPredicateFilterFieldBuilder().getBuilder(), extensionRegistry);
    +                  bitField0_ |= 0x00000001;
    +                  break;
    +                } // case 10
    +              case 18:
    +                {
    +                  input.readMessage(getTrueFilterFieldBuilder().getBuilder(), extensionRegistry);
    +                  bitField0_ |= 0x00000002;
    +                  break;
    +                } // case 18
    +              case 26:
    +                {
    +                  input.readMessage(getFalseFilterFieldBuilder().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<
                   com.google.bigtable.v2.RowFilter,
    @@ -3774,7 +3562,7 @@ public Builder mergeFrom(
            * @return Whether the predicateFilter field is set.
            */
           public boolean hasPredicateFilter() {
    -        return predicateFilterBuilder_ != null || predicateFilter_ != null;
    +        return ((bitField0_ & 0x00000001) != 0);
           }
           /**
            *
    @@ -3813,11 +3601,11 @@ 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,11 +3621,11 @@ 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,19 +3640,20 @@ 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,14 +3667,13 @@ 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,7 +3687,7 @@ public Builder clearPredicateFilter() {
            * .google.bigtable.v2.RowFilter predicate_filter = 1;
            */
           public com.google.bigtable.v2.RowFilter.Builder getPredicateFilterBuilder() {
    -
    +        bitField0_ |= 0x00000001;
             onChanged();
             return getPredicateFilterFieldBuilder().getBuilder();
           }
    @@ -3968,7 +3756,7 @@ 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);
           }
           /**
            *
    @@ -4007,11 +3795,11 @@ 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,11 +3815,11 @@ 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,19 +3834,20 @@ 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,14 +3861,13 @@ 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,7 +3881,7 @@ public Builder clearTrueFilter() {
            * .google.bigtable.v2.RowFilter true_filter = 2;
            */
           public com.google.bigtable.v2.RowFilter.Builder getTrueFilterBuilder() {
    -
    +        bitField0_ |= 0x00000002;
             onChanged();
             return getTrueFilterFieldBuilder().getBuilder();
           }
    @@ -4163,7 +3951,7 @@ 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);
           }
           /**
            *
    @@ -4204,11 +3992,11 @@ 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,11 +4013,11 @@ 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,19 +4033,20 @@ 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,14 +4061,13 @@ 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,7 +4082,7 @@ public Builder clearFalseFilter() {
            * .google.bigtable.v2.RowFilter false_filter = 3;
            */
           public com.google.bigtable.v2.RowFilter.Builder getFalseFilterBuilder() {
    -
    +        bitField0_ |= 0x00000004;
             onChanged();
             return getFalseFilterFieldBuilder().getBuilder();
           }
    @@ -4379,7 +4167,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 +4199,8 @@ public com.google.bigtable.v2.RowFilter.Condition getDefaultInstanceForType() {
       }
     
       private int filterCase_ = 0;
    +
    +  @SuppressWarnings("serial")
       private java.lang.Object filter_;
     
       public enum FilterCase
    @@ -4667,6 +4469,7 @@ 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(
    @@ -4675,6 +4478,7 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder
        *       ),
        *       QualifierRegex("B")
        *     )
    +   *
        *                         A,A,1,w
        *                         A,B,2,x
        *                         B,B,4,z
    @@ -4707,14 +4511,17 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder
        *                         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].
        * 
    @@ -4735,6 +4542,7 @@ 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( @@ -4743,6 +4551,7 @@ public boolean hasSink() { * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -4775,14 +4584,17 @@ public boolean hasSink() { * 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]. *
    @@ -5449,8 +5261,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 @@ -5473,8 +5287,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 @@ -5510,8 +5326,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 @@ -5612,7 +5430,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (filterCase_ == 19) { com.google.protobuf.GeneratedMessageV3.writeString(output, 19, filter_); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -5712,7 +5530,7 @@ public int getSerializedSize() { if (filterCase_ == 19) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, filter_); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -5791,7 +5609,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 +5703,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -5995,9 +5813,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,14 +5827,17 @@ 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. * * @@ -6040,22 +5863,34 @@ 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) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; + if (chainBuilder_ != null) { + chainBuilder_.clear(); + } + if (interleaveBuilder_ != null) { + interleaveBuilder_.clear(); + } + if (conditionBuilder_ != null) { + conditionBuilder_.clear(); + } + if (columnRangeFilterBuilder_ != null) { + columnRangeFilterBuilder_.clear(); + } + if (timestampRangeFilterBuilder_ != null) { + timestampRangeFilterBuilder_.clear(); + } + if (valueRangeFilterBuilder_ != null) { + valueRangeFilterBuilder_.clear(); + } filterCase_ = 0; filter_ = null; return this; @@ -6084,90 +5919,39 @@ public com.google.bigtable.v2.RowFilter build() { @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 (bitField0_ != 0) { + buildPartial0(result); } - if (filterCase_ == 15) { - if (valueRangeFilterBuilder_ == null) { - result.filter_ = filter_; - } else { - result.filter_ = valueRangeFilterBuilder_.build(); - } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.bigtable.v2.RowFilter result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.RowFilter result) { + result.filterCase_ = filterCase_; + result.filter_ = this.filter_; + if (filterCase_ == 1 && chainBuilder_ != null) { + result.filter_ = chainBuilder_.build(); } - if (filterCase_ == 10) { - result.filter_ = filter_; + if (filterCase_ == 2 && interleaveBuilder_ != null) { + result.filter_ = interleaveBuilder_.build(); } - if (filterCase_ == 11) { - result.filter_ = filter_; + if (filterCase_ == 3 && conditionBuilder_ != null) { + result.filter_ = conditionBuilder_.build(); } - if (filterCase_ == 12) { - result.filter_ = filter_; + if (filterCase_ == 7 && columnRangeFilterBuilder_ != null) { + result.filter_ = columnRangeFilterBuilder_.build(); } - if (filterCase_ == 13) { - result.filter_ = filter_; + if (filterCase_ == 8 && timestampRangeFilterBuilder_ != null) { + result.filter_ = timestampRangeFilterBuilder_.build(); } - if (filterCase_ == 19) { - result.filter_ = filter_; + if (filterCase_ == 15 && valueRangeFilterBuilder_ != null) { + result.filter_ = valueRangeFilterBuilder_.build(); } - result.filterCase_ = filterCase_; - onBuilt(); - return result; } @java.lang.Override @@ -6320,7 +6104,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowFilter other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -6335,17 +6119,150 @@ 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(getChainFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getInterleaveFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getConditionFieldBuilder().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( + getColumnRangeFilterFieldBuilder().getBuilder(), extensionRegistry); + filterCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage( + getTimestampRangeFilterFieldBuilder().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( + getValueRangeFilterFieldBuilder().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,6 +6280,8 @@ public Builder clearFilter() { return this; } + private int bitField0_; + private com.google.protobuf.SingleFieldBuilderV3< com.google.bigtable.v2.RowFilter.Chain, com.google.bigtable.v2.RowFilter.Chain.Builder, @@ -6479,8 +6398,9 @@ 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; @@ -6576,7 +6496,6 @@ public com.google.bigtable.v2.RowFilter.ChainOrBuilder getChainOrBuilder() { } filterCase_ = 1; onChanged(); - ; return chainBuilder_; } @@ -6697,8 +6616,9 @@ 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; @@ -6794,7 +6714,6 @@ public com.google.bigtable.v2.RowFilter.InterleaveOrBuilder getInterleaveOrBuild } filterCase_ = 2; onChanged(); - ; return interleaveBuilder_; } @@ -6915,8 +6834,9 @@ 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; @@ -7012,7 +6932,6 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder } filterCase_ = 3; onChanged(); - ; return conditionBuilder_; } @@ -7024,6 +6943,7 @@ 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( @@ -7032,6 +6952,7 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -7064,14 +6985,17 @@ public com.google.bigtable.v2.RowFilter.ConditionOrBuilder getConditionOrBuilder * 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]. * @@ -7091,6 +7015,7 @@ 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( @@ -7099,6 +7024,7 @@ public boolean hasSink() { * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -7131,14 +7057,17 @@ public boolean hasSink() { * 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]. * @@ -7161,6 +7090,7 @@ 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( @@ -7169,6 +7099,7 @@ public boolean getSink() { * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -7201,14 +7132,17 @@ public boolean getSink() { * 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,6 +7153,7 @@ public boolean getSink() { * @return This builder for chaining. */ public Builder setSink(boolean value) { + filterCase_ = 16; filter_ = value; onChanged(); @@ -7232,6 +7167,7 @@ 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( @@ -7240,6 +7176,7 @@ public Builder setSink(boolean value) { * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -7272,14 +7209,17 @@ public Builder setSink(boolean value) { * 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]. * @@ -7344,6 +7284,7 @@ public boolean getPassAllFilter() { * @return This builder for chaining. */ public Builder setPassAllFilter(boolean value) { + filterCase_ = 17; filter_ = value; onChanged(); @@ -7417,6 +7358,7 @@ public boolean getBlockAllFilter() { * @return This builder for chaining. */ public Builder setBlockAllFilter(boolean value) { + filterCase_ = 18; filter_ = value; onChanged(); @@ -7586,6 +7528,7 @@ public double getRowSampleFilter() { * @return This builder for chaining. */ public Builder setRowSampleFilter(double value) { + filterCase_ = 14; filter_ = value; onChanged(); @@ -7980,8 +7923,9 @@ 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; @@ -8071,7 +8015,6 @@ public com.google.bigtable.v2.ColumnRangeOrBuilder getColumnRangeFilterOrBuilder } filterCase_ = 7; onChanged(); - ; return columnRangeFilterBuilder_; } @@ -8187,8 +8130,9 @@ 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; @@ -8278,7 +8222,6 @@ public com.google.bigtable.v2.TimestampRangeOrBuilder getTimestampRangeFilterOrB } filterCase_ = 8; onChanged(); - ; return timestampRangeFilterBuilder_; } @@ -8481,8 +8424,9 @@ 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; @@ -8572,7 +8516,6 @@ public com.google.bigtable.v2.ValueRangeOrBuilder getValueRangeFilterOrBuilder() } filterCase_ = 15; onChanged(); - ; return valueRangeFilterBuilder_; } @@ -8626,6 +8569,7 @@ public int getCellsPerRowOffsetFilter() { * @return This builder for chaining. */ public Builder setCellsPerRowOffsetFilter(int value) { + filterCase_ = 10; filter_ = value; onChanged(); @@ -8703,6 +8647,7 @@ public int getCellsPerRowLimitFilter() { * @return This builder for chaining. */ public Builder setCellsPerRowLimitFilter(int value) { + filterCase_ = 11; filter_ = value; onChanged(); @@ -8789,6 +8734,7 @@ public int getCellsPerColumnLimitFilter() { * @return This builder for chaining. */ public Builder setCellsPerColumnLimitFilter(int value) { + filterCase_ = 12; filter_ = value; onChanged(); @@ -8863,6 +8809,7 @@ public boolean getStripValueTransformer() { * @return This builder for chaining. */ public Builder setStripValueTransformer(boolean value) { + filterCase_ = 13; filter_ = value; onChanged(); @@ -8895,8 +8842,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 @@ -8920,8 +8869,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 @@ -8958,8 +8909,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 @@ -8996,8 +8949,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 @@ -9027,8 +8982,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 @@ -9056,8 +9013,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 @@ -9114,7 +9073,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..19d930e638 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface RowFilterOrBuilder @@ -145,6 +146,7 @@ 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( @@ -153,6 +155,7 @@ public interface RowFilterOrBuilder * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -185,14 +188,17 @@ public interface RowFilterOrBuilder * 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]. * @@ -210,6 +216,7 @@ 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( @@ -218,6 +225,7 @@ public interface RowFilterOrBuilder * ), * QualifierRegex("B") * ) + * * A,A,1,w * A,B,2,x * B,B,4,z @@ -250,14 +258,17 @@ public interface RowFilterOrBuilder * 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]. * @@ -736,8 +747,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 @@ -758,8 +771,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 @@ -780,8 +795,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 +813,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..f8554d3d4a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface RowOrBuilder 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..5bf9361033 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,72 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new RowRange(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto.internal_static_google_bigtable_v2_RowRange_descriptor; } @@ -125,6 +60,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int startKeyCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object startKey_; public enum StartKeyCase @@ -172,6 +109,8 @@ public StartKeyCase getStartKeyCase() { } private int endKeyCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object endKey_; public enum EndKeyCase @@ -384,7 +323,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 +352,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 +389,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 +424,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -612,22 +551,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) { 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,24 +591,25 @@ 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 (bitField0_ != 0) { + buildPartial0(result); } - if (endKeyCase_ == 3) { - result.endKey_ = endKey_; - } - if (endKeyCase_ == 4) { - result.endKey_ = endKey_; - } - result.startKeyCase_ = startKeyCase_; - result.endKeyCase_ = endKeyCase_; + buildPartialOneofs(result); onBuilt(); return result; } + private void buildPartial0(com.google.bigtable.v2.RowRange result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.RowRange result) { + result.startKeyCase_ = startKeyCase_; + result.startKey_ = this.startKey_; + result.endKeyCase_ = endKeyCase_; + result.endKey_ = this.endKey_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -753,7 +687,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowRange other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -768,17 +702,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 +782,8 @@ public Builder clearEndKey() { return this; } + private int bitField0_; + /** * * @@ -1130,7 +1104,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..9189169cc4 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface RowRangeOrBuilder @@ -123,7 +124,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..8446494edf 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -38,7 +39,7 @@ private RowSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { } private RowSet() { - rowKeys_ = java.util.Collections.emptyList(); + rowKeys_ = emptyList(com.google.protobuf.ByteString.class); rowRanges_ = java.util.Collections.emptyList(); } @@ -48,74 +49,6 @@ 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; } @@ -130,7 +63,10 @@ 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); /** * * @@ -177,6 +113,8 @@ public com.google.protobuf.ByteString getRowKeys(int index) { } public static final int ROW_RANGES_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") private java.util.List rowRanges_; /** * @@ -265,7 +203,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 +223,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 +240,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 +259,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; } @@ -447,32 +385,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) { 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 +428,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,8 +446,14 @@ public com.google.bigtable.v2.RowSet buildPartial() { } else { result.rowRanges_ = rowRangesBuilder_.build(); } - onBuilt(); - return result; + } + + 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 +504,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_); @@ -599,7 +539,7 @@ public Builder mergeFrom(com.google.bigtable.v2.RowSet other) { } } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -614,30 +554,63 @@ 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,9 +624,8 @@ 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_; } /** * @@ -703,6 +675,7 @@ public Builder setRowKeys(int index, com.google.protobuf.ByteString value) { } ensureRowKeysIsMutable(); rowKeys_.set(index, value); + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -724,6 +697,7 @@ public Builder addRowKeys(com.google.protobuf.ByteString value) { } ensureRowKeysIsMutable(); rowKeys_.add(value); + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -743,6 +717,7 @@ public Builder addAllRowKeys( java.lang.Iterable values) { ensureRowKeysIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rowKeys_); + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -758,7 +733,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; @@ -1144,7 +1119,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..27efb6ea26 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface RowSetOrBuilder 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 5b56fccad4..473b823e52 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -39,6 +40,7 @@ private SampleRowKeysRequest(com.google.protobuf.GeneratedMessageV3.Builder b private SampleRowKeysRequest() { tableName_ = ""; + authorizedViewName_ = ""; appProfileId_ = ""; } @@ -48,62 +50,6 @@ 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; @@ -120,18 +66,21 @@ 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. @@ -152,13 +101,14 @@ public 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. @@ -176,8 +126,73 @@ 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 APP_PROFILE_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object appProfileId_; + + @SuppressWarnings("serial") + private volatile java.lang.Object appProfileId_ = ""; /** * * @@ -247,7 +262,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appProfileId_); } - unknownFields.writeTo(output); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, authorizedViewName_); + } + getUnknownFields().writeTo(output); } @java.lang.Override @@ -262,7 +280,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(appProfileId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appProfileId_); } - size += unknownFields.getSerializedSize(); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(authorizedViewName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, authorizedViewName_); + } + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -279,8 +300,9 @@ 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 (!getAppProfileId().equals(other.getAppProfileId())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -293,9 +315,11 @@ 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 = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -424,26 +448,19 @@ 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) { super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; tableName_ = ""; - + authorizedViewName_ = ""; appProfileId_ = ""; - return this; } @@ -471,12 +488,26 @@ 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; } + 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.appProfileId_ = appProfileId_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -524,13 +555,20 @@ 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.getAppProfileId().isEmpty()) { appProfileId_ = other.appProfileId_; + bitField0_ |= 0x00000004; onChanged(); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -545,32 +583,67 @@ 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_ |= 0x00000004; + break; + } // case 18 + case 34: + { + authorizedViewName_ = input.readStringRequireUtf8(); + 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.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. @@ -590,13 +663,14 @@ public 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. @@ -616,13 +690,14 @@ public com.google.protobuf.ByteString getTableNameBytes() { * * *
    -     * 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,8 +707,8 @@ public Builder setTableName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - tableName_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -641,20 +716,21 @@ public Builder setTableName(java.lang.String value) { * * *
    -     * 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; } @@ -662,13 +738,14 @@ public Builder clearTableName() { * * *
    -     * 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,8 +756,144 @@ 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; } @@ -749,8 +962,8 @@ public Builder setAppProfileId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -767,8 +980,8 @@ public Builder setAppProfileId(java.lang.String value) { * @return This builder for chaining. */ public Builder clearAppProfileId() { - appProfileId_ = getDefaultInstance().getAppProfileId(); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } @@ -790,8 +1003,8 @@ public Builder setAppProfileIdBytes(com.google.protobuf.ByteString value) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - appProfileId_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } @@ -828,7 +1041,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..27517c2092 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface SampleRowKeysRequestOrBuilder @@ -27,13 +28,14 @@ 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. @@ -43,19 +45,57 @@ 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 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(); + /** * * 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..c95bcee61b 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -47,58 +48,6 @@ 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; @@ -115,7 +64,7 @@ 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 +88,7 @@ public com.google.protobuf.ByteString getRowKey() { } public static final int OFFSET_BYTES_FIELD_NUMBER = 2; - private long offsetBytes_; + private long offsetBytes_ = 0L; /** * * @@ -179,7 +128,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 +143,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 +161,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 +176,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; } @@ -356,26 +305,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) { 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,12 +344,23 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.SampleRowKeysResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rowKey_ = rowKey_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.offsetBytes_ = offsetBytes_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -460,7 +412,7 @@ public Builder mergeFrom(com.google.bigtable.v2.SampleRowKeysResponse other) { if (other.getOffsetBytes() != 0L) { setOffsetBytes(other.getOffsetBytes()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -475,20 +427,48 @@ 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; /** * @@ -533,8 +513,8 @@ public Builder setRowKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - rowKey_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -556,7 +536,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; @@ -599,6 +579,7 @@ public long getOffsetBytes() { public Builder setOffsetBytes(long value) { offsetBytes_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -617,7 +598,7 @@ public Builder setOffsetBytes(long value) { * @return This builder for chaining. */ public Builder clearOffsetBytes() { - + bitField0_ = (bitField0_ & ~0x00000002); offsetBytes_ = 0L; onChanged(); return this; @@ -655,7 +636,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..80f64078be 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/bigtable.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface SampleRowKeysResponseOrBuilder 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..f8bfc6e0ce --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationToken.java @@ -0,0 +1,907 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class StreamContinuationToken extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.StreamContinuationToken) + StreamContinuationTokenOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamContinuationToken.newBuilder() to construct. + private StreamContinuationToken(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamContinuationToken() { + token_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamContinuationToken(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(token_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(token_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationToken parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPartitionFieldBuilder(); + } + } + + @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 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.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(getPartitionFieldBuilder().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.SingleFieldBuilderV3< + 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 getPartitionFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.StreamPartition, + com.google.bigtable.v2.StreamPartition.Builder, + com.google.bigtable.v2.StreamPartitionOrBuilder> + getPartitionFieldBuilder() { + if (partitionBuilder_ == null) { + partitionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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; + } + + @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.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..7e546f29dd --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokenOrBuilder.java @@ -0,0 +1,86 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..2e15d77c7e --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokens.java @@ -0,0 +1,941 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class StreamContinuationTokens extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.StreamContinuationTokens) + StreamContinuationTokensOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamContinuationTokens.newBuilder() to construct. + private StreamContinuationTokens(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamContinuationTokens() { + tokens_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamContinuationTokens(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamContinuationTokens parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getTokensFieldBuilder() + : 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.RepeatedFieldBuilderV3< + 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 getTokensFieldBuilder().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 getTokensFieldBuilder() + .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 getTokensFieldBuilder() + .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 getTokensFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.StreamContinuationToken, + com.google.bigtable.v2.StreamContinuationToken.Builder, + com.google.bigtable.v2.StreamContinuationTokenOrBuilder> + getTokensFieldBuilder() { + if (tokensBuilder_ == null) { + tokensBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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..d33d429367 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamContinuationTokensOrBuilder.java @@ -0,0 +1,78 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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..e6b937fcf9 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartition.java @@ -0,0 +1,725 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class StreamPartition extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.StreamPartition) + StreamPartitionOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamPartition.newBuilder() to construct. + private StreamPartition(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamPartition() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.StreamPartition parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRowRangeFieldBuilder(); + } + } + + @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 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.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(getRowRangeFieldBuilder().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.SingleFieldBuilderV3< + 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 getRowRangeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder> + getRowRangeFieldBuilder() { + if (rowRangeBuilder_ == null) { + rowRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.RowRange, + com.google.bigtable.v2.RowRange.Builder, + com.google.bigtable.v2.RowRangeOrBuilder>( + getRowRange(), getParentForChildren(), isClean()); + rowRange_ = null; + } + return rowRangeBuilder_; + } + + @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.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..ff4f1e3c59 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/StreamPartitionOrBuilder.java @@ -0,0 +1,64 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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 87ae40adbb..98f1912341 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 2021 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. @@ -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) 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..6bc4b3fc9a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,58 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new TimestampRange(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_TimestampRange_descriptor; @@ -113,7 +62,7 @@ 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 +80,7 @@ public long getStartTimestampMicros() { } public static final int END_TIMESTAMP_MICROS_FIELD_NUMBER = 2; - private long endTimestampMicros_; + private long endTimestampMicros_ = 0L; /** * * @@ -168,7 +117,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 +132,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 +149,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 +164,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; } @@ -343,26 +292,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) { 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,12 +331,23 @@ 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; } + private void buildPartial0(com.google.bigtable.v2.TimestampRange result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTimestampMicros_ = startTimestampMicros_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTimestampMicros_ = endTimestampMicros_; + } + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -447,7 +399,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,20 +414,48 @@ 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_; /** * @@ -507,6 +487,7 @@ public long getStartTimestampMicros() { public Builder setStartTimestampMicros(long value) { startTimestampMicros_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -522,7 +503,7 @@ public Builder setStartTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearStartTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000001); startTimestampMicros_ = 0L; onChanged(); return this; @@ -559,6 +540,7 @@ public long getEndTimestampMicros() { public Builder setEndTimestampMicros(long value) { endTimestampMicros_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } @@ -574,7 +556,7 @@ public Builder setEndTimestampMicros(long value) { * @return This builder for chaining. */ public Builder clearEndTimestampMicros() { - + bitField0_ = (bitField0_ & ~0x00000002); endTimestampMicros_ = 0L; onChanged(); return this; @@ -612,7 +594,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..83f6c6e30a 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface TimestampRangeOrBuilder 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..ccfb1d58f1 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Type.java @@ -0,0 +1,21407 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/types.proto + +// Protobuf Java Version: 3.25.5 +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/from the underlying data.
    + *
    + * Each encoding also defines the following properties:
    + *
    + *  * Order-preserving: Does the encoded value sort consistently with the
    + *    original typed value? Note that Bigtable will always sort data based on
    + *    the raw encoded value, *not* the decoded type.
    + *     - Example: BYTES values sort in the same order as their raw encodings.
    + *     - Counterexample: Encoding INT64 as a fixed-width decimal string does
    + *       *not* preserve sort order when dealing with negative numbers.
    + *       `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001)`.
    + *  * Self-delimiting: If we concatenate two encoded values, can we always tell
    + *    where the first one ends and the second one begins?
    + *     - Example: If we encode INT64s to fixed-width STRINGs, the first value
    + *       will always contain exactly N digits, possibly preceded by a sign.
    + *     - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have
    + *       no way to tell where the first one ends.
    + *  * Compatibility: Which other systems have matching encoding schemes? For
    + *    example, does this encoding have a GoogleSQL equivalent? HBase? Java?
    + * 
    + * + * Protobuf type {@code google.bigtable.v2.Type} + */ +public final class Type extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type) + TypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Type.newBuilder() to construct. + private Type(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Type() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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/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/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/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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bytes) + BytesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Bytes.newBuilder() to construct. + private Bytes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Bytes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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/from lower level types.
    +     * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bytes.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Encoding() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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 {} + /** + * + * + *
    +       * Leaves the value "as-is"
    +       * * Order-preserving? Yes
    +       * * Self-delimiting? No
    +       * * Compatibility? N/A
    +       * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Raw extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bytes.Encoding.Raw) + RawOrBuilder { + private static final long serialVersionUID = 0L; + // Use Raw.newBuilder() to construct. + private Raw(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Raw() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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.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 (!getUnknownFields().equals(other.getUnknownFields())) 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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +         * Leaves the value "as-is"
    +         * * Order-preserving? Yes
    +         * * Self-delimiting? No
    +         * * Compatibility? N/A
    +         * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding.Raw} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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_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); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.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; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (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; + } + + @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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +       * Rules used to convert to/from lower level types.
    +       * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Bytes.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getRawFieldBuilder().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.SingleFieldBuilderV3< + 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 getRawFieldBuilder().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.SingleFieldBuilderV3< + 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> + getRawFieldBuilder() { + if (rawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.v2.Type.Bytes.Encoding.Raw.getDefaultInstance(); + } + rawBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncodingFieldBuilder(); + } + } + + @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 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.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(getEncodingFieldBuilder().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.SingleFieldBuilderV3< + 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/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/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/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/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/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/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/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 getEncodingFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * The encoding to use when converting to/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/from lower level types.
    +       * 
    + * + * .google.bigtable.v2.Type.Bytes.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Bytes.Encoding, + com.google.bigtable.v2.Type.Bytes.Encoding.Builder, + com.google.bigtable.v2.Type.Bytes.EncodingOrBuilder> + getEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String) + StringOrBuilder { + private static final long serialVersionUID = 0L; + // Use String.newBuilder() to construct. + private String(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private String() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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=97 + * @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=97 + * @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/from lower level types.
    +     * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Encoding() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String.Encoding.Utf8Raw) + Utf8RawOrBuilder { + private static final long serialVersionUID = 0L; + // Use Utf8Raw.newBuilder() to construct. + private Utf8Raw(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Utf8Raw() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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 {} + /** + * + * + *
    +       * UTF-8 encoding
    +       * * Order-preserving? Yes (code point order)
    +       * * Self-delimiting? No
    +       * * Compatibility?
    +       *    - BigQuery Federation `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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.String.Encoding.Utf8Bytes) + Utf8BytesOrBuilder { + private static final long serialVersionUID = 0L; + // Use Utf8Bytes.newBuilder() to construct. + private Utf8Bytes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Utf8Bytes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Utf8Bytes(); + } + + 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.GeneratedMessageV3.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); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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.Utf8Bytes)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes other = + (com.google.bigtable.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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +         * UTF-8 encoding
    +         * * Order-preserving? Yes (code point order)
    +         * * Self-delimiting? No
    +         * * Compatibility?
    +         *    - BigQuery Federation `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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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_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); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.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; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (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; + } + + @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.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=97 + * @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=97 + * @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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +       * Rules used to convert to/from lower level types.
    +       * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.String.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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(getUtf8RawFieldBuilder().getBuilder(), extensionRegistry); + encodingCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getUtf8BytesFieldBuilder().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.SingleFieldBuilderV3< + 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=97 + * @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=97 + * @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 getUtf8RawFieldBuilder().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.SingleFieldBuilderV3< + 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> + getUtf8RawFieldBuilder() { + if (utf8RawBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = com.google.bigtable.v2.Type.String.Encoding.Utf8Raw.getDefaultInstance(); + } + utf8RawBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getUtf8BytesFieldBuilder().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.SingleFieldBuilderV3< + 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> + getUtf8BytesFieldBuilder() { + if (utf8BytesBuilder_ == null) { + if (!(encodingCase_ == 2)) { + encoding_ = + com.google.bigtable.v2.Type.String.Encoding.Utf8Bytes.getDefaultInstance(); + } + utf8BytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncodingFieldBuilder(); + } + } + + @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 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.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(getEncodingFieldBuilder().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.SingleFieldBuilderV3< + 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/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/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/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/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/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/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/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 getEncodingFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * The encoding to use when converting to/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/from lower level types.
    +       * 
    + * + * .google.bigtable.v2.Type.String.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.String.Encoding, + com.google.bigtable.v2.Type.String.Encoding.Builder, + com.google.bigtable.v2.Type.String.EncodingOrBuilder> + getEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64) + Int64OrBuilder { + private static final long serialVersionUID = 0L; + // Use Int64.newBuilder() to construct. + private Int64(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Int64() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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(); + + com.google.bigtable.v2.Type.Int64.Encoding.EncodingCase getEncodingCase(); + } + /** + * + * + *
    +     * Rules used to convert to/from lower level types.
    +     * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding} + */ + public static final class Encoding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64.Encoding) + EncodingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Encoding.newBuilder() to construct. + private Encoding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Encoding() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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; + * + * @return Whether the bytesType field is set. + */ + boolean hasBytesType(); + /** + * + * + *
    +         * Deprecated: ignored if set.
    +         * 
    + * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + com.google.bigtable.v2.Type.Bytes getBytesType(); + /** + * + * + *
    +         * Deprecated: ignored if set.
    +         * 
    + * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + com.google.bigtable.v2.Type.BytesOrBuilder getBytesTypeOrBuilder(); + } + /** + * + * + *
    +       * Encodes the value as an 8-byte big endian twos complement `Bytes`
    +       * value.
    +       * * Order-preserving? No (positive values only)
    +       * * Self-delimiting? Yes
    +       * * Compatibility?
    +       *    - BigQuery Federation `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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes) + BigEndianBytesOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigEndianBytes.newBuilder() to construct. + private BigEndianBytes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigEndianBytes() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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; + * + * @return Whether the bytesType field is set. + */ + @java.lang.Override + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
    +         * Deprecated: ignored if set.
    +         * 
    + * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + @java.lang.Override + 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; + */ + @java.lang.Override + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +         * Encodes the value as an 8-byte big endian twos complement `Bytes`
    +         * value.
    +         * * Order-preserving? No (positive values only)
    +         * * Self-delimiting? Yes
    +         * * Compatibility?
    +         *    - BigQuery Federation `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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBytesTypeFieldBuilder(); + } + } + + @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 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.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(getBytesTypeFieldBuilder().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.SingleFieldBuilderV3< + 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; + * + * @return Whether the bytesType field is set. + */ + public boolean hasBytesType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
    +           * Deprecated: ignored if set.
    +           * 
    + * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + * + * @return The bytesType. + */ + 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; + */ + 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; + */ + 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; + */ + 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; + */ + 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; + */ + public com.google.bigtable.v2.Type.Bytes.Builder getBytesTypeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getBytesTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
    +           * Deprecated: ignored if set.
    +           * 
    + * + * .google.bigtable.v2.Type.Bytes bytes_type = 1; + */ + 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; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder> + getBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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; + } + } + + 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), + 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 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(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 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 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
    +       * Rules used to convert to/from lower level types.
    +       * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Int64.Encoding} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bigEndianBytesBuilder_ != null) { + bigEndianBytesBuilder_.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(); + } + } + + @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.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 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( + getBigEndianBytesFieldBuilder().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.SingleFieldBuilderV3< + 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 getBigEndianBytesFieldBuilder().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.SingleFieldBuilderV3< + 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> + getBigEndianBytesFieldBuilder() { + if (bigEndianBytesBuilder_ == null) { + if (!(encodingCase_ == 1)) { + encoding_ = + com.google.bigtable.v2.Type.Int64.Encoding.BigEndianBytes.getDefaultInstance(); + } + bigEndianBytesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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/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/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/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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncodingFieldBuilder(); + } + } + + @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 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.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(getEncodingFieldBuilder().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.SingleFieldBuilderV3< + 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/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/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/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/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/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/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/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 getEncodingFieldBuilder().getBuilder(); + } + /** + * + * + *
    +       * The encoding to use when converting to/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/from lower level types.
    +       * 
    + * + * .google.bigtable.v2.Type.Int64.Encoding encoding = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Int64.Encoding, + com.google.bigtable.v2.Type.Int64.Encoding.Builder, + com.google.bigtable.v2.Type.Int64.EncodingOrBuilder> + getEncodingFieldBuilder() { + if (encodingBuilder_ == null) { + encodingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Bool) + BoolOrBuilder { + private static final long serialVersionUID = 0L; + // Use Bool.newBuilder() to construct. + private Bool(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Bool() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Float32) + Float32OrBuilder { + private static final long serialVersionUID = 0L; + // Use Float32.newBuilder() to construct. + private Float32(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Float32() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Float64) + Float64OrBuilder { + private static final long serialVersionUID = 0L; + // Use Float64.newBuilder() to construct. + private Float64(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Float64() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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 {} + /** + * + * + *
    +   * 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Timestamp) + TimestampOrBuilder { + private static final long serialVersionUID = 0L; + // Use Timestamp.newBuilder() to construct. + private Timestamp(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Timestamp() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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.Timestamp)) { + return super.equals(obj); + } + com.google.bigtable.v2.Type.Timestamp other = (com.google.bigtable.v2.Type.Timestamp) 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.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.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_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); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.v2.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; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Date) + DateOrBuilder { + private static final long serialVersionUID = 0L; + // Use Date.newBuilder() to construct. + private Date(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Date() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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); + } + /** + * + * + *
    +   * 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct) + StructOrBuilder { + private static final long serialVersionUID = 0L; + // Use Struct.newBuilder() to construct. + private Struct(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Struct() { + fields_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Struct(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Struct.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Field() { + fieldName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Field(); + } + + 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.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(fieldName_)) { + com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.isStringEmpty(fieldName_)) { + size += com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @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 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.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(getTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + @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.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 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); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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)); + } + 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)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 (!getUnknownFields().equals(other.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(); + } + 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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); + 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_; + } + + @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.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.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFieldsFieldBuilder() + : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + 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.RepeatedFieldBuilderV3< + 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 getFieldsFieldBuilder().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 getFieldsFieldBuilder() + .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 getFieldsFieldBuilder() + .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 getFieldsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.v2.Type.Struct.Field, + com.google.bigtable.v2.Type.Struct.Field.Builder, + com.google.bigtable.v2.Type.Struct.FieldOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + 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_; + } + + @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.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 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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Array) + ArrayOrBuilder { + private static final long serialVersionUID = 0L; + // Use Array.newBuilder() to construct. + private Array(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Array() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getElementTypeFieldBuilder(); + } + } + + @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 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.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(getElementTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getElementTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getElementTypeFieldBuilder() { + if (elementTypeBuilder_ == null) { + elementTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getElementType(), getParentForChildren(), isClean()); + elementType_ = null; + } + return elementTypeBuilder_; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Map) + MapOrBuilder { + private static final long serialVersionUID = 0L; + // Use Map.newBuilder() to construct. + private Map(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Map() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getKeyTypeFieldBuilder(); + getValueTypeFieldBuilder(); + } + } + + @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 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.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(getKeyTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getValueTypeFieldBuilder().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.SingleFieldBuilderV3< + 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 getKeyTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getKeyTypeFieldBuilder() { + if (keyTypeBuilder_ == null) { + keyTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getValueTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getValueTypeFieldBuilder() { + if (valueTypeBuilder_ == null) { + valueTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder>( + getValueType(), getParentForChildren(), isClean()); + valueType_ = null; + } + return valueTypeBuilder_; + } + + @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.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`, which must
    +     * specify a full encoding.
    +     * 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`, which must
    +     * specify a full encoding.
    +     * 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`, which must
    +     * specify a full encoding.
    +     * 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, and will always specify a full encoding.
    +     * 
    + * + * .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, and will always specify a full encoding.
    +     * 
    + * + * .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, and will always specify a full encoding.
    +     * 
    + * + * .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 will
    +   * provide either the `input_type` or `state_type`, and reads will always
    +   * return the `state_type` .
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.Type.Aggregate} + */ + public static final class Aggregate extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate) + AggregateOrBuilder { + private static final long serialVersionUID = 0L; + // Use Aggregate.newBuilder() to construct. + private Aggregate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Aggregate() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.Sum) + SumOrBuilder { + private static final long serialVersionUID = 0L; + // Use Sum.newBuilder() to construct. + private Sum(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Sum() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.Max) + MaxOrBuilder { + private static final long serialVersionUID = 0L; + // Use Max.newBuilder() to construct. + private Max(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Max() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.Min) + MinOrBuilder { + private static final long serialVersionUID = 0L; + // Use Min.newBuilder() to construct. + private Min(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Min() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount) + HyperLogLogPlusPlusUniqueCountOrBuilder { + private static final long serialVersionUID = 0L; + // Use HyperLogLogPlusPlusUniqueCount.newBuilder() to construct. + private HyperLogLogPlusPlusUniqueCount( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HyperLogLogPlusPlusUniqueCount() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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 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.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; + } + + @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.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`, which must
    +     * specify a full encoding.
    +     * 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`, which must
    +     * specify a full encoding.
    +     * 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`, which must
    +     * specify a full encoding.
    +     * 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, and will always specify a full encoding.
    +     * 
    + * + * .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, and will always specify a full encoding.
    +     * 
    + * + * .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, and will always specify a full encoding.
    +     * 
    + * + * .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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.v2.Type.Aggregate} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInputTypeFieldBuilder(); + getStateTypeFieldBuilder(); + } + } + + @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 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.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(getInputTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getStateTypeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getSumFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getHllppUniqueCountFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getMaxFieldBuilder().getBuilder(), extensionRegistry); + aggregatorCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getMinFieldBuilder().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.SingleFieldBuilderV3< + 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`, which must
    +       * specify a full encoding.
    +       * 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`, which must
    +       * specify a full encoding.
    +       * 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`, which must
    +       * specify a full encoding.
    +       * 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`, which must
    +       * specify a full encoding.
    +       * 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`, which must
    +       * specify a full encoding.
    +       * 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`, which must
    +       * specify a full encoding.
    +       * 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`, which must
    +       * specify a full encoding.
    +       * 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 getInputTypeFieldBuilder().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.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`, which must
    +       * specify a full encoding.
    +       * Use `AddInput` mutations to accumulate new inputs.
    +       * 
    + * + * .google.bigtable.v2.Type input_type = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getInputTypeFieldBuilder() { + if (inputTypeBuilder_ == null) { + inputTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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, and will always specify a full encoding.
    +       * 
    + * + * .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, and will always specify a full encoding.
    +       * 
    + * + * .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, and will always specify a full encoding.
    +       * 
    + * + * .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, and will always specify a full encoding.
    +       * 
    + * + * .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, and will always specify a full encoding.
    +       * 
    + * + * .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, and will always specify a full encoding.
    +       * 
    + * + * .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, and will always specify a full encoding.
    +       * 
    + * + * .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 getStateTypeFieldBuilder().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.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, and will always specify a full encoding.
    +       * 
    + * + * .google.bigtable.v2.Type state_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getStateTypeFieldBuilder() { + if (stateTypeBuilder_ == null) { + stateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getSumFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Aggregate.Sum, + com.google.bigtable.v2.Type.Aggregate.Sum.Builder, + com.google.bigtable.v2.Type.Aggregate.SumOrBuilder> + getSumFieldBuilder() { + if (sumBuilder_ == null) { + if (!(aggregatorCase_ == 4)) { + aggregator_ = com.google.bigtable.v2.Type.Aggregate.Sum.getDefaultInstance(); + } + sumBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getHllppUniqueCountFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount.Builder, + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCountOrBuilder> + getHllppUniqueCountFieldBuilder() { + if (hllppUniqueCountBuilder_ == null) { + if (!(aggregatorCase_ == 5)) { + aggregator_ = + com.google.bigtable.v2.Type.Aggregate.HyperLogLogPlusPlusUniqueCount + .getDefaultInstance(); + } + hllppUniqueCountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMaxFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Aggregate.Max, + com.google.bigtable.v2.Type.Aggregate.Max.Builder, + com.google.bigtable.v2.Type.Aggregate.MaxOrBuilder> + getMaxFieldBuilder() { + if (maxBuilder_ == null) { + if (!(aggregatorCase_ == 6)) { + aggregator_ = com.google.bigtable.v2.Type.Aggregate.Max.getDefaultInstance(); + } + maxBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMinFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Aggregate.Min, + com.google.bigtable.v2.Type.Aggregate.Min.Builder, + com.google.bigtable.v2.Type.Aggregate.MinOrBuilder> + getMinFieldBuilder() { + if (minBuilder_ == null) { + if (!(aggregatorCase_ == 7)) { + aggregator_ = com.google.bigtable.v2.Type.Aggregate.Min.getDefaultInstance(); + } + minBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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), + 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 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(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + 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 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 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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Type parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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/from the underlying data.
    +   *
    +   * Each encoding also defines the following properties:
    +   *
    +   *  * Order-preserving: Does the encoded value sort consistently with the
    +   *    original typed value? Note that Bigtable will always sort data based on
    +   *    the raw encoded value, *not* the decoded type.
    +   *     - Example: BYTES values sort in the same order as their raw encodings.
    +   *     - Counterexample: Encoding INT64 as a fixed-width decimal string does
    +   *       *not* preserve sort order when dealing with negative numbers.
    +   *       `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001)`.
    +   *  * Self-delimiting: If we concatenate two encoded values, can we always tell
    +   *    where the first one ends and the second one begins?
    +   *     - Example: If we encode INT64s to fixed-width STRINGs, the first value
    +   *       will always contain exactly N digits, possibly preceded by a sign.
    +   *     - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have
    +   *       no way to tell where the first one ends.
    +   *  * Compatibility: Which other systems have matching encoding schemes? For
    +   *    example, does this encoding have a GoogleSQL equivalent? HBase? Java?
    +   * 
    + * + * Protobuf type {@code google.bigtable.v2.Type} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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(); + } + 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(); + } + } + + @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.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 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(getBytesTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getStringTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getArrayTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage(getMapTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage(getInt64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 5; + break; + } // case 42 + case 50: + { + input.readMessage(getAggregateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getStructTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 7; + break; + } // case 58 + case 66: + { + input.readMessage(getBoolTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 8; + break; + } // case 66 + case 74: + { + input.readMessage(getFloat64TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 9; + break; + } // case 74 + case 82: + { + input.readMessage(getTimestampTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 10; + break; + } // case 82 + case 90: + { + input.readMessage(getDateTypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 11; + break; + } // case 90 + case 98: + { + input.readMessage(getFloat32TypeFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int 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.SingleFieldBuilderV3< + 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 getBytesTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Bytes, + com.google.bigtable.v2.Type.Bytes.Builder, + com.google.bigtable.v2.Type.BytesOrBuilder> + getBytesTypeFieldBuilder() { + if (bytesTypeBuilder_ == null) { + if (!(kindCase_ == 1)) { + kind_ = com.google.bigtable.v2.Type.Bytes.getDefaultInstance(); + } + bytesTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getStringTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.String, + com.google.bigtable.v2.Type.String.Builder, + com.google.bigtable.v2.Type.StringOrBuilder> + getStringTypeFieldBuilder() { + if (stringTypeBuilder_ == null) { + if (!(kindCase_ == 2)) { + kind_ = com.google.bigtable.v2.Type.String.getDefaultInstance(); + } + stringTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getInt64TypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Int64, + com.google.bigtable.v2.Type.Int64.Builder, + com.google.bigtable.v2.Type.Int64OrBuilder> + getInt64TypeFieldBuilder() { + if (int64TypeBuilder_ == null) { + if (!(kindCase_ == 5)) { + kind_ = com.google.bigtable.v2.Type.Int64.getDefaultInstance(); + } + int64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getFloat32TypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Float32, + com.google.bigtable.v2.Type.Float32.Builder, + com.google.bigtable.v2.Type.Float32OrBuilder> + getFloat32TypeFieldBuilder() { + if (float32TypeBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = com.google.bigtable.v2.Type.Float32.getDefaultInstance(); + } + float32TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getFloat64TypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Float64, + com.google.bigtable.v2.Type.Float64.Builder, + com.google.bigtable.v2.Type.Float64OrBuilder> + getFloat64TypeFieldBuilder() { + if (float64TypeBuilder_ == null) { + if (!(kindCase_ == 9)) { + kind_ = com.google.bigtable.v2.Type.Float64.getDefaultInstance(); + } + float64TypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getBoolTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Bool, + com.google.bigtable.v2.Type.Bool.Builder, + com.google.bigtable.v2.Type.BoolOrBuilder> + getBoolTypeFieldBuilder() { + if (boolTypeBuilder_ == null) { + if (!(kindCase_ == 8)) { + kind_ = com.google.bigtable.v2.Type.Bool.getDefaultInstance(); + } + boolTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getTimestampTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Timestamp, + com.google.bigtable.v2.Type.Timestamp.Builder, + com.google.bigtable.v2.Type.TimestampOrBuilder> + getTimestampTypeFieldBuilder() { + if (timestampTypeBuilder_ == null) { + if (!(kindCase_ == 10)) { + kind_ = com.google.bigtable.v2.Type.Timestamp.getDefaultInstance(); + } + timestampTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getDateTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Date, + com.google.bigtable.v2.Type.Date.Builder, + com.google.bigtable.v2.Type.DateOrBuilder> + getDateTypeFieldBuilder() { + if (dateTypeBuilder_ == null) { + if (!(kindCase_ == 11)) { + kind_ = com.google.bigtable.v2.Type.Date.getDefaultInstance(); + } + dateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getAggregateTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Aggregate, + com.google.bigtable.v2.Type.Aggregate.Builder, + com.google.bigtable.v2.Type.AggregateOrBuilder> + getAggregateTypeFieldBuilder() { + if (aggregateTypeBuilder_ == null) { + if (!(kindCase_ == 6)) { + kind_ = com.google.bigtable.v2.Type.Aggregate.getDefaultInstance(); + } + aggregateTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getStructTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Struct, + com.google.bigtable.v2.Type.Struct.Builder, + com.google.bigtable.v2.Type.StructOrBuilder> + getStructTypeFieldBuilder() { + if (structTypeBuilder_ == null) { + if (!(kindCase_ == 7)) { + kind_ = com.google.bigtable.v2.Type.Struct.getDefaultInstance(); + } + structTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getArrayTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Array, + com.google.bigtable.v2.Type.Array.Builder, + com.google.bigtable.v2.Type.ArrayOrBuilder> + getArrayTypeFieldBuilder() { + if (arrayTypeBuilder_ == null) { + if (!(kindCase_ == 3)) { + kind_ = com.google.bigtable.v2.Type.Array.getDefaultInstance(); + } + arrayTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getMapTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type.Map, + com.google.bigtable.v2.Type.Map.Builder, + com.google.bigtable.v2.Type.MapOrBuilder> + getMapTypeFieldBuilder() { + if (mapTypeBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.bigtable.v2.Type.Map.getDefaultInstance(); + } + mapTypeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..5f68608363 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypeOrBuilder.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/types.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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(); + + 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..7cc10941dd --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/TypesProto.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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/types.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +public final class TypesProto { + private 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Bool_descriptor; + static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Timestamp_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Date_descriptor; + static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_v2_Type_Struct_Field_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_v2_Type_Array_descriptor; + static final com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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\"\340\020\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\032\235\001\n\005Bytes\0229\n\010encoding\030\001 \001(\0132\'.google." + + "bigtable.v2.Type.Bytes.Encoding\032Y\n\010Encod" + + "ing\022:\n\003raw\030\001 \001(\0132+.google.bigtable.v2.Ty" + + "pe.Bytes.Encoding.RawH\000\032\005\n\003RawB\n\n\010encodi" + + "ng\032\215\002\n\006String\022:\n\010encoding\030\001 \001(\0132(.google" + + ".bigtable.v2.Type.String.Encoding\032\306\001\n\010En" + + "coding\022H\n\010utf8_raw\030\001 \001(\01320.google.bigtab" + + "le.v2.Type.String.Encoding.Utf8RawB\002\030\001H\000" + + "\022H\n\nutf8_bytes\030\002 \001(\01322.google.bigtable.v" + + "2.Type.String.Encoding.Utf8BytesH\000\032\r\n\007Ut" + + "f8Raw:\002\030\001\032\013\n\tUtf8BytesB\n\n\010encoding\032\365\001\n\005I" + + "nt64\0229\n\010encoding\030\001 \001(\0132\'.google.bigtable" + + ".v2.Type.Int64.Encoding\032\260\001\n\010Encoding\022R\n\020" + + "big_endian_bytes\030\001 \001(\01326.google.bigtable" + + ".v2.Type.Int64.Encoding.BigEndianBytesH\000" + + "\032D\n\016BigEndianBytes\0222\n\nbytes_type\030\001 \001(\0132\036" + + ".google.bigtable.v2.Type.BytesB\n\n\010encodi" + + "ng\032\006\n\004Bool\032\t\n\007Float32\032\t\n\007Float64\032\013\n\tTime" + + "stamp\032\006\n\004Date\032\204\001\n\006Struct\0225\n\006fields\030\001 \003(\013" + + "2%.google.bigtable.v2.Type.Struct.Field\032" + + "C\n\005Field\022\022\n\nfield_name\030\001 \001(\t\022&\n\004type\030\002 \001" + + "(\0132\030.google.bigtable.v2.Type\0327\n\005Array\022.\n" + + "\014element_type\030\001 \001(\0132\030.google.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.g" + + "oogle.bigtable.v2.Type\032\267\003\n\tAggregate\022,\n\n" + + "input_type\030\001 \001(\0132\030.google.bigtable.v2.Ty" + + "pe\0221\n\nstate_type\030\002 \001(\0132\030.google.bigtable" + + ".v2.TypeB\003\340A\003\0225\n\003sum\030\004 \001(\0132&.google.bigt" + + "able.v2.Type.Aggregate.SumH\000\022_\n\022hllpp_un" + + "ique_count\030\005 \001(\0132A.google.bigtable.v2.Ty" + + "pe.Aggregate.HyperLogLogPlusPlusUniqueCo" + + "untH\000\0225\n\003max\030\006 \001(\0132&.google.bigtable.v2." + + "Type.Aggregate.MaxH\000\0225\n\003min\030\007 \001(\0132&.goog" + + "le.bigtable.v2.Type.Aggregate.MinH\000\032\005\n\003S" + + "um\032\005\n\003Max\032\005\n\003Min\032 \n\036HyperLogLogPlusPlusU" + + "niqueCountB\014\n\naggregatorB\006\n\004kindB\264\001\n\026com" + + ".google.bigtable.v2B\nTypesProtoP\001Z8cloud" + + ".google.com/go/bigtable/apiv2/bigtablepb" + + ";bigtablepb\252\002\030Google.Cloud.Bigtable.V2\312\002" + + "\030Google\\Cloud\\Bigtable\\V2\352\002\033Google::Clou" + + "d::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().getMessageTypes().get(0); + internal_static_google_bigtable_v2_Type_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_descriptor, + new java.lang.String[] { + "BytesType", + "StringType", + "Int64Type", + "Float32Type", + "Float64Type", + "BoolType", + "TimestampType", + "DateType", + "AggregateType", + "StructType", + "ArrayType", + "MapType", + "Kind", + }); + internal_static_google_bigtable_v2_Type_Bytes_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Bytes_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Bytes_Encoding_Raw_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_String_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedTypes().get(1); + internal_static_google_bigtable_v2_Type_String_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_String_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Raw_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_String_Encoding_Utf8Bytes_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Int64_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedTypes().get(2); + internal_static_google_bigtable_v2_Type_Int64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Int64_Encoding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor, + new java.lang.String[] { + "BigEndianBytes", "Encoding", + }); + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor = + internal_static_google_bigtable_v2_Type_Int64_Encoding_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Int64_Encoding_BigEndianBytes_descriptor, + new java.lang.String[] { + "BytesType", + }); + internal_static_google_bigtable_v2_Type_Bool_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedTypes().get(3); + internal_static_google_bigtable_v2_Type_Bool_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(4); + internal_static_google_bigtable_v2_Type_Float32_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(5); + internal_static_google_bigtable_v2_Type_Float64_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(6); + internal_static_google_bigtable_v2_Type_Timestamp_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Timestamp_descriptor, + new java.lang.String[] {}); + internal_static_google_bigtable_v2_Type_Date_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedTypes().get(7); + internal_static_google_bigtable_v2_Type_Date_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(8); + internal_static_google_bigtable_v2_Type_Struct_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_descriptor, + new java.lang.String[] { + "Fields", + }); + internal_static_google_bigtable_v2_Type_Struct_Field_descriptor = + internal_static_google_bigtable_v2_Type_Struct_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Struct_Field_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Struct_Field_descriptor, + new java.lang.String[] { + "FieldName", "Type", + }); + internal_static_google_bigtable_v2_Type_Array_descriptor = + internal_static_google_bigtable_v2_Type_descriptor.getNestedTypes().get(9); + internal_static_google_bigtable_v2_Type_Array_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(10); + internal_static_google_bigtable_v2_Type_Map_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(11); + internal_static_google_bigtable_v2_Type_Aggregate_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(0); + internal_static_google_bigtable_v2_Type_Aggregate_Sum_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(1); + internal_static_google_bigtable_v2_Type_Aggregate_Max_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(2); + internal_static_google_bigtable_v2_Type_Aggregate_Min_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.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.getNestedTypes().get(3); + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_v2_Type_Aggregate_HyperLogLogPlusPlusUniqueCount_descriptor, + new java.lang.String[] {}); + 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); + com.google.api.FieldBehaviorProto.getDescriptor(); + } + + // @@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..a55ee808db --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/Value.java @@ -0,0 +1,2904 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +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} + */ +public final class Value extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.v2.Value) + ValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use Value.newBuilder() to construct. + private Value(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Value() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new 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.GeneratedMessageV3.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.
    +   * 
    + * + * 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.
    +   * 
    + * + * 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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.bigtable.v2.Value parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.v2.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.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.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getTypeFieldBuilder(); + } + } + + @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 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.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(getArrayValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 4; + break; + } // case 34 + case 48: + { + kind_ = input.readInt64(); + kindCase_ = 6; + break; + } // case 48 + case 58: + { + input.readMessage(getTypeFieldBuilder().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(getTimestampValueFieldBuilder().getBuilder(), extensionRegistry); + kindCase_ = 12; + break; + } // case 98 + case 106: + { + input.readMessage(getDateValueFieldBuilder().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.SingleFieldBuilderV3< + 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 getTypeFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.Type, + com.google.bigtable.v2.Type.Builder, + com.google.bigtable.v2.TypeOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.
    +     * 
    + * + * 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.
    +     * 
    + * + * 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.
    +     * 
    + * + * 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.
    +     * 
    + * + * 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.SingleFieldBuilderV3< + 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 getTimestampValueFieldBuilder().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.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getTimestampValueFieldBuilder() { + if (timestampValueBuilder_ == null) { + if (!(kindCase_ == 12)) { + kind_ = com.google.protobuf.Timestamp.getDefaultInstance(); + } + timestampValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getDateValueFieldBuilder().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.SingleFieldBuilderV3< + com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder> + getDateValueFieldBuilder() { + if (dateValueBuilder_ == null) { + if (!(kindCase_ == 13)) { + kind_ = com.google.type.Date.getDefaultInstance(); + } + dateValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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.SingleFieldBuilderV3< + 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 getArrayValueFieldBuilder().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.SingleFieldBuilderV3< + com.google.bigtable.v2.ArrayValue, + com.google.bigtable.v2.ArrayValue.Builder, + com.google.bigtable.v2.ArrayValueOrBuilder> + getArrayValueFieldBuilder() { + if (arrayValueBuilder_ == null) { + if (!(kindCase_ == 4)) { + kind_ = com.google.bigtable.v2.ArrayValue.getDefaultInstance(); + } + arrayValueBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + 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_; + } + + @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.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..26accb6ab2 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/java/com/google/bigtable/v2/ValueOrBuilder.java @@ -0,0 +1,407 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/v2/data.proto + +// Protobuf Java Version: 3.25.5 +package com.google.bigtable.v2; + +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.
    +   * 
    + * + * double float_value = 11; + * + * @return Whether the floatValue field is set. + */ + boolean hasFloatValue(); + /** + * + * + *
    +   * Represents a typed value transported as a floating point number.
    +   * 
    + * + * 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..5152ba1d08 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; /** @@ -45,72 +46,6 @@ protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ValueRange(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - 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(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bigtable.v2.DataProto .internal_static_google_bigtable_v2_ValueRange_descriptor; @@ -127,6 +62,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } private int startValueCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object startValue_; public enum StartValueCase @@ -174,6 +111,8 @@ public StartValueCase getStartValueCase() { } private int endValueCase_ = 0; + + @SuppressWarnings("serial") private java.lang.Object endValue_; public enum EndValueCase @@ -386,7 +325,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 +354,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 +391,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 +426,7 @@ public int hashCode() { case 0: default: } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -615,22 +554,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) { 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,24 +594,25 @@ 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 (bitField0_ != 0) { + buildPartial0(result); } - if (endValueCase_ == 3) { - result.endValue_ = endValue_; - } - if (endValueCase_ == 4) { - result.endValue_ = endValue_; - } - result.startValueCase_ = startValueCase_; - result.endValueCase_ = endValueCase_; + buildPartialOneofs(result); onBuilt(); return result; } + private void buildPartial0(com.google.bigtable.v2.ValueRange result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.bigtable.v2.ValueRange result) { + result.startValueCase_ = startValueCase_; + result.startValue_ = this.startValue_; + result.endValueCase_ = endValueCase_; + result.endValue_ = this.endValue_; + } + @java.lang.Override public Builder clone() { return super.clone(); @@ -756,7 +690,7 @@ public Builder mergeFrom(com.google.bigtable.v2.ValueRange other) { break; } } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -771,17 +705,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 +785,8 @@ public Builder clearEndValue() { return this; } + private int bitField0_; + /** * * @@ -1133,7 +1107,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..a945dffa37 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 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. @@ -16,6 +16,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/bigtable/v2/data.proto +// Protobuf Java Version: 3.25.5 package com.google.bigtable.v2; public interface ValueRangeOrBuilder @@ -123,7 +124,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 94a8428429..7c85b3f756 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 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. @@ -20,21 +20,33 @@ 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/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: "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}" +}; // Service for reading from and writing to existing Bigtable tables. service Bigtable { @@ -56,6 +68,21 @@ 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: "*" + } + }; + 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: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}" + } }; option (google.api.method_signature) = "table_name"; option (google.api.method_signature) = "table_name,app_profile_id"; @@ -65,9 +92,24 @@ 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" + } + }; + 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: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}" + } }; option (google.api.method_signature) = "table_name"; option (google.api.method_signature) = "table_name,app_profile_id"; @@ -79,9 +121,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: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}" + } }; 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 +149,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: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}" + } }; 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: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}" + } + }; + option (google.api.method_signature) = + "table_name,row_key,predicate_filter,true_mutations,false_mutations"; + option (google.api.method_signature) = + "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id"; + } + + // Warm up associated instance metadata for this connection. + // This call is not required but may be useful for connection keep-alive. + rpc PingAndWarm(PingAndWarmRequest) returns (PingAndWarmResponse) { + option (google.api.http) = { + post: "/v2/{name=projects/*/instances/*}:ping" + body: "*" + }; + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{name=projects/*/instances/*}" + } + routing_parameters { field: "app_profile_id" } }; - option (google.api.method_signature) = "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.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,42 +220,151 @@ 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: "{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}" + } }; 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"; + } + + // NOTE: This API is intended to be used by Apache Beam BigtableIO. + // 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`. + 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"; + } + + // NOTE: This API is intended to be used by Apache Beam BigtableIO. + // Reads changes from a table's change stream. Changes will + // reflect both user-initiated mutations and mutations that are caused by + // garbage collection. + 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"; + } + + // Executes a BTQL query against a particular Cloud 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" + } + ]; + // This value specifies routing for replication. If not specified, the // "default" application profile will be used. string app_profile_id = 5; - // The row keys and/or ranges to read. 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,20 +444,55 @@ 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, provide enhanced query performance statistics. The semantics + // dictate: + // * request_stats is empty on every (streamed) response, except + // * request_stats has non-empty information after all chunks have been + // streamed, where the ReadRowsResponse message only contains + // request_stats. + // * For example, if a read request would have returned an empty + // response instead a single ReadRowsResponse is streamed with empty + // chunks and request_stats filled. + // + // Visually, response messages will stream as follows: + // ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}} + // \______________________/ \________________________________/ + // Primary response Trailer of RequestStats info + // + // Or if the read did not return any values: + // {chunks: [], request_stats: {...}} + // \________________________________/ + // Trailer of RequestStats info + 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" + } + ]; + // This value specifies routing for replication. If not specified, the // "default" application profile will be used. string app_profile_id = 2; @@ -265,16 +518,30 @@ 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: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + // This value specifies routing for replication. If not specified, the // "default" application profile will be used. string app_profile_id = 4; @@ -282,16 +549,14 @@ 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]; } // Response message for Bigtable.MutateRow. -message MutateRowResponse { - -} +message MutateRowResponse {} // Request message for BigtableService.MutateRows. message MutateRowsRequest { @@ -300,21 +565,36 @@ 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]; } - // 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: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + // This value specifies routing for replication. If not specified, the // "default" application profile will be used. string app_profile_id = 3; @@ -344,26 +624,67 @@ 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: "bigtableadmin.googleapis.com/Table" } ]; + // Optional. The unique name of the AuthorizedView to which the conditional + // mutation should be applied. + // + // Values are of the form + // `projects//instances//tables/
    /authorizedViews/`. + string authorized_view_name = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + // This value specifies routing for replication. If not specified, the // "default" application profile will be used. string app_profile_id = 7; - // Required. The key of the row to which the conditional mutation should be applied. + // 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,30 +715,65 @@ 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: "bigtableadmin.googleapis.com/AuthorizedView" + } + ]; + // This value specifies routing for replication. If not specified, the // "default" application profile will be used. string app_profile_id = 4; - // Required. The key of the row to which the read/modify/write rules should be applied. + // 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. + repeated ReadModifyWriteRule rules = 3 + [(google.api.field_behavior) = REQUIRED]; } // Response message for Bigtable.ReadModifyWriteRow. @@ -425,3 +781,322 @@ 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 is 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 is 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. + string query = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Requested data format for the response. + oneof data_format { + // Protocol buffer format as described by ProtoSchema and ProtoRows + // messages. + ProtoFormat proto_format = 4; + } + + // 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. + // + // In case of Value.kind is not set, it will be set to corresponding null + // value in googlesql. + // `params["firstName"] = type {string_type {}}` + // then `@firstName` will be replaced with googlesql null string. + // + // Value.type should always be set and no inference of type will be made from + // Value.kind. If Value.type is not set, we will return INVALID_ARGUMENT + // error. + 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; + } +} 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..8265611f3b 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 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. @@ -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,77 @@ 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. + 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 +285,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 +539,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 +604,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 +655,123 @@ 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; +} + +// Batch of serialized ProtoRows. +message ProtoRowsBatch { + // Merge partial results by concatenating these bytes, then parsing the + // overall value as a `ProtoRows` message. + bytes batch_data = 1; +} + +// A partial result set from the streaming query API. +// CBT client will buffer partial_rows from result_sets until it gets a +// resumption_token. +message PartialResultSet { + // Partial Rows in one of the supported formats. It may require many + // PartialResultSets to stream a batch of rows that can decoded on the client. + // The client should buffer partial_rows until it gets a `resume_token`, + // at which point the batch is complete and can be decoded and yielded to the + // user. Each sub-message documents the appropriate way to combine results. + oneof partial_rows { + // Partial rows in serialized ProtoRows format. + ProtoRowsBatch proto_rows_batch = 3; + } + + // An opaque token sent by the server to allow query resumption and signal + // the client to accumulate `partial_rows` since the last non-empty + // `resume_token`. On resumption, the resumed query will return the remaining + // rows for this query. + // + // If there is a batch in progress, a non-empty `resume_token` + // means that that the batch of `partial_rows` will be complete after merging + // the `partial_rows` from this response. The client must only yield + // completed batches to the application, and must ensure that any future + // retries send the latest token to avoid returning duplicate data. + // + // The server may set 'resume_token' without a 'partial_rows'. If there is a + // batch in progress the client should yield it. + // + // 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 + // `partial_rows`, then return OK. + bytes resume_token = 5; + + // Estimated size of a new batch. The server will always set this when + // returning the first `partial_rows` of a batch, and will not set it at any + // other time. + // + // The client can use this estimate to allocate an initial buffer for the + // batched 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; +} 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..e97f23e15a --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/feature_flags.proto @@ -0,0 +1,64 @@ +// 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.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; +} 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..c82876876c --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/request_stats.proto @@ -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 +// +// 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, there are the following supported methods: +// * 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..feb0f7d2a1 --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/response_params.proto @@ -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 +// +// 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 +// This is an experimental feature that will be used to get zone_id and +// cluster_id from response trailers to tag the metrics. This should not be +// used by customers directly +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; +} 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..71817d44cd --- /dev/null +++ b/proto-google-cloud-bigtable-v2/src/main/proto/google/bigtable/v2/types.proto @@ -0,0 +1,294 @@ +// 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.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/from the underlying data. +// +// Each encoding also defines the following properties: +// +// * Order-preserving: Does the encoded value sort consistently with the +// original typed value? Note that Bigtable will always sort data based on +// the raw encoded value, *not* the decoded type. +// - Example: BYTES values sort in the same order as their raw encodings. +// - Counterexample: Encoding INT64 as a fixed-width decimal string does +// *not* preserve sort order when dealing with negative numbers. +// `INT64(1) > INT64(-1)`, but `STRING("-00001") > STRING("00001)`. +// * Self-delimiting: If we concatenate two encoded values, can we always tell +// where the first one ends and the second one begins? +// - Example: If we encode INT64s to fixed-width STRINGs, the first value +// will always contain exactly N digits, possibly preceded by a sign. +// - Counterexample: If we concatenate two UTF-8 encoded STRINGs, we have +// no way to tell where the first one ends. +// * Compatibility: Which other systems have matching encoding schemes? For +// example, does this encoding have a GoogleSQL equivalent? HBase? Java? +message Type { + // Bytes + // Values of type `Bytes` are stored in `Value.bytes_value`. + message Bytes { + // Rules used to convert to/from lower level types. + message Encoding { + // Leaves the value "as-is" + // * Order-preserving? Yes + // * Self-delimiting? No + // * Compatibility? N/A + message Raw {} + + // Which encoding to use. + oneof encoding { + // Use `Raw` encoding. + Raw raw = 1; + } + } + + // The encoding to use when converting to/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/from lower level types. + message Encoding { + // Deprecated: prefer the equivalent `Utf8Bytes`. + message Utf8Raw { + option deprecated = true; + } + + // UTF-8 encoding + // * Order-preserving? Yes (code point order) + // * Self-delimiting? No + // * Compatibility? + // - BigQuery Federation `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/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/from lower level types. + message Encoding { + // Encodes the value as an 8-byte big endian twos complement `Bytes` + // value. + // * Order-preserving? No (positive values only) + // * Self-delimiting? Yes + // * Compatibility? + // - BigQuery Federation `BINARY` encoding + // - HBase `Bytes.toBytes` + // - Java `ByteBuffer.putLong()` with `ByteOrder.BIG_ENDIAN` + message BigEndianBytes { + // Deprecated: ignored if set. + Bytes bytes_type = 1; + } + + // Which encoding to use. + oneof encoding { + // Use `BigEndianBytes` encoding. + BigEndianBytes big_endian_bytes = 1; + } + } + + // The encoding to use when converting to/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 {} + + // 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; + } + + // The names and types of the fields in this struct. + repeated Field fields = 1; + } + + // 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; + } +} diff --git a/renovate.json b/renovate.json index c28944e2e2..837f09eaa2 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,7 @@ ":maintainLockFilesDisabled", ":autodetectPinVersions" ], + "ignorePaths": [".kokoro/requirements.txt"], "packageRules": [ { "packagePatterns": [ @@ -51,7 +52,9 @@ "^com.google.truth:truth", "^org.mockito:mockito-core", "^org.objenesis:objenesis", - "^com.google.cloud:google-cloud-conformance-tests" + "^com.google.cloud:google-cloud-conformance-tests", + "^io.grpc:protoc-gen-grpc-java", + "^com.google.protobuf:protoc" ], "semanticCommitType": "test", "semanticCommitScope": "deps" @@ -67,6 +70,44 @@ "^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, diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index fa3331966a..0086139fdb 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-bigtable - 2.5.2 + 2.40.0 @@ -42,7 +42,7 @@ com.google.truth truth - 1.1.3 + 1.4.4 test @@ -53,7 +53,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.6.0 add-snippets-source diff --git a/samples/pom.xml b/samples/pom.xml index a05f97835d..785a96f581 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -38,7 +38,7 @@ org.apache.maven.plugins maven-deploy-plugin - 2.8.2 + 3.1.3 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 5f66a02cfd..fa21aa6e47 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-bigtable - 2.5.3 + 2.45.0 @@ -41,7 +41,7 @@ com.google.truth truth - 1.1.3 + 1.4.4 test @@ -52,7 +52,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.3.0 + 3.6.0 add-snippets-source diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index fd2e29a69a..4e4239ecc8 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -23,14 +23,13 @@ UTF-8 - com.google.cloud libraries-bom - 24.2.0 + 26.37.0 pom import @@ -53,7 +52,7 @@ com.google.truth truth - 1.1.3 + 1.4.4 test 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/Filters.java b/samples/snippets/src/main/java/com/example/bigtable/Filters.java index 9b0829f887..c27437da58 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/Filters.java +++ b/samples/snippets/src/main/java/com/example/bigtable/Filters.java @@ -26,6 +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.TableId; import java.io.IOException; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -360,18 +361,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/example/bigtable/HelloWorld.java b/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java index 3c7c94934c..99bc25735d 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java +++ b/samples/snippets/src/main/java/com/example/bigtable/HelloWorld.java @@ -17,6 +17,9 @@ package com.example.bigtable; // [START bigtable_hw_imports] + +import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS; + import com.google.api.gax.rpc.NotFoundException; import com.google.api.gax.rpc.ServerStream; import com.google.cloud.bigtable.admin.v2.BigtableTableAdminClient; @@ -24,12 +27,16 @@ 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] @@ -99,6 +106,7 @@ public void run() throws Exception { readSingleRow(); readSpecificCells(); readTable(); + filterLimitCellsPerCol(tableId); deleteTable(); close(); } @@ -131,7 +139,7 @@ public void writeToTable() { 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); @@ -148,7 +156,7 @@ public Row readSingleRow() { // [START bigtable_hw_get_by_key] try { System.out.println("\nReading a single row by row key"); - Row row = dataClient.readRow(tableId, 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( @@ -168,7 +176,7 @@ public List readSpecificCells() { // [START bigtable_hw_get_by_key] try { System.out.println("\nReading specific cells by family and qualifier"); - Row row = dataClient.readRow(tableId, 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) { @@ -189,7 +197,7 @@ public List readTable() { // [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) { @@ -209,6 +217,36 @@ public List readTable() { // [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] @@ -221,4 +259,29 @@ public void deleteTable() { } // [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/example/bigtable/InstanceAdminExample.java b/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java index 0bdae948d2..df813ace39 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java +++ b/samples/snippets/src/main/java/com/example/bigtable/InstanceAdminExample.java @@ -87,6 +87,11 @@ public void run() { addCluster(); deleteCluster(); deleteInstance(); + close(); + } + + // Close the client + void close() { adminClient.close(); } 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/example/bigtable/Quickstart.java b/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java index 8654d31edd..4c0a415c6d 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java +++ b/samples/snippets/src/main/java/com/example/bigtable/Quickstart.java @@ -23,6 +23,7 @@ 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 { @@ -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( 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 d68997c649..a5a7923bb3 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/Reads.java +++ b/samples/snippets/src/main/java/com/example/bigtable/Reads.java @@ -26,6 +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.TableId; import java.io.IOException; public class Reads { @@ -48,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) { @@ -79,7 +80,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) { @@ -104,7 +105,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); @@ -133,7 +136,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); @@ -160,7 +163,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); @@ -188,7 +191,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,6 +203,37 @@ public static void readPrefix(String projectId, String instanceId, String tableI } // [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. @@ -216,7 +250,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); diff --git a/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java b/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java index 9842658a82..5f804153a1 100644 --- a/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java +++ b/samples/snippets/src/main/java/com/example/bigtable/TableAdminExample.java @@ -108,6 +108,11 @@ public void run() { printModifiedColumnFamily(); deleteColumnFamily(); deleteTable(); + close(); + } + + // Close the client + void close() { adminClient.close(); } 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/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 index 8845c587ba..5a4475e898 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/BigtableBaseTest.java @@ -55,7 +55,7 @@ public void tearDown() { bout.reset(); } - public static String generateTableId(String prefix) { + public static String generateResourceId(String prefix) { return prefix + "-" + UUID.randomUUID().toString().substring(0, 20); } 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 e94602ec2b..f476fb1b23 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/FiltersTest.java @@ -43,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/example/bigtable/HelloWorldTest.java b/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java index f0fca85d79..ead4d6c3fd 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/HelloWorldTest.java @@ -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; @@ -99,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/example/bigtable/InstanceAdminExampleTest.java b/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java index dc66b2f9a2..15df1f8fa5 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/InstanceAdminExampleTest.java @@ -78,6 +78,9 @@ public void after() { if (adminClient.exists(instanceId)) { adminClient.deleteInstance(instanceId); } + if (instanceAdmin != null) { + instanceAdmin.close(); + } } @Test 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 index c31ec11ce2..f1a9ae5c01 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/MobileTimeSeriesBaseTest.java @@ -18,9 +18,11 @@ 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; @@ -28,9 +30,10 @@ public class MobileTimeSeriesBaseTest extends BigtableBaseTest { - public static final String TABLE_ID = generateTableId("mobile-time-series"); + 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 = @@ -42,7 +45,8 @@ public static void createTable() throws IOException { CreateTableRequest createTableRequest = CreateTableRequest.of(TABLE_ID) .addFamily(COLUMN_FAMILY_NAME_STATS) - .addFamily(COLUMN_FAMILY_NAME_PLAN); + .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()); @@ -53,7 +57,7 @@ public static void createTable() throws IOException { public static void writeStatsData() throws IOException { try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { BulkMutation bulkMutation = - BulkMutation.create(TABLE_ID) + BulkMutation.create(TableId.of(TABLE_ID)) .add( "phone#4c410523#20190501", Mutation.create() @@ -135,7 +139,7 @@ public static void writeStatsData() throws IOException { public static void writePlanData() throws IOException { try (BigtableDataClient dataClient = BigtableDataClient.create(projectId, instanceId)) { BulkMutation bulkMutation = - BulkMutation.create(TABLE_ID) + BulkMutation.create(TableId.of(TABLE_ID)) .add( "phone#4c410523#20190501", Mutation.create() @@ -170,7 +174,9 @@ public static void writePlanData() throws IOException { public static void cleanupTable() throws IOException { try (BigtableTableAdminClient adminClient = BigtableTableAdminClient.create(projectId, instanceId)) { - adminClient.deleteTable(TABLE_ID); + 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 index 2471f26b16..b8271de50e 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/QuickstartTest.java @@ -18,6 +18,13 @@ 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; @@ -28,8 +35,26 @@ public class QuickstartTest extends BigtableBaseTest { private static final String TABLE_ID = "quickstart-table"; @BeforeClass - public static void 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 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 dc3d56eed6..a895594979 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/ReadsTest.java @@ -186,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/TableAdminExampleTest.java b/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java index 391764b549..d4fd4de304 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/TableAdminExampleTest.java @@ -67,7 +67,7 @@ public static void afterClass() { @Before public void setup() throws IOException { - tableId = generateTableId(TABLE_PREFIX); + tableId = generateResourceId(TABLE_PREFIX); tableAdmin = new TableAdminExample(projectId, instanceId, tableId); adminClient.createTable(CreateTableRequest.of(tableId).addFamily("cf")); } @@ -77,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(TABLE_PREFIX); + String testTable = generateResourceId(TABLE_PREFIX); TableAdminExample testTableAdmin = new TableAdminExample(projectId, instanceId, testTable); testTableAdmin.createTable(); assertTrue(adminClient.exists(testTable)); 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 2bbdea0b15..ac6a09b4ef 100644 --- a/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java +++ b/samples/snippets/src/test/java/com/example/bigtable/WritesTest.java @@ -72,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/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..18778ba8c3 --- /dev/null +++ b/test-proxy/README.md @@ -0,0 +1,50 @@ +# CBT Java Test Proxy + +The CBT test proxy is intended for running confromance tests for Cloug 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..8b13789179 --- /dev/null +++ b/test-proxy/known_failures.txt @@ -0,0 +1 @@ + diff --git a/test-proxy/pom.xml b/test-proxy/pom.xml new file mode 100644 index 0000000000..89a0436b9c --- /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.45.0 + + + + 2.45.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/CbtTestProxy.java b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java new file mode 100644 index 0000000000..6e563d4df0 --- /dev/null +++ b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxy.java @@ -0,0 +1,769 @@ +/* + * 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 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.GoogleCredentials; +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.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.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.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.stub.StreamObserver; +import java.io.ByteArrayInputStream; +import java.io.Closeable; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import javax.annotation.Nullable; +import org.threeten.bp.Duration; + +/** 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( + boolean encrypted, + @Nullable String rootCerts, + @Nullable String sslTarget, + @Nullable String credential) { + this.encrypted = encrypted; + this.rootCerts = rootCerts; + this.sslTarget = sslTarget; + this.credential = credential; + this.idClientMap = new ConcurrentHashMap<>(); + } + + /** + * Factory method to return a proxy instance that interacts with server unencrypted and + * unauthenticated. + */ + public static CbtTestProxy createUnencrypted() { + return new CbtTestProxy(false, null, null, null); + } + + /** + * Factory method to return a proxy instance that interacts with server encrypted. Default + * authority and public certificates are used if null values are passed in. + * + * @param rootCertsPemPath The path to a root certificate PEM file + * @param sslTarget The override of SSL target name + * @param credentialJsonPath The path to a credential JSON file + */ + public static CbtTestProxy createEncrypted( + @Nullable String rootCertsPemPath, + @Nullable String sslTarget, + @Nullable String credentialJsonPath) + throws IOException { + String tmpRootCerts = null, tmpCredential = null; + if (rootCertsPemPath != null) { + Path file = Paths.get(rootCertsPemPath); + tmpRootCerts = new String(Files.readAllBytes(file), UTF_8); + } + if (credentialJsonPath != null) { + Path file = Paths.get(credentialJsonPath); + tmpCredential = new String(Files.readAllBytes(file), UTF_8); + } + + return new CbtTestProxy(true, tmpRootCerts, sslTarget, tmpCredential); + } + + /** + * 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); + + return settingsBuilder; + } + + private static void updateTimeout(RetrySettings.Builder settings, Duration newTimeout) { + Duration rpcTimeout = settings.getInitialRpcTimeout(); + + // TODO: this should happen in gax + // Clamp the rpcTimeout to the overall timeout + if (rpcTimeout != null && rpcTimeout.compareTo(newTimeout) > 0) { + settings.setInitialRpcTimeout(newTimeout).setMaxRpcTimeout(newTimeout); + } + + settings.setTotalTimeout(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"); + + if (idClientMap.contains(request.getClientId())) { + responseObserver.onError( + Status.ALREADY_EXISTS + .withDescription("Client " + request.getClientId() + " already exists.") + .asException()); + return; + } + + 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()); + + settingsBuilder.stubSettings().setEnableRoutingCookie(false); + settingsBuilder.stubSettings().setEnableRetryInfo(false); + + 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()) + .setCredentialsProvider(getCredentialsProvider()); + } + 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; + } + + // TODO(developer): evaluate if we want to manually unpack the proto into a model, instead of + // using fromProto. Same for the other methods. + RowMutation mutation = RowMutation.fromProto(request.getRequest()); + try { + // This response is empty. + client.dataClient().mutateRow(mutation); + } catch (ApiException e) { + responseObserver.onNext( + MutateRowResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .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.getDefaultInstance()).build()); + responseObserver.onCompleted(); + return; + } catch (ApiException e) { + responseObserver.onNext( + MutateRowsResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + responseObserver.onNext( + MutateRowsResult.newBuilder() + .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())); + } catch (ApiException e) { + responseObserver.onNext( + RowResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + if (row != null) { + try { + RowResult.Builder resultBuilder = convertRowResult(row); + responseObserver.onNext( + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } 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; + } + } else { + logger.info(String.format("readRow() did not find row: %s", request.getRowKey())); + responseObserver.onNext( + RowResult.newBuilder().setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } + 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); + } catch (ApiException e) { + responseObserver.onNext( + RowsResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + int cancelAfterRows = request.getCancelAfterRows(); + try { + RowsResult.Builder resultBuilder = convertRowsResult(rows, cancelAfterRows); + responseObserver.onNext( + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } 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( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + SampleRowKeysResult.Builder resultBuilder = SampleRowKeysResult.newBuilder(); + for (KeyOffset keyOffset : keyOffsets) { + resultBuilder + .addSamplesBuilder() + .setRowKey(keyOffset.getKey()) + .setOffsetBytes(keyOffset.getOffsetBytes()); + } + responseObserver.onNext( + 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( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + CheckAndMutateRowResult.Builder resultBuilder = CheckAndMutateRowResult.newBuilder(); + resultBuilder.getResultBuilder().setPredicateMatched(matched); + responseObserver.onNext( + 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); + } catch (ApiException e) { + responseObserver.onNext( + RowResult.newBuilder() + .setStatus( + com.google.rpc.Status.newBuilder() + .setCode(e.getStatusCode().getCode().ordinal()) + .setMessage(e.getMessage()) + .build()) + .build()); + responseObserver.onCompleted(); + return; + } + + if (row != null) { + try { + RowResult.Builder resultBuilder = convertRowResult(row); + responseObserver.onNext( + resultBuilder.setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } 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; + } + } else { + logger.info( + String.format( + "readModifyWriteRow() did not find row: %s", request.getRequest().getRowKey())); + responseObserver.onNext( + RowResult.newBuilder().setStatus(com.google.rpc.Status.getDefaultInstance()).build()); + } + 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); + } + + private InstantiatingGrpcChannelProvider getTransportChannel() throws IOException { + if (!encrypted) { + return EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build(); + } + + if (rootCerts == null) { + return EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder().build(); + } + + final SslContext secureContext = + GrpcSslContexts.forClient() + .trustManager(new ByteArrayInputStream(rootCerts.getBytes(UTF_8))) + .build(); + return EnhancedBigtableStubSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator( + new ApiFunction() { + @Override + public ManagedChannelBuilder apply(ManagedChannelBuilder input) { + NettyChannelBuilder channelBuilder = (NettyChannelBuilder) input; + channelBuilder.sslContext(secureContext).overrideAuthority(sslTarget); + return channelBuilder; + } + }) + .build(); + } + + private CredentialsProvider getCredentialsProvider() throws IOException { + if (credential == null) { + return NoCredentialsProvider.create(); + } + + final GoogleCredentials creds = + GoogleCredentials.fromStream(new ByteArrayInputStream(credential.getBytes(UTF_8))); + + return FixedCredentialsProvider.create(creds); + } + + private final ConcurrentHashMap idClientMap; + private final boolean encrypted; + + // Parameters that may be needed when "encrypted" is true. + private final String rootCerts; + private final String sslTarget; + private final String credential; + + 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..8750909f1a --- /dev/null +++ b/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/CbtTestProxyMain.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.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; + + // If encryption is specified + boolean encrypted = Boolean.getBoolean("encrypted"); + if (encrypted) { + String rootCertsPemPath = System.getProperty("root.certs.pem.path"); + String sslTarget = System.getProperty("ssl.target"); + String credentialJsonPath = System.getProperty("credential.json.path"); + cbtTestProxy = CbtTestProxy.createEncrypted(rootCertsPemPath, sslTarget, credentialJsonPath); + } else { + cbtTestProxy = CbtTestProxy.createUnencrypted(); + } + + logger.info(String.format("Test proxy starting on %d", port)); + ServerBuilder.forPort(port).addService(cbtTestProxy).build().start().awaitTermination(); + } +} 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..e7caef0e7b --- /dev/null +++ b/test-proxy/src/main/proto/test_proxy.proto @@ -0,0 +1,282 @@ +// 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. + +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/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 { + // 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; +} + +// 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; +} + +// 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) {} +} diff --git a/versions.txt b/versions.txt index 63dc15cc87..b05c4b4482 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,10 @@ # Format: # module:released-version:current-version -google-cloud-bigtable:2.5.3:2.5.3 -grpc-google-cloud-bigtable-admin-v2:2.5.3:2.5.3 -grpc-google-cloud-bigtable-v2:2.5.3:2.5.3 -proto-google-cloud-bigtable-admin-v2:2.5.3:2.5.3 -proto-google-cloud-bigtable-v2:2.5.3:2.5.3 -google-cloud-bigtable-emulator:0.142.3:0.142.3 +google-cloud-bigtable:2.45.0:2.45.0 +grpc-google-cloud-bigtable-admin-v2:2.45.0:2.45.0 +grpc-google-cloud-bigtable-v2:2.45.0:2.45.0 +proto-google-cloud-bigtable-admin-v2:2.45.0:2.45.0 +proto-google-cloud-bigtable-v2:2.45.0:2.45.0 +google-cloud-bigtable-emulator:0.182.0:0.182.0 +google-cloud-bigtable-emulator-core:0.182.0:0.182.0