Skip to content

Commit 8b8b586

Browse files
chore: merge main into generate-libraries-main
2 parents ecda6e6 + 8095342 commit 8b8b586

10 files changed

Lines changed: 367 additions & 27 deletions

File tree

.github/workflows/sdk-platform-java-downstream.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
filters: |
2424
library:
2525
- 'sdk-platform-java/**'
26+
- .kokoro/downstream-compatibility.sh
2627
downstream-compatibility:
2728
needs: filter
2829
if: ${{ needs.filter.outputs.library == 'true' }}

.kokoro/downstream-compatibility.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ scriptDir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
2727
cd "${scriptDir}/.." # cd to the root of this repo
2828
source "$scriptDir/common.sh"
2929

30-
setup_maven_mirror
31-
3230
install_modules "sdk-platform-java"
3331
cd sdk-platform-java
3432

@@ -42,6 +40,9 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4240
git clone "https://github.com/googleapis/$repo.git" --depth=1 --branch "v$last_release"
4341
update_all_poms_dependency "$repo" google-cloud-shared-dependencies "$SHARED_DEPS_VERSION"
4442
pushd "$repo"
43+
echo "Diff to run the test with modified dependencies:"
44+
git --no-pager diff
45+
echo "---------------"
4546
JOB_TYPE="test" ./.kokoro/build.sh
4647
popd
4748
done

generation_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ libraries:
772772
api_description: Database Center provides an organization-wide, cross-product fleet
773773
health platform to eliminate the overhead, complexity, and risk associated with
774774
aggregating and summarizing health signals through custom dashboards. Through
775-
Database Centers fleet health dashboard and API, database platform teams that
775+
Database Center's fleet health dashboard and API, database platform teams that
776776
are responsible for reliability, compliance, security, cost, and administration
777777
of database fleets will now have a single pane of glass that pinpoints issues
778778
relevant to each team.
@@ -2924,7 +2924,7 @@ libraries:
29242924
product_documentation: https://cloud.google.com/web-risk/docs/
29252925
api_description: is a Google Cloud service that lets client applications check URLs
29262926
against Google's constantly updated lists of unsafe web resources. Unsafe web
2927-
resources include social engineering sitessuch as phishing and deceptive sitesand
2927+
resources include social engineering sites - such as phishing and deceptive sites - and
29282928
sites that host malware or unwanted software. With the Web Risk API, you can quickly
29292929
identify known bad sites, warn users before they click infected links, and prevent
29302930
users from posting links to known infected pages from your site. The Web Risk

java-databasecenter/.repo-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"api_shortname": "databasecenter",
33
"name_pretty": "Database Center API",
44
"product_documentation": "https://cloud.google.com/database-center/docs/overview",
5-
"api_description": "Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center\u2019s fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team.",
5+
"api_description": "Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center's fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team.",
66
"client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-databasecenter/latest/overview",
77
"release_level": "preview",
88
"transport": "both",

java-databasecenter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ to add `google-cloud-databasecenter` as a dependency in your code.
8787
## About Database Center API
8888

8989

90-
[Database Center API][product-docs] Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Centers fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team.
90+
[Database Center API][product-docs] Database Center provides an organization-wide, cross-product fleet health platform to eliminate the overhead, complexity, and risk associated with aggregating and summarizing health signals through custom dashboards. Through Database Center's fleet health dashboard and API, database platform teams that are responsible for reliability, compliance, security, cost, and administration of database fleets will now have a single pane of glass that pinpoints issues relevant to each team.
9191

9292
See the [Database Center API client library docs][javadocs] to learn how to
9393
use this Database Center API Client Library.

java-spanner/google-cloud-spanner/src/main/java/com/google/cloud/spanner/XGoogSpannerRequestId.java

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,20 @@ public class XGoogSpannerRequestId {
4242
@VisibleForTesting
4343
static final long VERSION = 1; // The version of the specification being implemented.
4444

45+
private static final String STATIC_PREFIX = VERSION + "." + RAND_PROCESS_ID + ".";
46+
4547
private final long nthClientId;
4648
private final long nthRequest;
4749
private long nthChannelId;
4850
private long attempt;
51+
private final String instancePrefix;
4952

5053
XGoogSpannerRequestId(long nthClientId, long nthChannelId, long nthRequest, long attempt) {
5154
this.nthClientId = nthClientId;
5255
this.nthChannelId = nthChannelId;
5356
this.nthRequest = nthRequest;
5457
this.attempt = attempt;
58+
this.instancePrefix = STATIC_PREFIX + nthClientId + ".";
5559
}
5660

5761
public static XGoogSpannerRequestId of(
@@ -122,26 +126,27 @@ private static String generateRandProcessId() {
122126

123127
/** Returns the string representation of this RequestId as it should be sent to Spanner. */
124128
public String getHeaderValue() {
125-
return String.format(
126-
"%d.%s.%d.%d.%d.%d",
127-
XGoogSpannerRequestId.VERSION,
128-
XGoogSpannerRequestId.RAND_PROCESS_ID,
129-
this.nthClientId,
130-
this.nthChannelId,
131-
this.nthRequest,
132-
this.attempt);
129+
return new StringBuilder(this.instancePrefix.length() + 48)
130+
.append(this.instancePrefix)
131+
.append(this.nthChannelId)
132+
.append('.')
133+
.append(this.nthRequest)
134+
.append('.')
135+
.append(this.attempt)
136+
.toString();
133137
}
134138

135139
@Override
136140
public String toString() {
137-
return String.format(
138-
"%d.%s.%d.%s.%d.%d",
139-
XGoogSpannerRequestId.VERSION,
140-
XGoogSpannerRequestId.RAND_PROCESS_ID,
141-
this.nthClientId,
142-
this.nthChannelId < 0 ? "x" : String.valueOf(this.nthChannelId),
143-
this.nthRequest,
144-
this.attempt);
141+
StringBuilder sb = new StringBuilder(this.instancePrefix.length() + 48);
142+
sb.append(this.instancePrefix);
143+
if (this.nthChannelId < 0) {
144+
sb.append('x');
145+
} else {
146+
sb.append(this.nthChannelId);
147+
}
148+
sb.append('.').append(this.nthRequest).append('.').append(this.attempt);
149+
return sb.toString();
145150
}
146151

147152
public String debugToString() {

java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ public PartialResultSet next() {
219219
PartialResultSet.Builder builder = PartialResultSet.newBuilder();
220220
if (first) {
221221
builder.setMetadata(resultSet.getMetadata());
222+
if (resultSet.hasCacheUpdate()) {
223+
builder.setCacheUpdate(resultSet.getCacheUpdate());
224+
}
222225
first = false;
223226
}
224227
int recordCount = 0;
@@ -380,9 +383,6 @@ private static boolean isValidKeySet(KeySet keySet) {
380383
int keys = 0;
381384
for (Key key : keySet.getKeys()) {
382385
keys++;
383-
if (key.size() != 0) {
384-
return false;
385-
}
386386
}
387387
return keys == 1;
388388
}

0 commit comments

Comments
 (0)