Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [Spanner] protos for R/W transaction support on multiplexed sessions #7736

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Spanner/metadata/V1/CommitResponse.php
Binary file not shown.
Binary file modified Spanner/metadata/V1/ResultSet.php
Binary file not shown.
Binary file modified Spanner/metadata/V1/Spanner.php
Binary file not shown.
Binary file modified Spanner/metadata/V1/Transaction.php
Binary file not shown.
64 changes: 64 additions & 0 deletions Spanner/src/V1/BeginTransactionRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions Spanner/src/V1/CommitRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions Spanner/src/V1/CommitResponse.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions Spanner/src/V1/ExecuteBatchDmlResponse.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Spanner/src/V1/Gapic/SpannerGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
use Google\Cloud\Spanner\V1\KeySet;
use Google\Cloud\Spanner\V1\ListSessionsRequest;
use Google\Cloud\Spanner\V1\ListSessionsResponse;
use Google\Cloud\Spanner\V1\MultiplexedSessionPrecommitToken;
use Google\Cloud\Spanner\V1\Mutation;
use Google\Cloud\Spanner\V1\PartialResultSet;
use Google\Cloud\Spanner\V1\PartitionOptions;
Expand Down Expand Up @@ -534,6 +535,13 @@ public function batchWrite(
* request_options struct will not do anything. To set the priority for a
* transaction, set it on the reads and writes that are part of this
* transaction instead.
* @type Mutation $mutationKey
* Optional. Required for read-write transactions on a multiplexed session
* that commit mutations but do not perform any reads or queries. Clients
* should randomly select one of the mutations from the mutation set and send
* it as a part of this request.
* This feature is not yet supported and will result in an UNIMPLEMENTED
* error.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
Expand All @@ -558,6 +566,10 @@ public function beginTransaction(
$request->setRequestOptions($optionalArgs['requestOptions']);
}

if (isset($optionalArgs['mutationKey'])) {
$request->setMutationKey($optionalArgs['mutationKey']);
}

$requestParams = new RequestParamsHeaderDescriptor(
$requestParamHeaders
);
Expand Down Expand Up @@ -631,6 +643,13 @@ public function beginTransaction(
* and 500 ms.
* @type RequestOptions $requestOptions
* Common options for this request.
* @type MultiplexedSessionPrecommitToken $precommitToken
* Optional. If the read-write transaction was executed on a multiplexed
* session, the precommit token with the highest sequence number received in
* this transaction attempt, should be included here. Failing to do so will
* result in a FailedPrecondition error.
* This feature is not yet supported and will result in an UNIMPLEMENTED
* error.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
Expand Down Expand Up @@ -670,6 +689,10 @@ public function commit($session, $mutations, array $optionalArgs = [])
$request->setRequestOptions($optionalArgs['requestOptions']);
}

if (isset($optionalArgs['precommitToken'])) {
$request->setPrecommitToken($optionalArgs['precommitToken']);
}

$requestParams = new RequestParamsHeaderDescriptor(
$requestParamHeaders
);
Expand Down
Loading
Loading