Skip to content

Commit 4004fdd

Browse files
committed
Merge branch 'main' of github.com:googleapis/java-spanner into uuid
2 parents df4c6c1 + 92494d0 commit 4004fdd

24 files changed

+2726
-859
lines changed

.kokoro/build.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ integration)
9898
-Dclirr.skip=true \
9999
-Denforcer.skip=true \
100100
-Dmaven.main.skip=true \
101-
-Dspanner.gce.config.project_id=gcloud-devel \
102-
-Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests \
101+
-Dspanner.gce.config.server_url=https://staging-wrenchworks.sandbox.googleapis.com \
102+
-Dspanner.gce.config.project_id=span-cloud-testing \
103+
-Dspanner.testenv.instance=projects/span-cloud-testing/instances/java-client-integration-tests \
103104
-fae \
104105
verify
105106
RETURN_CODE=$?
@@ -113,6 +114,7 @@ integration-directpath-enabled)
113114
-Dclirr.skip=true \
114115
-Denforcer.skip=true \
115116
-Dmaven.main.skip=true \
117+
-Dspanner.gce.config.server_url=https://staging-wrenchworks.sandbox.googleapis.com \
116118
-Dspanner.testenv.instance=projects/span-cloud-testing/instances/spanner-java-client-directpath \
117119
-Dspanner.gce.config.project_id=span-cloud-testing \
118120
-fae \
@@ -128,8 +130,9 @@ integration-multiplexed-sessions-enabled)
128130
-Dclirr.skip=true \
129131
-Denforcer.skip=true \
130132
-Dmaven.main.skip=true \
131-
-Dspanner.gce.config.project_id=gcloud-devel \
132-
-Dspanner.testenv.instance=projects/gcloud-devel/instances/java-client-integration-tests-multiplexed-sessions \
133+
-Dspanner.gce.config.server_url=https://staging-wrenchworks.sandbox.googleapis.com \
134+
-Dspanner.gce.config.project_id=span-cloud-testing \
135+
-Dspanner.testenv.instance=projects/span-cloud-testing/instances/java-client-integration-tests-multiplexed-sessions \
133136
-fae \
134137
verify
135138
RETURN_CODE=$?

.kokoro/presubmit/integration-directpath-enabled.cfg

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ env_vars: {
1111
value: "integration-directpath-enabled"
1212
}
1313

14-
# TODO: remove this after we've migrated all tests and scripts
15-
env_vars: {
16-
key: "GCLOUD_PROJECT"
17-
value: "gcloud-devel"
18-
}
19-
20-
env_vars: {
21-
key: "GOOGLE_CLOUD_PROJECT"
22-
value: "gcloud-devel"
23-
}
24-
2514
env_vars: {
2615
key: "GOOGLE_APPLICATION_CREDENTIALS"
2716
value: "secret_manager/java-client-testing"

.kokoro/presubmit/integration-multiplexed-sessions-enabled.cfg

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,14 @@ env_vars: {
1111
value: "integration-multiplexed-sessions-enabled"
1212
}
1313

14-
# TODO: remove this after we've migrated all tests and scripts
15-
env_vars: {
16-
key: "GCLOUD_PROJECT"
17-
value: "gcloud-devel"
18-
}
19-
20-
env_vars: {
21-
key: "GOOGLE_CLOUD_PROJECT"
22-
value: "gcloud-devel"
23-
}
24-
2514
env_vars: {
2615
key: "GOOGLE_APPLICATION_CREDENTIALS"
27-
value: "secret_manager/java-it-service-account"
16+
value: "secret_manager/java-client-testing"
2817
}
2918

3019
env_vars: {
3120
key: "SECRET_MANAGER_KEYS"
32-
value: "java-it-service-account"
21+
value: "java-client-testing"
3322
}
3423

3524
env_vars: {

.kokoro/presubmit/integration.cfg

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,12 @@ env_vars: {
1111
value: "integration"
1212
}
1313

14-
# TODO: remove this after we've migrated all tests and scripts
15-
env_vars: {
16-
key: "GCLOUD_PROJECT"
17-
value: "gcloud-devel"
18-
}
19-
20-
env_vars: {
21-
key: "GOOGLE_CLOUD_PROJECT"
22-
value: "gcloud-devel"
23-
}
24-
2514
env_vars: {
2615
key: "GOOGLE_APPLICATION_CREDENTIALS"
27-
value: "secret_manager/java-it-service-account"
16+
value: "secret_manager/java-client-testing"
2817
}
2918

3019
env_vars: {
3120
key: "SECRET_MANAGER_KEYS"
32-
value: "java-it-service-account"
21+
value: "java-client-testing"
3322
}
34-

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
1919
<dependency>
2020
<groupId>com.google.cloud</groupId>
2121
<artifactId>libraries-bom</artifactId>
22-
<version>26.54.0</version>
22+
<version>26.57.0</version>
2323
<type>pom</type>
2424
<scope>import</scope>
2525
</dependency>
@@ -525,6 +525,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-spanner/tree/
525525
| Create Sequence Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateSequenceSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateSequenceSample.java) |
526526
| Create Table With Foreign Key Delete Cascade Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CreateTableWithForeignKeyDeleteCascadeSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CreateTableWithForeignKeyDeleteCascadeSample.java) |
527527
| Custom Timeout And Retry Settings Example | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/CustomTimeoutAndRetrySettingsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/CustomTimeoutAndRetrySettingsExample.java) |
528+
| Database Add Split Points Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/DatabaseAddSplitPointsSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/DatabaseAddSplitPointsSample.java) |
528529
| Delete Backup Schedule Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/DeleteBackupScheduleSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/DeleteBackupScheduleSample.java) |
529530
| Delete Instance Config Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/DeleteInstanceConfigSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/DeleteInstanceConfigSample.java) |
530531
| Delete Using Dml Returning Sample | [source code](https://github.com/googleapis/java-spanner/blob/main/samples/snippets/src/main/java/com/example/spanner/DeleteUsingDmlReturningSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-spanner&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/spanner/DeleteUsingDmlReturningSample.java) |

google-cloud-spanner/clirr-ignored-differences.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,5 +959,23 @@
959959
<className>com/google/cloud/spanner/connection/ConnectionOptions</className>
960960
<field>VALID_PROPERTIES</field>
961961
</difference>
962+
963+
<!-- Remove supportsExplain() from the parser -->
964+
<difference>
965+
<differenceType>7002</differenceType>
966+
<className>com/google/cloud/spanner/connection/AbstractStatementParser</className>
967+
<method>boolean supportsExplain()</method>
968+
</difference>
969+
<difference>
970+
<differenceType>7002</differenceType>
971+
<className>com/google/cloud/spanner/connection/PostgreSQLStatementParser</className>
972+
<method>boolean supportsExplain()</method>
973+
</difference>
974+
<difference>
975+
<differenceType>7002</differenceType>
976+
<className>com/google/cloud/spanner/connection/SpannerStatementParser</className>
977+
<method>boolean supportsExplain()</method>
978+
</difference>
979+
962980

963981
</differences>

google-cloud-spanner/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,19 @@
517517
</execution>
518518
</executions>
519519
</plugin>
520+
<plugin>
521+
<groupId>org.apache.maven.plugins</groupId>
522+
<artifactId>maven-compiler-plugin</artifactId>
523+
<configuration>
524+
<annotationProcessorPaths>
525+
<path>
526+
<groupId>org.openjdk.jmh</groupId>
527+
<artifactId>jmh-generator-annprocess</artifactId>
528+
<version>1.37</version>
529+
</path>
530+
</annotationProcessorPaths>
531+
</configuration>
532+
</plugin>
520533
</plugins>
521534
</build>
522535
</profile>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.google.cloud.spanner.ReadContext.QueryAnalyzeMode;
2323
import com.google.common.base.Preconditions;
24+
import com.google.common.collect.ImmutableMap;
2425
import com.google.spanner.v1.ExecuteSqlRequest.QueryOptions;
2526
import java.io.Serializable;
2627
import java.util.Collections;
@@ -140,7 +141,12 @@ Builder handle(Value value) {
140141

141142
/** Creates a {@code Statement} with the given SQL text {@code sql}. */
142143
public static Statement of(String sql) {
143-
return newBuilder(sql).build();
144+
return new Statement(sql, ImmutableMap.of(), /*queryOptions=*/ null);
145+
}
146+
147+
/** Creates a {@link Statement} with the given SQL text and parameters. */
148+
public static Statement of(String sql, ImmutableMap<String, Value> parameters) {
149+
return new Statement(sql, parameters, /*queryOptions=*/ null);
144150
}
145151

146152
/** Creates a new statement builder with the SQL text {@code sql}. */

0 commit comments

Comments
 (0)