Skip to content

Commit

Permalink
Merge branch 'master' into auto-config-emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Mar 17, 2021
2 parents 45d2b2e + 213dddc commit 6d6676f
Show file tree
Hide file tree
Showing 144 changed files with 11,721 additions and 1,824 deletions.
4 changes: 2 additions & 2 deletions .github/readme/synth.metadata/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-spanner.git",
"sha": "00e8e01018693faf8673faa4d1084264ece4a76a"
"sha": "13c297b210939a04cab8a8fd547bb34e4d549da7"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "0199c79b8324fba66476300824aa931788c47e2d"
"sha": "94686b06034ff6e11217236fcaa217ec6e24bc39"
}
}
]
Expand Down
8 changes: 1 addition & 7 deletions .kokoro/release/publish_javadoc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ env_vars: {
value: "docs-staging"
}

# cloud-rad staging
env_vars: {
key: "STAGING_BUCKET_V2"
value: "docs-staging-v2-staging"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/java-spanner/.kokoro/release/publish_javadoc.sh"
Expand All @@ -26,4 +20,4 @@ before_action {
keyname: "docuploader_service_account"
}
}
}
}
19 changes: 0 additions & 19 deletions .kokoro/release/publish_javadoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,3 @@ python3 -m docuploader create-metadata \
python3 -m docuploader upload . \
--credentials ${CREDENTIALS} \
--staging-bucket ${STAGING_BUCKET}

popd

# V2 due to problems w/ the released javadoc plugin doclava, Java 8 is required. Beware of accidental updates.

mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/"

pushd target/devsite/reference

# create metadata
python3 -m docuploader create-metadata \
--name ${NAME} \
--version ${VERSION} \
--language java

# upload docs to staging bucket
python3 -m docuploader upload . \
--credentials ${CREDENTIALS} \
--staging-bucket ${STAGING_BUCKET_V2}
5 changes: 4 additions & 1 deletion .kokoro/release/publish_javadoc11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
# generate yml
mvn clean site -B -q -P docFX

# copy README to docfx-yml dir and rename index.md
cp README.md target/docfx-yml/index.md

pushd target/docfx-yml

# create metadata
Expand All @@ -52,4 +55,4 @@ python3 -m docuploader create-metadata \
python3 -m docuploader upload . \
--credentials ${CREDENTIALS} \
--staging-bucket ${STAGING_BUCKET_V2} \
--destination-prefix docfx-
--destination-prefix docfx
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## [5.1.0](https://www.github.com/googleapis/java-spanner/compare/v5.0.0...v5.1.0) (2021-03-10)


### Features

* add client lib token for Liquibase ([#925](https://www.github.com/googleapis/java-spanner/issues/925)) ([0d93d92](https://www.github.com/googleapis/java-spanner/commit/0d93d92fcd7c8bb2ffd3198560c4be3e4afc4990))
* adds samples for PITR ([#837](https://www.github.com/googleapis/java-spanner/issues/837)) ([55fa0cc](https://www.github.com/googleapis/java-spanner/commit/55fa0ccca4faf44da8f9a3553ab4b35574c14830))


### Dependencies

* update dependency com.google.cloud:google-cloud-monitoring to v2.0.14 ([#919](https://www.github.com/googleapis/java-spanner/issues/919)) ([178500c](https://www.github.com/googleapis/java-spanner/commit/178500c7e48cbdeb45f657d9c413e9afdacefbab))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#944](https://www.github.com/googleapis/java-spanner/issues/944)) ([b74b764](https://www.github.com/googleapis/java-spanner/commit/b74b7648343dc789b60fb2636615f288b6e6c854))
* update dependency org.json:json to v20210307 ([#943](https://www.github.com/googleapis/java-spanner/issues/943)) ([4088981](https://www.github.com/googleapis/java-spanner/commit/4088981314097647e3ed79f2c748545cac6fc34e))
* update dependency org.openjdk.jmh:jmh-core to v1.28 ([#923](https://www.github.com/googleapis/java-spanner/issues/923)) ([b4d6e5a](https://www.github.com/googleapis/java-spanner/commit/b4d6e5ac762393b70b684159d11a55edf8f2fba7))

## [5.0.0](https://www.github.com/googleapis/java-spanner/compare/v4.0.2...v5.0.0) (2021-02-26)


Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>18.0.0</version>
<version>19.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -38,25 +38,25 @@ If you are using Maven without BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>4.0.2</version>
<version>5.0.0</version>
</dependency>

```

If you are using Gradle 5.x or later, add this to your dependencies
```Groovy
implementation platform('com.google.cloud:libraries-bom:18.0.0')
implementation platform('com.google.cloud:libraries-bom:19.0.0')
compile 'com.google.cloud:google-cloud-spanner'
```
If you are using Gradle without BOM, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-spanner:4.0.2'
compile 'com.google.cloud:google-cloud-spanner:5.1.0'
```

If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "4.0.2"
libraryDependencies += "com.google.cloud" % "google-cloud-spanner" % "5.1.0"
```

## Authentication
Expand Down Expand Up @@ -235,8 +235,10 @@ has instructions for running the samples.
| Async Runner Example | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/AsyncRunnerExample.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/AsyncRunnerExample.java) |
| Async Transaction Manager Example | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/AsyncTransactionManagerExample.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/AsyncTransactionManagerExample.java) |
| Batch Sample | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/BatchSample.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/BatchSample.java) |
| Create Database With Version Retention Period Sample | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/CreateDatabaseWithVersionRetentionPeriodSample.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/CreateDatabaseWithVersionRetentionPeriodSample.java) |
| Create Instance Example | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/CreateInstanceExample.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/CreateInstanceExample.java) |
| Custom Timeout And Retry Settings Example | [source code](https://github.com/googleapis/java-spanner/blob/master/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) |
| Get Commit Stats Sample | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/GetCommitStatsSample.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/GetCommitStatsSample.java) |
| Query With Numeric Parameter Sample | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/QueryWithNumericParameterSample.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/QueryWithNumericParameterSample.java) |
| Quickstart Sample | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/QuickstartSample.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/QuickstartSample.java) |
| Spanner Sample | [source code](https://github.com/googleapis/java-spanner/blob/master/samples/snippets/src/main/java/com/example/spanner/SpannerSample.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/SpannerSample.java) |
Expand Down
18 changes: 9 additions & 9 deletions google-cloud-spanner-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-bom</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>5.1.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
Expand Down Expand Up @@ -64,43 +64,43 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-admin-instance-v1</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
<version>5.1.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-instance-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-v1</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
<version>5.1.0</version><!-- {x-version-update:grpc-google-cloud-spanner-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-v1</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
<version>5.1.0</version><!-- {x-version-update:proto-google-cloud-spanner-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-spanner-admin-database-v1</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
<version>5.1.0</version><!-- {x-version-update:proto-google-cloud-spanner-admin-database-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>5.1.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<type>test-jar</type>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>5.1.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-admin-instance-v1</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
<version>5.1.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-instance-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-spanner-admin-database-v1</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
<version>5.1.0</version><!-- {x-version-update:grpc-google-cloud-spanner-admin-database-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
8 changes: 4 additions & 4 deletions google-cloud-spanner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>5.1.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
<packaging>jar</packaging>
<name>Google Cloud Spanner</name>
<url>https://github.com/googleapis/java-spanner</url>
<description>Java idiomatic client for Google Cloud Spanner.</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner-parent</artifactId>
<version>5.0.1-SNAPSHOT</version><!-- {x-version-update:google-cloud-spanner:current} -->
<version>5.1.0</version><!-- {x-version-update:google-cloud-spanner:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-spanner</site.installationModule>
Expand Down Expand Up @@ -285,7 +285,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20201115</version>
<version>20210307</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -304,7 +304,7 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.27</version>
<version>1.28</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ public class SessionPoolOptions {
private final int minSessions;
private final int maxSessions;
private final int incStep;
private final int maxIdleSessions;
/**
* Use {@link #minSessions} instead to set the minimum number of sessions in the pool to maintain.
* Creating a larger number of sessions during startup is relatively cheap as it is executed with
* the BatchCreateSessions RPC.
*/
@Deprecated private final int maxIdleSessions;
/**
* The session pool no longer prepares a fraction of the sessions with a read/write transaction.
* This setting therefore does not have any meaning anymore, and may be removed in the future.
Expand Down Expand Up @@ -118,6 +123,11 @@ int getIncStep() {
return incStep;
}

/**
* @deprecated Use a higher value for {@link SessionPoolOptions.Builder#setMinSessions(int)}
* instead of setting this option.
*/
@Deprecated
public int getMaxIdleSessions() {
return maxIdleSessions;
}
Expand Down Expand Up @@ -193,7 +203,10 @@ public static class Builder {
private int minSessions = DEFAULT_MIN_SESSIONS;
private int maxSessions = DEFAULT_MAX_SESSIONS;
private int incStep = DEFAULT_INC_STEP;
private int maxIdleSessions;

/** Set a higher value for {@link #minSessions} instead of using {@link #maxIdleSessions}. */
@Deprecated private int maxIdleSessions;

/**
* The session pool no longer prepares a fraction of the sessions with a read/write transaction.
* This setting therefore does not have any meaning anymore, and may be removed in the future.
Expand Down Expand Up @@ -265,7 +278,11 @@ Builder setIncStep(int incStep) {
* #setMinSessions}. To determine how many sessions are idle we look at maximum number of
* sessions used concurrently over a window of time. Any sessions beyond that are idle. Defaults
* to 0.
*
* @deprecated set a higher value for {@link #setMinSessions(int)} instead of using this
* configuration option. This option will be removed in a future release.
*/
@Deprecated
public Builder setMaxIdleSessions(int maxIdleSessions) {
this.maxIdleSessions = maxIdleSessions;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class SpannerOptions extends ServiceOptions<Spanner, SpannerOptions> {

private static final String JDBC_API_CLIENT_LIB_TOKEN = "sp-jdbc";
private static final String HIBERNATE_API_CLIENT_LIB_TOKEN = "sp-hib";
private static final String LIQUIBASE_API_CLIENT_LIB_TOKEN = "sp-liq";

private static final String API_SHORT_NAME = "Spanner";
private static final String DEFAULT_HOST = "https://spanner.googleapis.com";
private static final ImmutableSet<String> SCOPES =
Expand Down Expand Up @@ -612,7 +614,8 @@ public static class Builder
ImmutableSet.of(
ServiceOptions.getGoogApiClientLibName(),
JDBC_API_CLIENT_LIB_TOKEN,
HIBERNATE_API_CLIENT_LIB_TOKEN);
HIBERNATE_API_CLIENT_LIB_TOKEN,
LIQUIBASE_API_CLIENT_LIB_TOKEN);
private TransportChannelProvider channelProvider;

@SuppressWarnings("rawtypes")
Expand Down
Loading

0 comments on commit 6d6676f

Please sign in to comment.