Conversation
987b77f to
80d023a
Compare
Some integration tests started transactions without executing a query, and expected these transactions to fail. However, as the client is now non-blocking up until the first call to ResultSet#next(), no exception would occur.
|
@elefeint I've processed all your review comments, and now also added support for an |
|
Thanks very much for the review @elefeint and @dzou. @olavloite please merge this in when you're ready. |
🤖 I have created a release \*beep\* \*boop\* --- ## [1.58.0](https://www.github.com/googleapis/java-spanner/compare/v1.57.0...v1.58.0) (2020-07-07) ### Features * add async api ([#81](https://www.github.com/googleapis/java-spanner/issues/81)) ([462839b](https://www.github.com/googleapis/java-spanner/commit/462839b625e58e235581b8ba10b398e1d222eaaf)) * support setting compression option ([#192](https://www.github.com/googleapis/java-spanner/issues/192)) ([965e95e](https://www.github.com/googleapis/java-spanner/commit/965e95e70ccd9c62abd6513b0011aab136e48e26)) ### Bug Fixes * set default values for streaming retry ([#316](https://www.github.com/googleapis/java-spanner/issues/316)) ([543373b](https://www.github.com/googleapis/java-spanner/commit/543373b22336be72b10026fda9f0b55939ab94b4)) ### Performance Improvements * use streaming RPC for PDML ([#287](https://www.github.com/googleapis/java-spanner/issues/287)) ([df47c13](https://www.github.com/googleapis/java-spanner/commit/df47c13a4c00bdf5e6eafa01bbb64c12a96d7fb8)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.2 ([#315](https://www.github.com/googleapis/java-spanner/issues/315)) ([3d6fb9f](https://www.github.com/googleapis/java-spanner/commit/3d6fb9fd7dc6b2b5b2ff9935228701ac795c9167)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
| /** | ||
| * Returns the {@link ExecutorProvider} to use for async methods that need a background executor. | ||
| */ | ||
| public ExecutorProvider getAsyncExecutorProvider() { |
There was a problem hiding this comment.
how do we set asyncExecutorProvider?
There was a problem hiding this comment.
It's currently not configurable, and it will automatically use the default provided here:
There was a problem hiding this comment.
thanks for the quick reply Knut Olav .
Is there a plan to make it configurable?
There was a problem hiding this comment.
There's no concrete plan for it, but this feels like an omission to me. Would you mind submitting a feature request here: https://github.com/googleapis/java-spanner/issues/new?assignees=&labels=&template=feature_request.md
There was a problem hiding this comment.
thanks so much.
just created this issue
* fix: fix deprecation warnings in JDBC files * fix: fix typo in test case * fix: remove commented line of code
🤖 I have created a release \*beep\* \*boop\* --- ## [1.14.0](https://www.github.com/googleapis/java-spanner-jdbc/compare/v1.13.0...v1.14.0) (2020-03-18) ### Features * add support for foreign keys ([googleapis#78](https://www.github.com/googleapis/java-spanner-jdbc/issues/78)) ([9e770f2](https://www.github.com/googleapis/java-spanner-jdbc/commit/9e770f281c03a1e9c034e5ff3ddee44fa20a7b30)), closes [googleapis#77](https://www.github.com/googleapis/java-spanner-jdbc/issues/77) ### Bug Fixes * add missing netty-shaded lib for über-jar ([googleapis#80](https://www.github.com/googleapis/java-spanner-jdbc/issues/80)) ([3d6f356](https://www.github.com/googleapis/java-spanner-jdbc/commit/3d6f35669671194e6772fe327ce48f27e5bf4643)) * fix deprecation warnings in JDBC (test) files ([googleapis#81](https://www.github.com/googleapis/java-spanner-jdbc/issues/81)) ([a5e031d](https://www.github.com/googleapis/java-spanner-jdbc/commit/a5e031d3183f8fe88a621500f235ca2b0242f50b)) * include Spanner gRPC test dependencies ([googleapis#63](https://www.github.com/googleapis/java-spanner-jdbc/issues/63)) ([a34bfc0](https://www.github.com/googleapis/java-spanner-jdbc/commit/a34bfc0ff1c2ddeef077dbfae4c56bdd53febcb2)) ### Dependencies * update core dependencies ([1ae098e](https://www.github.com/googleapis/java-spanner-jdbc/commit/1ae098e924c2a488cfddd0a3aee9511274b7a515)) * update core dependencies ([googleapis#40](https://www.github.com/googleapis/java-spanner-jdbc/issues/40)) ([18c3a1b](https://www.github.com/googleapis/java-spanner-jdbc/commit/18c3a1b069cb507a91d0320e64a8bf8ae8efe394)) * update core dependencies ([googleapis#73](https://www.github.com/googleapis/java-spanner-jdbc/issues/73)) ([cfa1539](https://www.github.com/googleapis/java-spanner-jdbc/commit/cfa153997599c36f1243e87f1ea0760694657dfe)) * update core dependencies to v1.27.1 ([googleapis#61](https://www.github.com/googleapis/java-spanner-jdbc/issues/61)) ([181991b](https://www.github.com/googleapis/java-spanner-jdbc/commit/181991bda1f66de707d27dad9658b9177626595a)) * update core dependencies to v1.27.2 ([googleapis#71](https://www.github.com/googleapis/java-spanner-jdbc/issues/71)) ([12425fc](https://www.github.com/googleapis/java-spanner-jdbc/commit/12425fcb4382449e4a7a0edad4c812b7ce15aa71)) * update core dependencies to v1.54.0 ([googleapis#72](https://www.github.com/googleapis/java-spanner-jdbc/issues/72)) ([5676021](https://www.github.com/googleapis/java-spanner-jdbc/commit/567602177e05fa198eaa011fbca05cfe4b72fb13)) * update core dependencies to v1.92.5 ([googleapis#53](https://www.github.com/googleapis/java-spanner-jdbc/issues/53)) ([604ee2b](https://www.github.com/googleapis/java-spanner-jdbc/commit/604ee2b75204ad52eaf724c3fb71e8c13540af7c)) * update core transport dependencies to v1.34.1 ([googleapis#43](https://www.github.com/googleapis/java-spanner-jdbc/issues/43)) ([2b6f04d](https://www.github.com/googleapis/java-spanner-jdbc/commit/2b6f04da3aeebac778fb664c4564fb8b58bf3be4)) * update core transport dependencies to v1.34.2 ([googleapis#62](https://www.github.com/googleapis/java-spanner-jdbc/issues/62)) ([8739015](https://www.github.com/googleapis/java-spanner-jdbc/commit/8739015f62289adb92fd55b19a5bff8762da20a9)) * update dependency com.google.api-client:google-api-client-bom to v1.30.8 ([googleapis#46](https://www.github.com/googleapis/java-spanner-jdbc/issues/46)) ([ef891b0](https://www.github.com/googleapis/java-spanner-jdbc/commit/ef891b000045d1f39f91b6a0ed3abaab19c5f05e)) * update dependency com.google.api-client:google-api-client-bom to v1.30.9 ([googleapis#74](https://www.github.com/googleapis/java-spanner-jdbc/issues/74)) ([3b62299](https://www.github.com/googleapis/java-spanner-jdbc/commit/3b622999b9f9645a6086e5efd3206f4d7b0806bc)) * update dependency com.google.truth:truth to v1.0.1 ([googleapis#32](https://www.github.com/googleapis/java-spanner-jdbc/issues/32)) ([5205863](https://www.github.com/googleapis/java-spanner-jdbc/commit/52058636e10951e883523204f0f161db8a972d62)) * update protobuf.version to v3.11.3 ([googleapis#48](https://www.github.com/googleapis/java-spanner-jdbc/issues/48)) ([0779fcb](https://www.github.com/googleapis/java-spanner-jdbc/commit/0779fcb0bfe935c3c302fa8442f733c7e3629761)) * update protobuf.version to v3.11.4 ([googleapis#64](https://www.github.com/googleapis/java-spanner-jdbc/issues/64)) ([f485cff](https://www.github.com/googleapis/java-spanner-jdbc/commit/f485cfffa0de27ce35f5d16c689c31c6ea22138e)) * update spanner.version to v1.51.0 ([googleapis#75](https://www.github.com/googleapis/java-spanner-jdbc/issues/75)) ([4fff168](https://www.github.com/googleapis/java-spanner-jdbc/commit/4fff168eae61fb55933cf3afd67f24ca65dfde54)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Adds an async API to the Spanner client library. Most notable changes:
All calls to the session pool are now non-blocking
This also applies to the current API, which means that the following statements will always be non-blocking, regardless whether a session was already available in the session pool or not:
Instead, the first call to
ResultSet#next()will be blocking:executeStreamingSqlcall has returned the first results.Adds Async methods to
ReadContextThe
ReadContextinterface is extended with the following methods:readAsync(...)readUsingIndexAsync(...)executeQueryAsync(...)readRowAsync(...)readRowUsingIndexAsync(...)The first three of the above methods return an
AsyncResultSet.AsyncResultSetis an extension of the existingResultSetinterface that allows the user to register a callback that will be called asynchronously for each row in the result set.The latter two methods return instances of
ApiFuture<Struct>.Point for discussion:
It would also be possible to add the
setCallback(...)method to the existingResultSetinterface instead of creating an additionalAsyncResultSetinterface. That would mean that we would not need to add the -Async methods above. Instead, allResultSets could be consumed asynchronously by calling thesetCallback(...)method.Adds
AsyncRunnerThe method
DatabaseClient#runAsync()is added which returns anAsyncRunner. This runner can be used to execute a read/write transaction asynchronously.