Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/generated-files-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ externalManifests:
file: '.github/readme/synth.metadata/synth.metadata'
jsonpath: '$.generatedFiles[*]'
ignoreAuthors:
- 'cloud-java-bot'
- 'renovate-bot'
- 'yoshi-automation'
- 'release-please[bot]'
Expand Down
11 changes: 9 additions & 2 deletions .github/scripts/update_generation_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ set -e
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}"
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
if [[ -z "${latest}" ]]; then
echo "The latest version of ${group_id}:${artifact_id} is empty."
echo "The returned json from maven.org is invalid: ${json_content}"
exit 1
else
echo "${latest}"
fi
}

# Update a key to a new value in the generation config.
Expand Down
6 changes: 6 additions & 0 deletions .github/trusted-contribution.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
trustedContributors:
- renovate-bot
- gcf-owl-bot[bot]

annotations:
- type: comment
text: "/gcbrun"
- type: label
text: "kokoro:force-run"
2 changes: 1 addition & 1 deletion .github/workflows/hermetic_library_generation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- uses: googleapis/sdk-platform-java/.github/scripts@v2.55.1
- uses: googleapis/sdk-platform-java/.github/scripts@v2.56.0
if: env.SHOULD_RUN == 'true'
with:
base_ref: ${{ github.base_ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/renovate_config_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
renovate_bot_config_validation:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'

- name: Install Renovate and Config Validator
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update_generation_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
- name: Update params in generation config to latest
shell: bash
Expand All @@ -36,7 +37,8 @@ jobs:
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]"
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
bash .github/scripts/update_generation_config.sh \
--base_branch "${base_branch}"\
--base_branch "${base_branch}" \
--repo ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-a.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "[email protected]"
}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-b.cfg
Original file line number Diff line number Diff line change
@@ -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.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "[email protected]"
}
38 changes: 38 additions & 0 deletions .kokoro/presubmit/graalvm-c.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.45.1"
}

env_vars: {
key: "JOB_TYPE"
value: "graalvm"
}

# TODO: remove this after we've migrated all tests and scripts
env_vars: {
key: "GCLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_CLOUD_PROJECT"
value: "gcloud-devel"
}

env_vars: {
key: "GOOGLE_APPLICATION_CREDENTIALS"
value: "secret_manager/java-it-service-account"
}

env_vars: {
key: "SECRET_MANAGER_KEYS"
value: "java-it-service-account"
}

env_vars: {
key: "IT_SERVICE_ACCOUNT_EMAIL"
value: "[email protected]"
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Code in this repo is formatted with
[google-java-format](https://github.com/google/google-java-format).
To run formatting on your project, you can run:
```
mvn com.coveo:fmt-maven-plugin:format
mvn com.spotify.fmt:fmt-maven-plugin:format
```

[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.57.0')
implementation platform('com.google.cloud:libraries-bom:26.59.0')

implementation 'com.google.cloud:google-cloud-spanner'
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ public static void main(String[] args) throws ParseException {
String.format("projects/%s/instances/%s/databases/%s", project, instance, database);
} else {
throw new IllegalArgumentException(
"You must either set all the environment variables SPANNER_CLIENT_BENCHMARK_GOOGLE_CLOUD_PROJECT, SPANNER_CLIENT_BENCHMARK_SPANNER_INSTANCE and SPANNER_CLIENT_BENCHMARK_SPANNER_DATABASE, or specify a value for the command line argument --database");
"You must either set all the environment variables"
+ " SPANNER_CLIENT_BENCHMARK_GOOGLE_CLOUD_PROJECT,"
+ " SPANNER_CLIENT_BENCHMARK_SPANNER_INSTANCE and"
+ " SPANNER_CLIENT_BENCHMARK_SPANNER_DATABASE, or specify a value for the command"
+ " line argument --database");
}

LatencyBenchmark benchmark = new LatencyBenchmark(DatabaseId.of(fullyQualifiedDatabase));
Expand All @@ -69,13 +73,15 @@ private static CommandLine parseCommandLine(String[] args) throws ParseException
"w",
"wait",
true,
"The wait time in milliseconds between each query that is executed by each client. Defaults to 0. "
+ "Set this to for example 1000 to have each client execute 1 query per second.");
"The wait time in milliseconds between each query that is executed by each client. Defaults"
+ " to 0. Set this to for example 1000 to have each client execute 1 query per"
+ " second.");
options.addOption(
"t",
"transaction",
true,
"The type of transaction to execute. Must be either READ_ONLY or READ_WRITE. Defaults to READ_ONLY.");
"The type of transaction to execute. Must be either READ_ONLY or READ_WRITE. Defaults to"
+ " READ_ONLY.");
options.addOption("m", "multiplexed", true, "Use multiplexed sessions. Defaults to false.");
options.addOption("w", "wait", true, "Wait time in millis. Defaults to zero.");
options.addOption("name", true, "Name of this test run");
Expand Down
6 changes: 3 additions & 3 deletions generation_config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gapic_generator_version: 2.55.1
googleapis_commitish: 0c142cc0ed988797104f3c934b0d5cfe0906b948
libraries_bom_version: 26.57.0
gapic_generator_version: 2.56.0
googleapis_commitish: 4cf94378e6d3a16cd07017710d9aea762cf435a6
libraries_bom_version: 26.59.0
libraries:
- api_shortname: spanner
name_pretty: Cloud Spanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ public synchronized boolean finish(Mode finishMode) throws Exception {
}
}
}

/**
* All the context in which SpannerActions are executed. It stores the current running transaction
* and table metadata, shared by all the action executor and protected by a lock. There will only
Expand Down Expand Up @@ -790,7 +791,7 @@ private synchronized Spanner getClient(boolean useMultiplexedSession) throws IOE
if (client != null) {
return client;
}
client = getClient(/*timeoutSeconds=*/ 0, useMultiplexedSession);
client = getClient(/* timeoutSeconds= */ 0, useMultiplexedSession);
return client;
}

Expand Down Expand Up @@ -1021,7 +1022,7 @@ private Status executeAction(
return executeFinishTxn(action.getFinish(), outcomeSender, executionContext);
} else if (action.hasMutation()) {
return executeMutation(
action.getMutation(), outcomeSender, executionContext, /*isWrite=*/ false);
action.getMutation(), outcomeSender, executionContext, /* isWrite= */ false);
} else if (action.hasRead()) {
return executeRead(
useMultiplexedSession, action.getRead(), outcomeSender, executionContext);
Expand All @@ -1035,7 +1036,7 @@ private Status executeAction(
return executeCloudBatchDmlUpdates(action.getBatchDml(), outcomeSender, executionContext);
} else if (action.hasWrite()) {
return executeMutation(
action.getWrite().getMutation(), outcomeSender, executionContext, /*isWrite=*/ true);
action.getWrite().getMutation(), outcomeSender, executionContext, /* isWrite= */ true);
} else if (action.hasStartBatchTxn()) {
if (dbPath == null) {
throw SpannerExceptionFactory.newSpannerException(
Expand Down Expand Up @@ -3197,7 +3198,7 @@ private static com.google.cloud.spanner.KeyRange keyRangeProtoToCloudKeyRange(
return KeyRange.openClosed(start, end);
case OPEN_OPEN:
return KeyRange.openOpen(start, end);
// Unreachable.
// Unreachable.
default:
throw SpannerExceptionFactory.newSpannerException(
ErrorCode.INVALID_ARGUMENT, "Unrecognized key range type");
Expand Down Expand Up @@ -3250,7 +3251,7 @@ private static com.google.cloud.spanner.Key keyProtoToCloudKey(
case BYTES:
cloudKey.append(toByteArray(part.getBytesValue()));
break;
// Unreachable
// Unreachable
default:
throw SpannerExceptionFactory.newSpannerException(
ErrorCode.INVALID_ARGUMENT, "Unsupported key part type: " + type.getCode().name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ private Status flush() {
LOGGER.log(
Level.INFO,
String.format(
"OutcomeSender with action ID %s for change stream %s and partition token %s is "
+ "sending data change records with the following transaction id/record sequence "
+ "combinations: %s and partition tokens: %s",
"OutcomeSender with action ID %s for change stream %s and partition token %s is"
+ " sending data change records with the following transaction id/record"
+ " sequence combinations: %s and partition tokens: %s",
this.changeStreamForQuery,
this.partitionTokenForQuery,
actionId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,14 @@ public void onNext(SpannerAsyncActionRequest request) {
SessionPoolOptions.Builder sessionPoolOptionsBuilder;
if (request.getAction().getSpannerOptions().hasSessionPoolOptions()) {
sessionPoolOptionsBuilder =
request
.getAction()
.getSpannerOptions()
.getSessionPoolOptions()
.toBuilder()
request.getAction().getSpannerOptions().getSessionPoolOptions().toBuilder()
.setUseMultiplexed(true);
} else {
sessionPoolOptionsBuilder = SessionPoolOptions.newBuilder().setUseMultiplexed(true);
}

SpannerOptions.Builder optionsBuilder =
request
.getAction()
.getSpannerOptions()
.toBuilder()
request.getAction().getSpannerOptions().toBuilder()
.setSessionPoolOptions(sessionPoolOptionsBuilder);
SpannerAction.Builder actionBuilder =
request.getAction().toBuilder().setSpannerOptions(optionsBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public void onNext(SpannerAsyncActionRequest value) {
responseObserver.onError(
new IllegalArgumentException(
String.format(
"Unrecognized response type %s for method ExecuteActionAsync, expected %s or %s",
"Unrecognized response type %s for method ExecuteActionAsync, expected %s"
+ " or %s",
response == null ? "null" : response.getClass().getName(),
SpannerAsyncActionResponse.class.getName(),
Exception.class.getName())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ ResultSet executeQueryInternalWithOptions(
options.hasPrefetchChunks() ? options.prefetchChunks() : defaultPrefetchChunks;
final ExecuteSqlRequest.Builder request =
getExecuteSqlRequestBuilder(
statement, queryMode, options, /* withTransactionSelector = */ false);
statement, queryMode, options, /* withTransactionSelector= */ false);
ResumableStreamIterator stream =
new ResumableStreamIterator(
MAX_BUFFERED_CHUNKS,
Expand Down Expand Up @@ -1036,7 +1036,7 @@ CloseableIterator<PartialResultSet> startStream(
getTransactionChannelHint(),
isRouteToLeader());
session.markUsed(clock.instant());
stream.setCall(call, /* withBeginTransaction = */ builder.getTransaction().hasBegin());
stream.setCall(call, /* withBeginTransaction= */ builder.getTransaction().hasBegin());
return stream;
}

Expand Down
Loading