From 8547735ded47380c05d398108908aabfb543d824 Mon Sep 17 00:00:00 2001 From: Pratick Chokhani Date: Fri, 13 Dec 2024 11:52:06 +0530 Subject: [PATCH 01/13] test(spanner): Enabled multiplexed session for partitioned operations in systest. (#3545) --- .../com/google/cloud/executor/spanner/CloudClientExecutor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java index d3f5712646..d0490be44a 100644 --- a/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java +++ b/google-cloud-spanner-executor/src/main/java/com/google/cloud/executor/spanner/CloudClientExecutor.java @@ -832,6 +832,8 @@ private synchronized Spanner getClient(long timeoutSeconds, boolean useMultiplex SessionPoolOptionsHelper.setUseMultiplexedSession(poolOptionsBuilder, useMultiplexedSession); SessionPoolOptionsHelper.setUseMultiplexedSessionForRW( poolOptionsBuilder, useMultiplexedSession); + SessionPoolOptionsHelper.setUseMultiplexedSessionForPartitionedOperations( + poolOptionsBuilder, useMultiplexedSession); LOGGER.log( Level.INFO, String.format( From 80fe08dc1ccc68aeafe43b0c57bc7afdee055c6b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:20:25 -0500 Subject: [PATCH 02/13] chore(main): release 6.82.1-SNAPSHOT (#3526) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 ++++++++--------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 +++++++++---------- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 22c13635ce..6e7fd7bf6b 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index 1db01f1094..85721ffac5 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.82.0 + 6.82.1-SNAPSHOT pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT com.google.cloud google-cloud-spanner test-jar - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index ccb631bb1a..5e61e241e0 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.82.0 + 6.82.1-SNAPSHOT jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index b7589c1020..b319d9fe04 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 000a88b626..30487a57c0 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index b794aca19d..0f8a34788b 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index b63e9bd603..bb23ca37c7 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index dc1c2c1c93..28c5151e6f 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 72a2a6797e..8422efe037 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.82.0 + 6.82.1-SNAPSHOT Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index 4d29a245a8..dd32122e0b 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index 08da9e3b85..d24c9cfad3 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index 23a213ca72..53c9c6291c 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index 8c3dc7a8ad..c60bf93b4f 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.0 + 6.82.1-SNAPSHOT proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 9a6e4d0e30..6871ac6b4f 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.82.0 + 6.82.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 745b2174e2..b361e0ba01 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.0 -proto-google-cloud-spanner-v1:6.82.0:6.82.0 -proto-google-cloud-spanner-admin-database-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-admin-database-v1:6.82.0:6.82.0 -google-cloud-spanner:6.82.0:6.82.0 -google-cloud-spanner-executor:6.82.0:6.82.0 -proto-google-cloud-spanner-executor-v1:6.82.0:6.82.0 -grpc-google-cloud-spanner-executor-v1:6.82.0:6.82.0 +proto-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT +google-cloud-spanner:6.82.0:6.82.1-SNAPSHOT +google-cloud-spanner-executor:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT +grpc-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT From 6235f0f2c223718c537addc450fa5910d1500271 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 13 Dec 2024 17:09:48 +0100 Subject: [PATCH 03/13] deps: update sdk platform java dependencies (#3549) --- .github/workflows/hermetic_library_generation.yaml | 2 +- .github/workflows/unmanaged_dependency_check.yaml | 2 +- .kokoro/presubmit/graalvm-native-17.cfg | 2 +- .kokoro/presubmit/graalvm-native.cfg | 2 +- google-cloud-spanner-bom/pom.xml | 2 +- pom.xml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hermetic_library_generation.yaml b/.github/workflows/hermetic_library_generation.yaml index 35aa3b151d..604b674bad 100644 --- a/.github/workflows/hermetic_library_generation.yaml +++ b/.github/workflows/hermetic_library_generation.yaml @@ -37,7 +37,7 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} - - uses: googleapis/sdk-platform-java/.github/scripts@v2.50.0 + - uses: googleapis/sdk-platform-java/.github/scripts@v2.51.0 if: env.SHOULD_RUN == 'true' with: base_ref: ${{ github.base_ref }} diff --git a/.github/workflows/unmanaged_dependency_check.yaml b/.github/workflows/unmanaged_dependency_check.yaml index f5298fed0f..f62b0af0eb 100644 --- a/.github/workflows/unmanaged_dependency_check.yaml +++ b/.github/workflows/unmanaged_dependency_check.yaml @@ -17,6 +17,6 @@ jobs: # repository .kokoro/build.sh - name: Unmanaged dependency check - uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.40.0 + uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v3.41.0 with: bom-path: google-cloud-spanner-bom/pom.xml diff --git a/.kokoro/presubmit/graalvm-native-17.cfg b/.kokoro/presubmit/graalvm-native-17.cfg index 82ed3a43e4..76ca3ee6da 100644 --- a/.kokoro/presubmit/graalvm-native-17.cfg +++ b/.kokoro/presubmit/graalvm-native-17.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.41.0" } env_vars: { diff --git a/.kokoro/presubmit/graalvm-native.cfg b/.kokoro/presubmit/graalvm-native.cfg index a836c97f04..644bb62ce7 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-public-resources/graalvm_sdk_platform_a:3.40.0" + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.41.0" } env_vars: { diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index 85721ffac5..f746277c9c 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -8,7 +8,7 @@ com.google.cloud sdk-platform-java-config - 3.40.0 + 3.41.0 Google Cloud Spanner BOM diff --git a/pom.xml b/pom.xml index 8422efe037..67a5f525a0 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.google.cloud sdk-platform-java-config - 3.40.0 + 3.41.0 From c2d56147891c52866a856c9a5851cf307be58576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 17:46:16 +0100 Subject: [PATCH 04/13] chore: reset default to platform thread (#3551) Reset the default to using a platform thread for connections. This was the default before adding an option for setting the executor type, and the new default is causing problems with the async Connection API. Fixes #3541 --- .../com/google/cloud/spanner/connection/ConnectionImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java index 9f4a43d5a2..2d7c917d23 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionImpl.java @@ -292,7 +292,7 @@ static UnitOfWorkType of(TransactionMode transactionMode) { statementExecutorType = options.isUseVirtualThreads() ? StatementExecutorType.VIRTUAL_THREAD - : StatementExecutorType.DIRECT_EXECUTOR; + : StatementExecutorType.PLATFORM_THREAD; } this.statementExecutor = new StatementExecutor(statementExecutorType, options.getStatementExecutionInterceptors()); @@ -342,7 +342,7 @@ && getDialect() == Dialect.POSTGRESQL new StatementExecutor( options.isUseVirtualThreads() ? StatementExecutorType.VIRTUAL_THREAD - : StatementExecutorType.DIRECT_EXECUTOR, + : StatementExecutorType.PLATFORM_THREAD, Collections.emptyList()); this.spannerPool = Preconditions.checkNotNull(spannerPool); this.options = Preconditions.checkNotNull(options); From 41f83dcf046f955ec289d4e976f40a03922054cb Mon Sep 17 00:00:00 2001 From: cloud-java-bot <122572305+cloud-java-bot@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:18:21 -0500 Subject: [PATCH 05/13] chore: Update generation configuration at Fri Dec 13 16:21:35 UTC 2024 (#3523) * chore: Update generation configuration at Wed Dec 4 02:29:01 UTC 2024 * chore: Update generation configuration at Thu Dec 5 02:29:11 UTC 2024 * chore: Update generation configuration at Fri Dec 6 02:28:46 UTC 2024 * chore: generate libraries at Fri Dec 6 02:29:25 UTC 2024 * chore: Update generation configuration at Sat Dec 7 02:28:09 UTC 2024 * chore: Update generation configuration at Tue Dec 10 02:29:37 UTC 2024 * chore: Update generation configuration at Wed Dec 11 02:28:47 UTC 2024 * chore: Update generation configuration at Thu Dec 12 02:29:08 UTC 2024 * chore: generate libraries at Thu Dec 12 02:29:50 UTC 2024 * chore: Update generation configuration at Fri Dec 13 02:29:25 UTC 2024 * chore: Update generation configuration at Fri Dec 13 16:21:35 UTC 2024 * chore: generate libraries at Fri Dec 13 16:22:12 UTC 2024 * update workflow script --------- Co-authored-by: rahul2393 Co-authored-by: Joe Wang --- .github/scripts/update_generation_config.sh | 63 ++++++++++++++++--- README.md | 2 +- generation_config.yaml | 6 +- .../java/com/google/spanner/v1/TypeCode.java | 24 +++++++ .../java/com/google/spanner/v1/TypeProto.java | 20 +++--- .../main/proto/google/spanner/v1/type.proto | 4 ++ renovate.json | 17 ----- 7 files changed, 97 insertions(+), 39 deletions(-) diff --git a/.github/scripts/update_generation_config.sh b/.github/scripts/update_generation_config.sh index 561a313040..91434688cc 100644 --- a/.github/scripts/update_generation_config.sh +++ b/.github/scripts/update_generation_config.sh @@ -28,11 +28,23 @@ function update_config() { sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" } +# Update an action to a new version in GitHub action. +function update_action() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + # use a different delimiter because the key_word contains "/". + sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}" +} + # The parameters of this script is: # 1. base_branch, the base branch of the result pull request. # 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java # 3. [optional] generation_config, the path to the generation configuration, # the default value is generation_config.yaml in the repository root. +# 4. [optional] workflow, the library generation workflow file, +# the default value is .github/workflows/hermetic_library_generation.yaml. while [[ $# -gt 0 ]]; do key="$1" case "${key}" in @@ -48,6 +60,10 @@ case "${key}" in generation_config="$2" shift ;; + --workflow) + workflow="$2" + shift + ;; *) echo "Invalid option: [$1]" exit 1 @@ -71,21 +87,34 @@ if [ -z "${generation_config}" ]; then echo "Use default generation config: ${generation_config}" fi +if [ -z "${workflow}" ]; then + workflow=".github/workflows/hermetic_library_generation.yaml" + echo "Use default library generation workflow file: ${workflow}" +fi + current_branch="generate-libraries-${base_branch}" title="chore: Update generation configuration at $(date)" -# try to find a open pull request associated with the branch +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") -# create a branch if there's no open pull request associated with the +# Create a branch if there's no open pull request associated with the # branch; otherwise checkout the pull request. if [ -z "${pr_num}" ]; then git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" else gh pr checkout "${pr_num}" fi +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + mkdir tmp-googleapis -# use partial clone because only commit history is needed. +# 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 @@ -94,25 +123,43 @@ popd rm -rf tmp-googleapis update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" -# update gapic-generator-java version to the latest +# 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 +# Update composite action version to latest gapic-generator-java version +update_action "googleapis/sdk-platform-java/.github/scripts" \ + "${latest_version}" \ + "${workflow}" + +# Update libraries-bom version to the latest latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") update_config "libraries_bom_version" "${latest_version}" "${generation_config}" -git add "${generation_config}" +git add "${generation_config}" "${workflow}" changed_files=$(git diff --cached --name-only) if [[ "${changed_files}" == "" ]]; then echo "The latest generation config is not changed." echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" exit 0 fi -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 fetch -q remote_repo git push -f remote_repo "${current_branch}" gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" else diff --git a/README.md b/README.md index 29f1bb0322..296dd00f42 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.50.0') +implementation platform('com.google.cloud:libraries-bom:26.51.0') implementation 'com.google.cloud:google-cloud-spanner' ``` diff --git a/generation_config.yaml b/generation_config.yaml index ef44b5b9de..f7c5f12a08 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,6 +1,6 @@ -gapic_generator_version: 2.50.0 -googleapis_commitish: 349841abac6c3e580ccce6e3d6fcc182ed2512c2 -libraries_bom_version: 26.50.0 +gapic_generator_version: 2.51.0 +googleapis_commitish: 7d0c6bee2517d77635beb2a1dd6d6e7d4d943512 +libraries_bom_version: 26.51.0 libraries: - api_shortname: spanner name_pretty: Cloud Spanner diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java index 9c36f6c971..9db5e0c186 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeCode.java @@ -228,6 +228,17 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum { * INTERVAL = 16; */ INTERVAL(16), + /** + * + * + *
+   * Encoded as `string`, in lower-case hexa-decimal format, as described
+   * in RFC 9562, section 4.
+   * 
+ * + * UUID = 17; + */ + UUID(17), UNRECOGNIZED(-1), ; @@ -424,6 +435,17 @@ public enum TypeCode implements com.google.protobuf.ProtocolMessageEnum { * INTERVAL = 16; */ public static final int INTERVAL_VALUE = 16; + /** + * + * + *
+   * Encoded as `string`, in lower-case hexa-decimal format, as described
+   * in RFC 9562, section 4.
+   * 
+ * + * UUID = 17; + */ + public static final int UUID_VALUE = 17; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -481,6 +503,8 @@ public static TypeCode forNumber(int value) { return ENUM; case 16: return INTERVAL; + case 17: + return UUID; default: return null; } diff --git a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java index 3c41d2585b..e640269d99 100644 --- a/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java +++ b/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TypeProto.java @@ -60,20 +60,20 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pe_fqn\030\005 \001(\t\"\177\n\nStructType\0223\n\006fields\030\001 \003" + "(\0132#.google.spanner.v1.StructType.Field\032" + "<\n\005Field\022\014\n\004name\030\001 \001(\t\022%\n\004type\030\002 \001(\0132\027.g" - + "oogle.spanner.v1.Type*\325\001\n\010TypeCode\022\031\n\025TY" + + "oogle.spanner.v1.Type*\337\001\n\010TypeCode\022\031\n\025TY" + "PE_CODE_UNSPECIFIED\020\000\022\010\n\004BOOL\020\001\022\t\n\005INT64" + "\020\002\022\013\n\007FLOAT64\020\003\022\013\n\007FLOAT32\020\017\022\r\n\tTIMESTAM" + "P\020\004\022\010\n\004DATE\020\005\022\n\n\006STRING\020\006\022\t\n\005BYTES\020\007\022\t\n\005" + "ARRAY\020\010\022\n\n\006STRUCT\020\t\022\013\n\007NUMERIC\020\n\022\010\n\004JSON" - + "\020\013\022\t\n\005PROTO\020\r\022\010\n\004ENUM\020\016\022\014\n\010INTERVAL\020\020*d\n" - + "\022TypeAnnotationCode\022$\n TYPE_ANNOTATION_C" - + "ODE_UNSPECIFIED\020\000\022\016\n\nPG_NUMERIC\020\002\022\014\n\010PG_" - + "JSONB\020\003\022\n\n\006PG_OID\020\004B\254\001\n\025com.google.spann" - + "er.v1B\tTypeProtoP\001Z5cloud.google.com/go/" - + "spanner/apiv1/spannerpb;spannerpb\252\002\027Goog" - + "le.Cloud.Spanner.V1\312\002\027Google\\Cloud\\Spann" - + "er\\V1\352\002\032Google::Cloud::Spanner::V1b\006prot" - + "o3" + + "\020\013\022\t\n\005PROTO\020\r\022\010\n\004ENUM\020\016\022\014\n\010INTERVAL\020\020\022\010\n" + + "\004UUID\020\021*d\n\022TypeAnnotationCode\022$\n TYPE_AN" + + "NOTATION_CODE_UNSPECIFIED\020\000\022\016\n\nPG_NUMERI" + + "C\020\002\022\014\n\010PG_JSONB\020\003\022\n\n\006PG_OID\020\004B\254\001\n\025com.go" + + "ogle.spanner.v1B\tTypeProtoP\001Z5cloud.goog" + + "le.com/go/spanner/apiv1/spannerpb;spanne" + + "rpb\252\002\027Google.Cloud.Spanner.V1\312\002\027Google\\C" + + "loud\\Spanner\\V1\352\002\032Google::Cloud::Spanner" + + "::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto index 734cfb54cd..a8a73bf31e 100644 --- a/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto +++ b/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto @@ -175,6 +175,10 @@ enum TypeCode { // For example, `P1Y2M3DT4H5M6.5S` represents time duration of 1 year, 2 // months, 3 days, 4 hours, 5 minutes, and 6.5 seconds. INTERVAL = 16; + + // Encoded as `string`, in lower-case hexa-decimal format, as described + // in RFC 9562, section 4. + UUID = 17; } // `TypeAnnotationCode` is used as a part of [Type][google.spanner.v1.Type] to diff --git a/renovate.json b/renovate.json index 167bf279fe..3ad0aae27d 100644 --- a/renovate.json +++ b/renovate.json @@ -41,16 +41,6 @@ ], "depNameTemplate": "com.google.cloud:sdk-platform-java-config", "datasourceTemplate": "maven" - }, - { - "fileMatch": [ - "^.github/workflows/hermetic_library_generation.yaml$" - ], - "matchStrings": [ - "uses: googleapis/sdk-platform-java/.github/scripts@v(?.+?)\\n" - ], - "depNameTemplate": "com.google.api:gapic-generator-java", - "datasourceTemplate": "maven" } ], "packageRules": [ @@ -111,13 +101,6 @@ "^com.fasterxml.jackson.core" ], "groupName": "jackson dependencies" - }, - { - "matchPackagePatterns": [ - "^com.google.api:gapic-generator-java", - "^com.google.cloud:sdk-platform-java-config" - ], - "groupName": "SDK platform Java dependencies" } ], "semanticCommits": true, From c33c5e8438fe74de2616082b5e8230039ca86fe7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:01:00 +0530 Subject: [PATCH 06/13] chore(main): release 6.83.0 (#3547) * chore(main): release 6.83.0 * chore: generate libraries at Fri Dec 13 17:19:20 UTC 2024 --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: cloud-java-bot --- CHANGELOG.md | 22 +++++++++++++++++++ README.md | 6 ++--- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 +++++++-------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 ++++++++--------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 ++++++++--------- 17 files changed, 76 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1436e34143..aa465a1906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [6.83.0](https://github.com/googleapis/java-spanner/compare/v6.82.0...v6.83.0) (2024-12-13) + + +### Features + +* Add Metrics host for built in metrics ([#3519](https://github.com/googleapis/java-spanner/issues/3519)) ([4ed455a](https://github.com/googleapis/java-spanner/commit/4ed455a43edf7ff8d138ce4d40a52d3224383b14)) +* Add opt-in for using multiplexed sessions for blind writes ([#3540](https://github.com/googleapis/java-spanner/issues/3540)) ([216f53e](https://github.com/googleapis/java-spanner/commit/216f53e4cbc0150078ece7785da33b342a6ab082)) +* Add UUID in Spanner TypeCode enum ([41f83dc](https://github.com/googleapis/java-spanner/commit/41f83dcf046f955ec289d4e976f40a03922054cb)) +* Introduce java.time variables and methods ([#3495](https://github.com/googleapis/java-spanner/issues/3495)) ([8a7d533](https://github.com/googleapis/java-spanner/commit/8a7d533ded21b9b94992b68c702c08bb84474e1b)) +* **spanner:** Support multiplexed session for Partitioned operations ([#3231](https://github.com/googleapis/java-spanner/issues/3231)) ([4501a3e](https://github.com/googleapis/java-spanner/commit/4501a3ea69a9346e8b95edf6f94ff839b509ec73)) +* Support 'set local' for retry_aborts_internally ([#3532](https://github.com/googleapis/java-spanner/issues/3532)) ([331942f](https://github.com/googleapis/java-spanner/commit/331942f51b11660b9de9c8fe8aacd6f60ac254b5)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.0 ([41f83dc](https://github.com/googleapis/java-spanner/commit/41f83dcf046f955ec289d4e976f40a03922054cb)) + + +### Dependencies + +* Update sdk platform java dependencies ([#3549](https://github.com/googleapis/java-spanner/issues/3549)) ([6235f0f](https://github.com/googleapis/java-spanner/commit/6235f0f2c223718c537addc450fa5910d1500271)) + ## [6.82.0](https://github.com/googleapis/java-spanner/compare/v6.81.2...v6.82.0) (2024-12-04) diff --git a/README.md b/README.md index 296dd00f42..d6e321fc59 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,13 @@ implementation 'com.google.cloud:google-cloud-spanner' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-spanner:6.82.0' +implementation 'com.google.cloud:google-cloud-spanner:6.83.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.82.0" +libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "6.83.0" ``` ## Authentication @@ -725,7 +725,7 @@ 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-spanner/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-spanner.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.82.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-spanner/6.83.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 diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index 6e7fd7bf6b..a99f507906 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index f746277c9c..c47dd4d6a2 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.82.1-SNAPSHOT + 6.83.0 pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 com.google.cloud google-cloud-spanner test-jar - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0
diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index 5e61e241e0..aa1e3f4c0a 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.82.1-SNAPSHOT + 6.83.0 jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index b319d9fe04..78ea3c3c6d 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 30487a57c0..18c7bd598f 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index 0f8a34788b..78992b2516 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index bb23ca37c7..d481c40505 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index 28c5151e6f..344c4aa0c8 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/pom.xml b/pom.xml index 67a5f525a0..e9b4366114 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.82.1-SNAPSHOT + 6.83.0 Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index dd32122e0b..e9010b1062 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index d24c9cfad3..a9d5185760 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index 53c9c6291c..c329cb17fa 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index c60bf93b4f..0f4a788baf 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.82.1-SNAPSHOT + 6.83.0 proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 6871ac6b4f..e9d6615ba1 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.82.1-SNAPSHOT + 6.83.0 diff --git a/versions.txt b/versions.txt index b361e0ba01..497bc58077 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT -proto-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT -proto-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-admin-instance-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-admin-database-v1:6.82.0:6.82.1-SNAPSHOT -google-cloud-spanner:6.82.0:6.82.1-SNAPSHOT -google-cloud-spanner-executor:6.82.0:6.82.1-SNAPSHOT -proto-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT -grpc-google-cloud-spanner-executor-v1:6.82.0:6.82.1-SNAPSHOT +proto-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 +proto-google-cloud-spanner-v1:6.83.0:6.83.0 +proto-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 +google-cloud-spanner:6.83.0:6.83.0 +google-cloud-spanner-executor:6.83.0:6.83.0 +proto-google-cloud-spanner-executor-v1:6.83.0:6.83.0 +grpc-google-cloud-spanner-executor-v1:6.83.0:6.83.0 From 432fc4e7e300a49a675766e26eaffd7058a22cde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 21:32:31 +0100 Subject: [PATCH 07/13] chore: make state field volatile in AsyncResultSetImpl (#3550) * chore: make state field volatile in AsyncResultSetImpl Mark the `state` field in `AsyncResultSetImpl` volatile, as it is inspected by different threads. * fix: protect writes with monitor --------- Co-authored-by: rahul2393 --- .../com/google/cloud/spanner/AsyncResultSetImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java index 1161822cd1..d980c90f78 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/AsyncResultSetImpl.java @@ -112,9 +112,9 @@ private enum State { * Listeners that will be called when the {@link AsyncResultSetImpl} has finished fetching all * rows and any underlying transaction or session can be closed. */ - private Collection listeners = new LinkedList<>(); + private final Collection listeners = new LinkedList<>(); - private State state = State.INITIALIZED; + private volatile State state = State.INITIALIZED; /** This variable indicates that produce rows thread is initiated */ private volatile boolean produceRowsInitiated; @@ -498,10 +498,12 @@ public ApiFuture setCallback(Executor exec, ReadyCallback cb) { } private void initiateProduceRows() { - if (this.state == State.STREAMING_INITIALIZED) { - this.state = State.RUNNING; + synchronized (monitor) { + if (this.state == State.STREAMING_INITIALIZED) { + this.state = State.RUNNING; + } + produceRowsInitiated = true; } - produceRowsInitiated = true; this.service.execute(new ProduceRowsRunnable()); } From 109f8fc4ad9fa2ce3770a421cd88801b65956da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 13 Dec 2024 21:34:15 +0100 Subject: [PATCH 08/13] chore: make valid connection properties public (#3546) Make the list of valid connection properties public, so tools that depend on the Connection API can use this to for example generate documentation for valid properties. Also add valid values to the connection properties that have that (e.g. enums and booleans). Co-authored-by: rahul2393 --- .../connection/ConnectionProperties.java | 68 ++++++++++++++++--- .../connection/ConnectionProperty.java | 36 +++++++--- 2 files changed, 86 insertions(+), 18 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java index 0ca9b7256e..fd40efa8f4 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperties.java @@ -112,20 +112,22 @@ import com.google.cloud.spanner.connection.ClientSideStatementValueConverters.StringValueConverter; import com.google.cloud.spanner.connection.ConnectionProperty.Context; import com.google.cloud.spanner.connection.DirectedReadOptionsUtil.DirectedReadOptionsConverter; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.spanner.v1.DirectedReadOptions; import java.time.Duration; -import java.util.Map; /** * Utility class that defines all known connection properties. This class will eventually replace * the list of {@link com.google.cloud.spanner.connection.ConnectionOptions.ConnectionProperty} in * {@link ConnectionOptions}. */ -class ConnectionProperties { +public class ConnectionProperties { private static final ImmutableMap.Builder> CONNECTION_PROPERTIES_BUILDER = ImmutableMap.builder(); + private static final Boolean[] BOOLEANS = new Boolean[] {Boolean.TRUE, Boolean.FALSE}; + static final ConnectionProperty CONNECTION_STATE_TYPE = create( "connection_state_type", @@ -133,6 +135,7 @@ class ConnectionProperties { + "If no value is set, then the database dialect default will be used, " + "which is NON_TRANSACTIONAL for GoogleSQL and TRANSACTIONAL for PostgreSQL.", null, + ConnectionState.Type.values(), ConnectionStateTypeConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty TRACING_PREFIX = @@ -148,6 +151,7 @@ class ConnectionProperties { LENIENT_PROPERTY_NAME, "Silently ignore unknown properties in the connection string/properties (true/false)", DEFAULT_LENIENT, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENDPOINT = @@ -167,6 +171,7 @@ class ConnectionProperties { + "The instance and database in the connection string will automatically be created if these do not yet exist on the emulator. " + "Add dialect=postgresql to the connection string to make sure that the database that is created uses the PostgreSQL dialect.", false, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_AUTO_SAVEPOINTS_FOR_EMULATOR = @@ -175,6 +180,7 @@ class ConnectionProperties { "Automatically creates savepoints for each statement in a read/write transaction when using the Emulator. " + "This is no longer needed when using Emulator version 1.5.23 or higher.", false, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_PLAIN_TEXT = @@ -182,6 +188,7 @@ class ConnectionProperties { USE_PLAIN_TEXT_PROPERTY_NAME, "Use a plain text communication channel (i.e. non-TLS) for communicating with the server (true/false). Set this value to true for communication with the Cloud Spanner emulator.", DEFAULT_USE_PLAIN_TEXT, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); @@ -226,6 +233,7 @@ class ConnectionProperties { DIALECT_PROPERTY_NAME, "Sets the dialect to use for new databases that are created by this connection.", Dialect.GOOGLE_STANDARD_SQL, + Dialect.values(), DialectConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty TRACK_SESSION_LEAKS = @@ -238,6 +246,7 @@ class ConnectionProperties { + "actual session leak is detected. The stack trace of the exception will " + "in that case not contain the call stack of when the session was checked out.", DEFAULT_TRACK_SESSION_LEAKS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty TRACK_CONNECTION_LEAKS = @@ -250,6 +259,7 @@ class ConnectionProperties { + "actual connection leak is detected. The stack trace of the exception will " + "in that case not contain the call stack of when the connection was created.", DEFAULT_TRACK_CONNECTION_LEAKS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ROUTE_TO_LEADER = @@ -257,6 +267,7 @@ class ConnectionProperties { ROUTE_TO_LEADER_PROPERTY_NAME, "Should read/write transactions and partitioned DML be routed to leader region (true/false)", DEFAULT_ROUTE_TO_LEADER, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_VIRTUAL_THREADS = @@ -265,6 +276,7 @@ class ConnectionProperties { "Use a virtual thread instead of a platform thread for each connection (true/false). " + "This option only has any effect if the application is running on Java 21 or higher. In all other cases, the option is ignored.", DEFAULT_USE_VIRTUAL_THREADS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty USE_VIRTUAL_GRPC_TRANSPORT_THREADS = @@ -273,6 +285,7 @@ class ConnectionProperties { "Use a virtual thread instead of a platform thread for the gRPC executor (true/false). " + "This option only has any effect if the application is running on Java 21 or higher. In all other cases, the option is ignored.", DEFAULT_USE_VIRTUAL_GRPC_TRANSPORT_THREADS, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENABLE_EXTENDED_TRACING = @@ -282,6 +295,7 @@ class ConnectionProperties { + "by this connection. The SQL string is added as the standard OpenTelemetry " + "attribute 'db.statement'.", DEFAULT_ENABLE_EXTENDED_TRACING, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENABLE_API_TRACING = @@ -292,6 +306,7 @@ class ConnectionProperties { + "or if you want to debug potential latency problems caused by RPCs that are " + "being retried.", DEFAULT_ENABLE_API_TRACING, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty ENABLE_END_TO_END_TRACING = @@ -302,6 +317,7 @@ class ConnectionProperties { + "Server side traces can only go to Google Cloud Trace, so to see end to end traces, " + "the application should configure an exporter that exports the traces to Google Cloud Trace.", DEFAULT_ENABLE_END_TO_END_TRACING, + BOOLEANS, BooleanConverter.INSTANCE, Context.STARTUP); static final ConnectionProperty MIN_SESSIONS = @@ -345,6 +361,7 @@ class ConnectionProperties { AUTOCOMMIT_PROPERTY_NAME, "Should the connection start in autocommit (true/false)", DEFAULT_AUTOCOMMIT, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty READONLY = @@ -352,13 +369,16 @@ class ConnectionProperties { READONLY_PROPERTY_NAME, "Should the connection start in read-only mode (true/false)", DEFAULT_READONLY, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty AUTOCOMMIT_DML_MODE = create( "autocommit_dml_mode", - "Should the connection automatically retry Aborted errors (true/false)", + "Determines the transaction type that is used to execute " + + "DML statements when the connection is in auto-commit mode.", AutocommitDmlMode.TRANSACTIONAL, + AutocommitDmlMode.values(), AutocommitDmlModeConverter.INSTANCE, Context.USER); static final ConnectionProperty RETRY_ABORTS_INTERNALLY = @@ -371,6 +391,7 @@ class ConnectionProperties { RETRY_ABORTS_INTERNALLY_PROPERTY_NAME, "Should the connection automatically retry Aborted errors (true/false)", DEFAULT_RETRY_ABORTS_INTERNALLY, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty RETURN_COMMIT_STATS = @@ -378,6 +399,7 @@ class ConnectionProperties { "returnCommitStats", "Request that Spanner returns commit statistics for read/write transactions (true/false)", DEFAULT_RETURN_COMMIT_STATS, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE = @@ -389,6 +411,7 @@ class ConnectionProperties { + "the first write operation in a read/write transaction will be executed using the read/write transaction. Enabling this mode can reduce locking " + "and improve performance for applications that can handle the lower transaction isolation semantics.", DEFAULT_DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty KEEP_TRANSACTION_ALIVE = @@ -398,6 +421,7 @@ class ConnectionProperties { + "if no other statements are being executed. This option should be used with caution, as it can keep transactions alive and hold on to locks " + "longer than intended. This option should typically be used for CLI-type application that might wait for user input for a longer period of time.", DEFAULT_KEEP_TRANSACTION_ALIVE, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); @@ -415,6 +439,7 @@ class ConnectionProperties { + "Executing a query that cannot be partitioned will fail. " + "Executing a query in a read/write transaction will also fail.", DEFAULT_AUTO_PARTITION_MODE, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty DATA_BOOST_ENABLED = @@ -423,6 +448,7 @@ class ConnectionProperties { "Enable data boost for all partitioned queries that are executed by this connection. " + "This setting is only used for partitioned queries and is ignored by all other statements.", DEFAULT_DATA_BOOST_ENABLED, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty MAX_PARTITIONS = @@ -468,6 +494,7 @@ class ConnectionProperties { RPC_PRIORITY_NAME, "Sets the priority for all RPC invocations from this connection (HIGH/MEDIUM/LOW). The default is HIGH.", DEFAULT_RPC_PRIORITY, + RpcPriority.values(), RpcPriorityConverter.INSTANCE, Context.USER); static final ConnectionProperty SAVEPOINT_SUPPORT = @@ -475,6 +502,7 @@ class ConnectionProperties { "savepoint_support", "Determines the behavior of the connection when savepoints are used.", SavepointSupport.FAIL_AFTER_ROLLBACK, + SavepointSupport.values(), SavepointSupportConverter.INSTANCE, Context.USER); static final ConnectionProperty DDL_IN_TRANSACTION_MODE = @@ -482,6 +510,7 @@ class ConnectionProperties { DDL_IN_TRANSACTION_MODE_PROPERTY_NAME, "Determines how the connection should handle DDL statements in a read/write transaction.", DEFAULT_DDL_IN_TRANSACTION_MODE, + DdlInTransactionMode.values(), DdlInTransactionModeConverter.INSTANCE, Context.USER); static final ConnectionProperty MAX_COMMIT_DELAY = @@ -504,6 +533,7 @@ class ConnectionProperties { + "This setting is only in read/write transactions. DML statements in auto-commit mode " + "are executed directly.", DEFAULT_AUTO_BATCH_DML, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); static final ConnectionProperty AUTO_BATCH_DML_UPDATE_COUNT = @@ -538,12 +568,17 @@ class ConnectionProperties { + AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION_PROPERTY_NAME + " to false.", DEFAULT_AUTO_BATCH_DML_UPDATE_COUNT_VERIFICATION, + BOOLEANS, BooleanConverter.INSTANCE, Context.USER); - static final Map> CONNECTION_PROPERTIES = + static final ImmutableMap> CONNECTION_PROPERTIES = CONNECTION_PROPERTIES_BUILDER.build(); + /** The list of all supported connection properties. */ + public static ImmutableList> VALID_CONNECTION_PROPERTIES = + ImmutableList.copyOf(ConnectionProperties.CONNECTION_PROPERTIES.values()); + /** Utility method for creating a new core {@link ConnectionProperty}. */ private static ConnectionProperty create( String name, @@ -551,10 +586,27 @@ private static ConnectionProperty create( T defaultValue, ClientSideStatementValueConverter converter, Context context) { - ConnectionProperty property = - ConnectionProperty.create(name, description, defaultValue, converter, context); - CONNECTION_PROPERTIES_BUILDER.put(property.getKey(), property); - return property; + return create(name, description, defaultValue, null, converter, context); + } + + /** Utility method for creating a new core {@link ConnectionProperty}. */ + private static ConnectionProperty create( + String name, + String description, + T defaultValue, + T[] validValues, + ClientSideStatementValueConverter converter, + Context context) { + try { + ConnectionProperty property = + ConnectionProperty.create( + name, description, defaultValue, validValues, converter, context); + CONNECTION_PROPERTIES_BUILDER.put(property.getKey(), property); + return property; + } catch (Throwable t) { + t.printStackTrace(); + } + return null; } /** Parse the connection properties that can be found in the given connection URL. */ diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java index c203d44203..7c06774cf2 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionProperty.java @@ -37,12 +37,13 @@ * connection state is an opt-in. */ public class ConnectionProperty { + /** * Context indicates when a {@link ConnectionProperty} may be set. Each higher-ordinal value * includes the preceding values, meaning that a {@link ConnectionProperty} with {@link * Context#USER} can be set both at connection startup and during the connection's lifetime. */ - enum Context { + public enum Context { /** The property can only be set at startup of the connection. */ STARTUP, /** @@ -79,8 +80,20 @@ static ConnectionProperty create( T defaultValue, ClientSideStatementValueConverter converter, Context context) { + return create(name, description, defaultValue, null, converter, context); + } + + /** Utility method for creating a typed {@link ConnectionProperty}. */ + @Nonnull + static ConnectionProperty create( + @Nonnull String name, + String description, + T defaultValue, + T[] validValues, + ClientSideStatementValueConverter converter, + Context context) { return new ConnectionProperty<>( - null, name, description, defaultValue, null, converter, context); + null, name, description, defaultValue, validValues, converter, context); } /** @@ -163,35 +176,38 @@ ConnectionPropertyValue convert(@Nullable String stringValue) { return new ConnectionPropertyValue<>(this, convertedValue, convertedValue); } - String getKey() { + @Nonnull + public String getKey() { return this.key; } - boolean hasExtension() { + public boolean hasExtension() { return this.extension != null; } - String getExtension() { + public String getExtension() { return this.extension; } - String getName() { + @Nonnull + public String getName() { return this.name; } - String getDescription() { + @Nonnull + public String getDescription() { return this.description; } - T getDefaultValue() { + public T getDefaultValue() { return this.defaultValue; } - T[] getValidValues() { + public T[] getValidValues() { return this.validValues; } - Context getContext() { + public Context getContext() { return this.context; } } From 78c82edb4fcc4a5a9a372225ca429038c3b34955 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 14 Dec 2024 06:50:21 +0100 Subject: [PATCH 09/13] deps: update opentelemetry.version to v1.45.0 (#3531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.opentelemetry:opentelemetry-sdk-testing](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk-testing/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk-testing/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk-testing/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk-testing/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-sdk-trace](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk-trace/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk-trace/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk-trace/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk-trace/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-sdk-metrics](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk-metrics/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.opentelemetry:opentelemetry-sdk](https://redirect.github.com/open-telemetry/opentelemetry-java) | `1.44.1` -> `1.45.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.opentelemetry:opentelemetry-sdk/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.opentelemetry:opentelemetry-sdk/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.opentelemetry:opentelemetry-sdk/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.opentelemetry:opentelemetry-sdk/1.44.1/1.45.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
open-telemetry/opentelemetry-java (io.opentelemetry:opentelemetry-sdk-testing) ### [`v1.45.0`](https://redirect.github.com/open-telemetry/opentelemetry-java/blob/HEAD/CHANGELOG.md#Version-1450-2024-12-06) [Compare Source](https://redirect.github.com/open-telemetry/opentelemetry-java/compare/v1.44.1...v1.45.0) ##### API - Add convenience method `setAttribute(Attribute, int)` to SpanBuilder (matching the existing convenience method in Span) ([#​6884](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6884)) - Extends TextMapGetter with experimental GetAll() method, implement usage in W3CBaggagePropagator ([#​6852](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6852)) ##### SDK ##### Traces - Add synchronization to SimpleSpanProcessor to ensure thread-safe export of spans ([#​6885](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6885)) ##### Metrics - Lazily initialize ReservoirCells ([#​6851](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6851)) ##### Logs - Add synchronization to SimpleLogRecordProcessor to ensure thread-safe export of logs ([#​6885](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6885)) ##### Exporters - OTLP: Update opentelementry-proto to 1.4 ([#​6906](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6906)) - OTLP: Rename internal Marshaler#writeJsonToGenerator method to allow jackson runtimeOnly dependency ([#​6896](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6896)) - OTLP: Fix repeated string serialization for JSON. ([#​6888](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6888)) - OTLP: Fix missing unsafe available check ([#​6920](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6920)) ##### Extensions - Declarative config: Don't require empty objects when referencing custom components ([#​6891](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6891)) ##### Tooling - Add javadoc boilerplate internal comment v2 for experimental classes ([#​6886](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6886)) - Update develocity configuration ([#​6903](https://redirect.github.com/open-telemetry/opentelemetry-java/pull/6903))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/java-spanner). --- benchmarks/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index a99f507906..d418f739df 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -34,7 +34,7 @@ UTF-8 UTF-8 2.10.1 - 1.44.1 + 1.45.0
From a3d74b0f0cefd17dfc442512f02494a1cd769456 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 08:40:21 +0000 Subject: [PATCH 10/13] chore(main): release 6.83.1-SNAPSHOT (#3554) :robot: I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- benchmarks/pom.xml | 2 +- google-cloud-spanner-bom/pom.xml | 18 ++++++++--------- google-cloud-spanner-executor/pom.xml | 4 ++-- google-cloud-spanner/pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- grpc-google-cloud-spanner-executor-v1/pom.xml | 4 ++-- grpc-google-cloud-spanner-v1/pom.xml | 4 ++-- pom.xml | 20 +++++++++---------- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- .../pom.xml | 4 ++-- proto-google-cloud-spanner-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 20 +++++++++---------- 15 files changed, 51 insertions(+), 51 deletions(-) diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml index d418f739df..31ad076c28 100644 --- a/benchmarks/pom.xml +++ b/benchmarks/pom.xml @@ -24,7 +24,7 @@ com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/google-cloud-spanner-bom/pom.xml b/google-cloud-spanner-bom/pom.xml index c47dd4d6a2..d8f035ea2f 100644 --- a/google-cloud-spanner-bom/pom.xml +++ b/google-cloud-spanner-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner-bom - 6.83.0 + 6.83.1-SNAPSHOT pom com.google.cloud @@ -53,43 +53,43 @@ com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT com.google.cloud google-cloud-spanner test-jar - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/google-cloud-spanner-executor/pom.xml b/google-cloud-spanner-executor/pom.xml index aa1e3f4c0a..dd43ae439e 100644 --- a/google-cloud-spanner-executor/pom.xml +++ b/google-cloud-spanner-executor/pom.xml @@ -5,14 +5,14 @@ 4.0.0 com.google.cloud google-cloud-spanner-executor - 6.83.0 + 6.83.1-SNAPSHOT jar Google Cloud Spanner Executor com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/google-cloud-spanner/pom.xml b/google-cloud-spanner/pom.xml index 78ea3c3c6d..c5128cc19f 100644 --- a/google-cloud-spanner/pom.xml +++ b/google-cloud-spanner/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT jar Google Cloud Spanner https://github.com/googleapis/java-spanner @@ -11,7 +11,7 @@ com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT google-cloud-spanner diff --git a/grpc-google-cloud-spanner-admin-database-v1/pom.xml b/grpc-google-cloud-spanner-admin-database-v1/pom.xml index 18c7bd598f..2ec9ebce7b 100644 --- a/grpc-google-cloud-spanner-admin-database-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1 GRPC library for grpc-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml index 78992b2516..78a64b26cb 100644 --- a/grpc-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/grpc-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1 GRPC library for grpc-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-executor-v1/pom.xml b/grpc-google-cloud-spanner-executor-v1/pom.xml index d481c40505..de84666cd4 100644 --- a/grpc-google-cloud-spanner-executor-v1/pom.xml +++ b/grpc-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-executor-v1 GRPC library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/grpc-google-cloud-spanner-v1/pom.xml b/grpc-google-cloud-spanner-v1/pom.xml index 344c4aa0c8..294952b7ec 100644 --- a/grpc-google-cloud-spanner-v1/pom.xml +++ b/grpc-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT grpc-google-cloud-spanner-v1 GRPC library for grpc-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index e9b4366114..46157f0f1e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-spanner-parent pom - 6.83.0 + 6.83.1-SNAPSHOT Google Cloud Spanner Parent https://github.com/googleapis/java-spanner @@ -61,47 +61,47 @@ com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-database-v1/pom.xml b/proto-google-cloud-spanner-admin-database-v1/pom.xml index e9010b1062..af791549cd 100644 --- a/proto-google-cloud-spanner-admin-database-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-database-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-database-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1 PROTO library for proto-google-cloud-spanner-admin-database-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-admin-instance-v1/pom.xml b/proto-google-cloud-spanner-admin-instance-v1/pom.xml index a9d5185760..96dfaf95ad 100644 --- a/proto-google-cloud-spanner-admin-instance-v1/pom.xml +++ b/proto-google-cloud-spanner-admin-instance-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-admin-instance-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1 PROTO library for proto-google-cloud-spanner-admin-instance-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-executor-v1/pom.xml b/proto-google-cloud-spanner-executor-v1/pom.xml index c329cb17fa..c37eb525cc 100644 --- a/proto-google-cloud-spanner-executor-v1/pom.xml +++ b/proto-google-cloud-spanner-executor-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-executor-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-executor-v1 Proto library for google-cloud-spanner com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/proto-google-cloud-spanner-v1/pom.xml b/proto-google-cloud-spanner-v1/pom.xml index 0f4a788baf..16495a9b5c 100644 --- a/proto-google-cloud-spanner-v1/pom.xml +++ b/proto-google-cloud-spanner-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-spanner-v1 - 6.83.0 + 6.83.1-SNAPSHOT proto-google-cloud-spanner-v1 PROTO library for proto-google-cloud-spanner-v1 com.google.cloud google-cloud-spanner-parent - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index e9d6615ba1..3bf1c4779c 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -32,7 +32,7 @@ com.google.cloud google-cloud-spanner - 6.83.0 + 6.83.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index 497bc58077..371f87c50c 100644 --- a/versions.txt +++ b/versions.txt @@ -1,13 +1,13 @@ # Format: # module:released-version:current-version -proto-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 -proto-google-cloud-spanner-v1:6.83.0:6.83.0 -proto-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-admin-database-v1:6.83.0:6.83.0 -google-cloud-spanner:6.83.0:6.83.0 -google-cloud-spanner-executor:6.83.0:6.83.0 -proto-google-cloud-spanner-executor-v1:6.83.0:6.83.0 -grpc-google-cloud-spanner-executor-v1:6.83.0:6.83.0 +proto-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.1-SNAPSHOT +proto-google-cloud-spanner-v1:6.83.0:6.83.1-SNAPSHOT +proto-google-cloud-spanner-admin-database-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-admin-instance-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-admin-database-v1:6.83.0:6.83.1-SNAPSHOT +google-cloud-spanner:6.83.0:6.83.1-SNAPSHOT +google-cloud-spanner-executor:6.83.0:6.83.1-SNAPSHOT +proto-google-cloud-spanner-executor-v1:6.83.0:6.83.1-SNAPSHOT +grpc-google-cloud-spanner-executor-v1:6.83.0:6.83.1-SNAPSHOT From 801346a1b2efe7d0144f7442e1568eb5b02ddcbc Mon Sep 17 00:00:00 2001 From: Sagnik Ghosh Date: Mon, 16 Dec 2024 07:00:34 +0000 Subject: [PATCH 11/13] feat(spanner): add jdbc support for external hosts (#3536) * feat(spanner): add jdbc support for external hosts * feat(spanner): added default port value and unit tests * feat(spanner): fixed redundant class name typo --- .../spanner/connection/ConnectionOptions.java | 40 ++++++++++++++++--- .../connection/ConnectionOptionsTest.java | 37 +++++++++++++++++ 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java index 2be2d7980b..6e991816ab 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java @@ -628,11 +628,16 @@ private Builder() {} public static final String SPANNER_URI_FORMAT = "(?:cloudspanner:)(?//[\\w.-]+(?:\\.[\\w\\.-]+)*[\\w\\-\\._~:/?#\\[\\]@!\\$&'\\(\\)\\*\\+,;=.]+)?/projects/(?(([a-z]|[-.:]|[0-9])+|(DEFAULT_PROJECT_ID)))(/instances/(?([a-z]|[-]|[0-9])+)(/databases/(?([a-z]|[-]|[_]|[0-9])+))?)?(?:[?|;].*)?"; + public static final String EXTERNAL_HOST_FORMAT = + "(?:cloudspanner:)(?//[\\w.-]+(?::\\d+)?)(/instances/(?[a-z0-9-]+))?(/databases/(?[a-z0-9_-]+))(?:[?;].*)?"; private static final String SPANNER_URI_REGEX = "(?is)^" + SPANNER_URI_FORMAT + "$"; @VisibleForTesting static final Pattern SPANNER_URI_PATTERN = Pattern.compile(SPANNER_URI_REGEX); + @VisibleForTesting + static final Pattern EXTERNAL_HOST_PATTERN = Pattern.compile(EXTERNAL_HOST_FORMAT); + private static final String HOST_GROUP = "HOSTGROUP"; private static final String PROJECT_GROUP = "PROJECTGROUP"; private static final String INSTANCE_GROUP = "INSTANCEGROUP"; @@ -643,6 +648,10 @@ private boolean isValidUri(String uri) { return SPANNER_URI_PATTERN.matcher(uri).matches(); } + private boolean isValidExternalHostUri(String uri) { + return EXTERNAL_HOST_PATTERN.matcher(uri).matches(); + } + /** * Sets the URI of the Cloud Spanner database to connect to. A connection URI must be specified * in this format: @@ -700,9 +709,11 @@ private boolean isValidUri(String uri) { * @return this builder */ public Builder setUri(String uri) { - Preconditions.checkArgument( - isValidUri(uri), - "The specified URI is not a valid Cloud Spanner connection URI. Please specify a URI in the format \"cloudspanner:[//host[:port]]/projects/project-id[/instances/instance-id[/databases/database-name]][\\?property-name=property-value[;property-name=property-value]*]?\""); + if (!isValidExternalHostUri(uri)) { + Preconditions.checkArgument( + isValidUri(uri), + "The specified URI is not a valid Cloud Spanner connection URI. Please specify a URI in the format \"cloudspanner:[//host[:port]]/projects/project-id[/instances/instance-id[/databases/database-name]][\\?property-name=property-value[;property-name=property-value]*]?\""); + } ConnectionPropertyValue value = cast(ConnectionProperties.parseValues(uri).get(LENIENT.getKey())); checkValidProperties(value != null && value.getValue(), uri); @@ -829,7 +840,14 @@ public static Builder newBuilder() { private final SpannerOptionsConfigurator configurator; private ConnectionOptions(Builder builder) { - Matcher matcher = Builder.SPANNER_URI_PATTERN.matcher(builder.uri); + Matcher matcher; + boolean isExternalHost = false; + if (builder.isValidExternalHostUri(builder.uri)) { + matcher = Builder.EXTERNAL_HOST_PATTERN.matcher(builder.uri); + isExternalHost = true; + } else { + matcher = Builder.SPANNER_URI_PATTERN.matcher(builder.uri); + } Preconditions.checkArgument( matcher.find(), String.format("Invalid connection URI specified: %s", builder.uri)); @@ -947,12 +965,18 @@ && getInitialConnectionPropertyValue(OAUTH_TOKEN) == null this.sessionPoolOptions = SessionPoolOptions.newBuilder().setAutoDetectDialect(true).build(); } - String projectId = matcher.group(Builder.PROJECT_GROUP); + String projectId = "default"; + String instanceId = matcher.group(Builder.INSTANCE_GROUP); + if (!isExternalHost) { + projectId = matcher.group(Builder.PROJECT_GROUP); + } else if (instanceId == null) { + instanceId = "default"; + } if (Builder.DEFAULT_PROJECT_ID_PLACEHOLDER.equalsIgnoreCase(projectId)) { projectId = getDefaultProjectId(this.credentials); } this.projectId = projectId; - this.instanceId = matcher.group(Builder.INSTANCE_GROUP); + this.instanceId = instanceId; this.databaseName = matcher.group(Builder.DATABASE_GROUP); } @@ -981,6 +1005,10 @@ static String determineHost( // The leading '//' is already included in the regex for the connection URL, so we don't need // to add the leading '//' to the host name here. host = matcher.group(Builder.HOST_GROUP); + if (Builder.EXTERNAL_HOST_FORMAT.equals(matcher.pattern().pattern()) + && !host.matches(".*:\\d+$")) { + host = String.format("%s:15000", host); + } } if (usePlainText) { return PLAIN_TEXT_PROTOCOL + host; diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java index f826ec08df..69c4a01032 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ConnectionOptionsTest.java @@ -16,6 +16,7 @@ package com.google.cloud.spanner.connection; +import static com.google.cloud.spanner.connection.ConnectionOptions.Builder.EXTERNAL_HOST_PATTERN; import static com.google.cloud.spanner.connection.ConnectionOptions.Builder.SPANNER_URI_PATTERN; import static com.google.cloud.spanner.connection.ConnectionOptions.DEFAULT_ENDPOINT; import static com.google.cloud.spanner.connection.ConnectionOptions.determineHost; @@ -1211,4 +1212,40 @@ public void testEnableApiTracing() { .build() .isEnableApiTracing()); } + + @Test + public void testExternalHostPatterns() { + Matcher matcherWithoutInstance = + EXTERNAL_HOST_PATTERN.matcher("cloudspanner://localhost:15000/databases/test-db"); + assertTrue(matcherWithoutInstance.matches()); + assertNull(matcherWithoutInstance.group("INSTANCEGROUP")); + assertEquals("test-db", matcherWithoutInstance.group("DATABASEGROUP")); + Matcher matcherWithProperty = + EXTERNAL_HOST_PATTERN.matcher( + "cloudspanner://localhost:15000/instances/default/databases/singers-db?usePlainText=true"); + assertTrue(matcherWithProperty.matches()); + assertEquals("default", matcherWithProperty.group("INSTANCEGROUP")); + assertEquals("singers-db", matcherWithProperty.group("DATABASEGROUP")); + Matcher matcherWithoutPort = + EXTERNAL_HOST_PATTERN.matcher( + "cloudspanner://localhost/instances/default/databases/test-db"); + assertTrue(matcherWithoutPort.matches()); + assertEquals("default", matcherWithoutPort.group("INSTANCEGROUP")); + assertEquals("test-db", matcherWithoutPort.group("DATABASEGROUP")); + assertEquals( + "http://localhost:15000", + determineHost( + matcherWithoutPort, + DEFAULT_ENDPOINT, + /* autoConfigEmulator= */ true, + /* usePlainText= */ true, + ImmutableMap.of())); + Matcher matcherWithProject = + EXTERNAL_HOST_PATTERN.matcher( + "cloudspanner://localhost:15000/projects/default/instances/default/databases/singers-db"); + assertFalse(matcherWithProject.matches()); + Matcher matcherWithoutHost = + EXTERNAL_HOST_PATTERN.matcher("cloudspanner:/instances/default/databases/singers-db"); + assertFalse(matcherWithoutHost.matches()); + } } From 557b21459de3ad6a08b1710794ca97fb1b8bf7d6 Mon Sep 17 00:00:00 2001 From: Sakthivel Subramanian <179120858+sakthivelmanii@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:16:34 +0530 Subject: [PATCH 12/13] ci(spanner): improve performance of samples tests (#3558) --- samples/install-without-bom/pom.xml | 5 +++++ samples/snapshot/pom.xml | 5 +++++ samples/snippets/pom.xml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index cc7900ed24..0d6406bd32 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -147,6 +147,8 @@ maven-failsafe-plugin 3.5.2 + 10 + false java-sample-integration-tests java-client-mr-integration-tests @@ -157,6 +159,9 @@ mysample quick-db + + **/SpannerSampleIT.java + diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 3bf1c4779c..772e830d5e 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -146,6 +146,8 @@ maven-failsafe-plugin 3.5.2 + 10 + false java-sample-integration-tests java-client-mr-integration-tests @@ -157,6 +159,9 @@ mysample-instance quick-db + + **/SpannerSampleIT.java + diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml index df0488ac11..a137325f54 100644 --- a/samples/snippets/pom.xml +++ b/samples/snippets/pom.xml @@ -177,6 +177,8 @@ maven-failsafe-plugin 3.5.2 + 10 + false java-sample-integration-tests java-client-mr-integration-tests @@ -187,6 +189,9 @@ mysample quick-db + + **/SpannerSampleIT.java + From 430143ccc96c4bf5bbccd717b820e301b8a6b474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Mon, 16 Dec 2024 18:00:28 +0100 Subject: [PATCH 13/13] test: unflake RetryOnInvalidatedSessionTest (#3561) --- .../google/cloud/spanner/RetryOnInvalidatedSessionTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java index a6c3f9fa7c..f070f15421 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/RetryOnInvalidatedSessionTest.java @@ -207,7 +207,7 @@ public static void stopServer() throws InterruptedException { public void setUp() throws InterruptedException { mockSpanner.reset(); if (spanner == null - || spanner.getOptions().getSessionPoolOptions().isFailIfPoolExhausted() + || spanner.getOptions().getSessionPoolOptions().isFailIfSessionNotFound() != failOnInvalidatedSession) { if (spanner != null) { spanner.close(); @@ -228,8 +228,8 @@ public void setUp() throws InterruptedException { .build() .getService(); client = spanner.getDatabaseClient(DatabaseId.of("[PROJECT]", "[INSTANCE]", "[DATABASE]")); - invalidateSessionPool(client, spanner.getOptions().getSessionPoolOptions().getMinSessions()); } + invalidateSessionPool(client, spanner.getOptions().getSessionPoolOptions().getMinSessions()); } private static void invalidateSessionPool(DatabaseClient client, int minSessions) @@ -1002,6 +1002,7 @@ public void transactionManagerBatchUpdate() throws InterruptedException { } catch (AbortedException e) { transaction = assertThrowsSessionNotFoundIfShouldFail(() -> manager.resetForRetry()); if (transaction == null) { + manager.close(); break; } }