From f1289d8463925b1a9f2f048f0845ac07a38157e9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 06:20:16 +0000 Subject: [PATCH 1/5] chore: release 2.5.4-SNAPSHOT (#670) :robot: I have created a release \*beep\* \*boop\* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e9d595082..ffcebe4f5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud-spanner-jdbc - 2.5.3 + 2.5.4-SNAPSHOT jar Google Cloud Spanner JDBC https://github.com/googleapis/java-spanner-jdbc diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index c8eefe24f..243af5cd0 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-spanner-jdbc - 2.5.3 + 2.5.4-SNAPSHOT diff --git a/versions.txt b/versions.txt index 194cca1d6..e0d7cfd7f 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-spanner-jdbc:2.5.3:2.5.3 +google-cloud-spanner-jdbc:2.5.3:2.5.4-SNAPSHOT From c4c9df81834a1be45e9d41be9c8b0c9b9ccf871f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Nov 2021 17:02:10 +0100 Subject: [PATCH 2/5] chore(deps): update dependency com.google.cloud:google-cloud-spanner-jdbc to v2.5.3 (#671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-spanner-jdbc](https://togithub.com/googleapis/java-spanner-jdbc) | `2.5.2` -> `2.5.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.5.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.5.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.5.3/compatibility-slim/2.5.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-spanner-jdbc/2.5.3/confidence-slim/2.5.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-spanner-jdbc ### [`v2.5.3`](https://togithub.com/googleapis/java-spanner-jdbc/blob/master/CHANGELOG.md#​253-httpswwwgithubcomgoogleapisjava-spanner-jdbccomparev252v253-2021-11-15) [Compare Source](https://togithub.com/googleapis/java-spanner-jdbc/compare/v2.5.2...v2.5.3)
--- ### Configuration 📅 **Schedule**: 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 this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-spanner-jdbc). --- samples/install-without-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml index 3a7e101ce..0b99fb776 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-spanner-jdbc - 2.5.2 + 2.5.3 From b4cc0568e440b6a377cb4d8224c46057cd3ce1ee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Nov 2021 18:54:52 +0100 Subject: [PATCH 3/5] deps: update dependency com.google.cloud:google-cloud-spanner-bom to v6.16.0 (#673) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ffcebe4f5..fdb6a8613 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ com.google.cloud google-cloud-spanner-bom - 6.15.2 + 6.16.0 pom import From 1e85d0df6f36a67e5dcab5b460b97799e904851b Mon Sep 17 00:00:00 2001 From: rahul2393 Date: Wed, 17 Nov 2021 12:18:55 +0530 Subject: [PATCH 4/5] chore: add tests for rpcPriority (#672) --- .../google/cloud/spanner/jdbc/JdbcDriver.java | 2 + .../spanner/jdbc/JdbcQueryOptionsTest.java | 49 +++++++++++++++++-- .../spanner/jdbc/it/ITJdbcConnectTest.java | 6 ++- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java b/src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java index b127e6825..5df6cf638 100644 --- a/src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java +++ b/src/main/java/com/google/cloud/spanner/jdbc/JdbcDriver.java @@ -108,6 +108,8 @@ *
  • maxSessions (int): Sets the maximum number of sessions in the backing session pool. * Defaults to 400. *
  • numChannels (int): Sets the number of gRPC channels to use. Defaults to 4. + *
  • rpcPriority (String): Sets the priority for all RPC invocations from this connection. + * Defaults to HIGH. * */ public class JdbcDriver implements Driver { diff --git a/src/test/java/com/google/cloud/spanner/jdbc/JdbcQueryOptionsTest.java b/src/test/java/com/google/cloud/spanner/jdbc/JdbcQueryOptionsTest.java index f1aaeeaca..44a95e3dc 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/JdbcQueryOptionsTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/JdbcQueryOptionsTest.java @@ -51,6 +51,12 @@ public void testDefaultOptions() throws SQLException { assertThat(rs.getString("OPTIMIZER_STATISTICS_PACKAGE")).isEqualTo(""); assertThat(rs.next()).isFalse(); } + try (java.sql.ResultSet rs = + connection.createStatement().executeQuery("SHOW VARIABLE RPC_PRIORITY")) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("RPC_PRIORITY")).isEqualTo("PRIORITY_UNSPECIFIED"); + assertThat(rs.next()).isFalse(); + } } } @@ -59,8 +65,8 @@ public void testOptionsInConnectionUrl() throws SQLException { try (java.sql.Connection connection = DriverManager.getConnection( String.format( - "jdbc:%s;optimizerVersion=%s;optimizerStatisticsPackage=%s", - getBaseUrl(), "100", "url_package"))) { + "jdbc:%s;optimizerVersion=%s;optimizerStatisticsPackage=%s;rpcPriority=%s", + getBaseUrl(), "100", "url_package", "LOW"))) { try (java.sql.ResultSet rs = connection.createStatement().executeQuery("SHOW VARIABLE OPTIMIZER_VERSION")) { assertThat(rs.next()).isTrue(); @@ -73,6 +79,12 @@ public void testOptionsInConnectionUrl() throws SQLException { assertThat(rs.getString("OPTIMIZER_STATISTICS_PACKAGE")).isEqualTo("url_package"); assertThat(rs.next()).isFalse(); } + try (java.sql.ResultSet rs = + connection.createStatement().executeQuery("SHOW VARIABLE RPC_PRIORITY")) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("RPC_PRIORITY")).isEqualTo("LOW"); + assertThat(rs.next()).isFalse(); + } } } @@ -122,6 +134,28 @@ public void testSetOptions() throws SQLException { assertThat(rs.getString("OPTIMIZER_STATISTICS_PACKAGE")).isEqualTo(""); assertThat(rs.next()).isFalse(); } + + connection.createStatement().execute("SET RPC_PRIORITY='LOW'"); + try (java.sql.ResultSet rs = + connection.createStatement().executeQuery("SHOW VARIABLE RPC_PRIORITY")) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("RPC_PRIORITY")).isEqualTo("LOW"); + assertThat(rs.next()).isFalse(); + } + connection.createStatement().execute("SET RPC_PRIORITY='MEDIUM'"); + try (java.sql.ResultSet rs = + connection.createStatement().executeQuery("SHOW VARIABLE RPC_PRIORITY")) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("RPC_PRIORITY")).isEqualTo("MEDIUM"); + assertThat(rs.next()).isFalse(); + } + connection.createStatement().execute("SET RPC_PRIORITY='NULL'"); + try (java.sql.ResultSet rs = + connection.createStatement().executeQuery("SHOW VARIABLE RPC_PRIORITY")) { + assertThat(rs.next()).isTrue(); + assertThat(rs.getString("RPC_PRIORITY")).isEqualTo("PRIORITY_UNSPECIFIED"); + assertThat(rs.next()).isFalse(); + } } } @@ -130,6 +164,7 @@ public void testSetAndUseOptions() throws SQLException { try (java.sql.Connection connection = createJdbcConnection()) { connection.createStatement().execute("SET OPTIMIZER_VERSION='20'"); connection.createStatement().execute("SET OPTIMIZER_STATISTICS_PACKAGE='20210609'"); + connection.createStatement().execute("SET RPC_PRIORITY='LOW'"); try (java.sql.ResultSet rs = connection.createStatement().executeQuery(SELECT_COUNT_STATEMENT.getSql())) { assertThat(rs.next()).isTrue(); @@ -140,10 +175,12 @@ public void testSetAndUseOptions() throws SQLException { ExecuteSqlRequest request = getLastExecuteSqlRequest(); assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("20"); assertThat(request.getQueryOptions().getOptimizerStatisticsPackage()).isEqualTo("20210609"); + assertThat(request.getRequestOptions().getPriority().toString()).isEqualTo("PRIORITY_LOW"); } connection.createStatement().execute("SET OPTIMIZER_VERSION='latest'"); connection.createStatement().execute("SET OPTIMIZER_STATISTICS_PACKAGE='latest'"); + connection.createStatement().execute("SET RPC_PRIORITY='MEDIUM'"); try (java.sql.ResultSet rs = connection.createStatement().executeQuery(SELECT_COUNT_STATEMENT.getSql())) { assertThat(rs.next()).isTrue(); @@ -152,12 +189,15 @@ public void testSetAndUseOptions() throws SQLException { ExecuteSqlRequest request = getLastExecuteSqlRequest(); assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("latest"); assertThat(request.getQueryOptions().getOptimizerStatisticsPackage()).isEqualTo("latest"); + assertThat(request.getRequestOptions().getPriority().toString()) + .isEqualTo("PRIORITY_MEDIUM"); } // Set the options to ''. This will do a fallback to the default, meaning that it will be read // from the environment variables as we have nothing set on the connection URL. connection.createStatement().execute("SET OPTIMIZER_VERSION=''"); connection.createStatement().execute("SET OPTIMIZER_STATISTICS_PACKAGE=''"); + connection.createStatement().execute("SET RPC_PRIORITY='NULL'"); try (java.sql.ResultSet rs = connection.createStatement().executeQuery(SELECT_COUNT_STATEMENT.getSql())) { assertThat(rs.next()).isTrue(); @@ -170,6 +210,8 @@ public void testSetAndUseOptions() throws SQLException { .isEqualTo(MoreObjects.firstNonNull(System.getenv("SPANNER_OPTIMIZER_VERSION"), "")); assertThat(request.getQueryOptions().getOptimizerStatisticsPackage()) .isEqualTo(MoreObjects.firstNonNull(System.getenv("OPTIMIZER_STATISTICS_PACKAGE"), "")); + assertThat(request.getRequestOptions().getPriority().toString()) + .isEqualTo("PRIORITY_UNSPECIFIED"); } } } @@ -179,7 +221,7 @@ public void testUseOptionsFromConnectionUrl() throws SQLException { try (java.sql.Connection connection = DriverManager.getConnection( String.format( - "jdbc:%s;optimizerVersion=10;optimizerStatisticsPackage=20210609_10_00_00", + "jdbc:%s;optimizerVersion=10;optimizerStatisticsPackage=20210609_10_00_00;rpcPriority=LOW", getBaseUrl()))) { // Do a query and verify that the version from the connection URL is used. try (java.sql.ResultSet rs = @@ -192,6 +234,7 @@ public void testUseOptionsFromConnectionUrl() throws SQLException { assertThat(request.getQueryOptions().getOptimizerVersion()).isEqualTo("10"); assertThat(request.getQueryOptions().getOptimizerStatisticsPackage()) .isEqualTo("20210609_10_00_00"); + assertThat(request.getRequestOptions().getPriority().toString()).isEqualTo("PRIORITY_LOW"); } } } diff --git a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcConnectTest.java b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcConnectTest.java index 3626e4594..90a7ea8a1 100644 --- a/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcConnectTest.java +++ b/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcConnectTest.java @@ -107,7 +107,7 @@ public void testConnectWithURLWithDefaultValues() throws SQLException { @Test public void testConnectWithURLWithNonDefaultValues() throws SQLException { String url = createBaseUrl(); - url = url + ";autocommit=false;readonly=true;retryAbortsInternally=false"; + url = url + ";autocommit=false;readonly=true;retryAbortsInternally=false;rpcPriority=LOW"; if (hasValidKeyFile()) { url = url + ";credentials=" + getKeyFile(); } @@ -138,6 +138,7 @@ public void testConnectWithPropertiesWithNonDefaultValues() throws SQLException properties.setProperty("autocommit", "false"); properties.setProperty("readonly", "true"); properties.setProperty("retryAbortsInternally", "false"); + properties.setProperty("rpcPriority", "LOW"); try (Connection connection = DriverManager.getConnection(url, properties)) { testNonDefaultConnection(connection); } @@ -146,7 +147,7 @@ public void testConnectWithPropertiesWithNonDefaultValues() throws SQLException @Test public void testConnectWithPropertiesWithConflictingValues() throws SQLException { String url = createBaseUrl(); - url = url + ";autocommit=false;readonly=true;retryAbortsInternally=false"; + url = url + ";autocommit=false;readonly=true;retryAbortsInternally=false;rpcPriority=LOW"; if (hasValidKeyFile()) { url = url + ";credentials=" + getKeyFile(); } @@ -154,6 +155,7 @@ public void testConnectWithPropertiesWithConflictingValues() throws SQLException properties.setProperty("autocommit", "true"); properties.setProperty("readonly", "false"); properties.setProperty("retryAbortsInternally", "true"); + properties.setProperty("rpcPriority", "MEDIUM"); try (Connection connection = DriverManager.getConnection(url, properties)) { testNonDefaultConnection(connection); } From 4c4163372dabf38a798d17e3d2a13b12a88529ff Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 17 Nov 2021 06:56:34 +0000 Subject: [PATCH 5/5] chore: release 2.5.4 (#674) :robot: I have created a release \*beep\* \*boop\* --- ### [2.5.4](https://www.github.com/googleapis/java-spanner-jdbc/compare/v2.5.3...v2.5.4) (2021-11-17) ### Dependencies * update dependency com.google.cloud:google-cloud-spanner-bom to v6.16.0 ([#673](https://www.github.com/googleapis/java-spanner-jdbc/issues/673)) ([b4cc056](https://www.github.com/googleapis/java-spanner-jdbc/commit/b4cc0568e440b6a377cb4d8224c46057cd3ce1ee)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- versions.txt | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c59230d1c..59dc69788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.5.4](https://www.github.com/googleapis/java-spanner-jdbc/compare/v2.5.3...v2.5.4) (2021-11-17) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-spanner-bom to v6.16.0 ([#673](https://www.github.com/googleapis/java-spanner-jdbc/issues/673)) ([b4cc056](https://www.github.com/googleapis/java-spanner-jdbc/commit/b4cc0568e440b6a377cb4d8224c46057cd3ce1ee)) + ### [2.5.3](https://www.github.com/googleapis/java-spanner-jdbc/compare/v2.5.2...v2.5.3) (2021-11-15) diff --git a/pom.xml b/pom.xml index fdb6a8613..cba37838f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud-spanner-jdbc - 2.5.4-SNAPSHOT + 2.5.4 jar Google Cloud Spanner JDBC https://github.com/googleapis/java-spanner-jdbc diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 243af5cd0..0f33f2028 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-spanner-jdbc - 2.5.4-SNAPSHOT + 2.5.4 diff --git a/versions.txt b/versions.txt index e0d7cfd7f..e00c5fc20 100644 --- a/versions.txt +++ b/versions.txt @@ -1,4 +1,4 @@ # Format: # module:released-version:current-version -google-cloud-spanner-jdbc:2.5.3:2.5.4-SNAPSHOT +google-cloud-spanner-jdbc:2.5.4:2.5.4