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): [Spanner] add field for multiplexed session in spanner.proto #7064

Merged
merged 2 commits into from
Feb 16, 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/Spanner.php
Binary file not shown.
74 changes: 74 additions & 0 deletions Spanner/src/V1/BatchWriteRequest.php

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

15 changes: 9 additions & 6 deletions Spanner/src/V1/DirectedReadOptions.php

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

2 changes: 1 addition & 1 deletion Spanner/src/V1/DirectedReadOptions/ReplicaSelection.php

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

19 changes: 19 additions & 0 deletions Spanner/src/V1/Gapic/SpannerGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,19 @@ public function batchCreateSessions(
*
* @type RequestOptions $requestOptions
* Common options for this request.
* @type bool $excludeTxnFromChangeStreams
* Optional. When `exclude_txn_from_change_streams` is set to `true`:
* * Mutations from all transactions in this batch write operation will not
* be recorded in change streams with DDL option `allow_txn_exclusion=true`
* that are tracking columns modified by these transactions.
* * Mutations from all transactions in this batch write operation will be
* recorded in change streams with DDL option `allow_txn_exclusion=false or
* not set` that are tracking columns modified by these transactions.
*
* When `exclude_txn_from_change_streams` is set to `false` or not set,
* mutations from all transactions in this batch write operation will be
* recorded in all change streams that are tracking columns modified by these
* transactions.
* @type int $timeoutMillis
* Timeout to use for this call.
* }
Expand All @@ -470,6 +483,12 @@ public function batchWrite(
$request->setRequestOptions($optionalArgs['requestOptions']);
}

if (isset($optionalArgs['excludeTxnFromChangeStreams'])) {
$request->setExcludeTxnFromChangeStreams(
$optionalArgs['excludeTxnFromChangeStreams']
);
}

$requestParams = new RequestParamsHeaderDescriptor(
$requestParamHeaders
);
Expand Down
58 changes: 58 additions & 0 deletions Spanner/src/V1/Session.php

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

4 changes: 4 additions & 0 deletions Spanner/tests/Unit/V1/Client/SpannerClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ public function createSessionTest()
// Mock response
$name = 'name3373707';
$creatorRole = 'creatorRole-1605962583';
$multiplexed = false;
$expectedResponse = new Session();
$expectedResponse->setName($name);
$expectedResponse->setCreatorRole($creatorRole);
$expectedResponse->setMultiplexed($multiplexed);
$transport->addResponse($expectedResponse);
// Mock request
$formattedDatabase = $gapicClient->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]');
Expand Down Expand Up @@ -751,9 +753,11 @@ public function getSessionTest()
// Mock response
$name2 = 'name2-1052831874';
$creatorRole = 'creatorRole-1605962583';
$multiplexed = false;
$expectedResponse = new Session();
$expectedResponse->setName($name2);
$expectedResponse->setCreatorRole($creatorRole);
$expectedResponse->setMultiplexed($multiplexed);
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->sessionName('[PROJECT]', '[INSTANCE]', '[DATABASE]', '[SESSION]');
Expand Down
4 changes: 4 additions & 0 deletions Spanner/tests/Unit/V1/SpannerClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ public function createSessionTest()
// Mock response
$name = 'name3373707';
$creatorRole = 'creatorRole-1605962583';
$multiplexed = false;
$expectedResponse = new Session();
$expectedResponse->setName($name);
$expectedResponse->setCreatorRole($creatorRole);
$expectedResponse->setMultiplexed($multiplexed);
$transport->addResponse($expectedResponse);
// Mock request
$formattedDatabase = $gapicClient->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]');
Expand Down Expand Up @@ -683,9 +685,11 @@ public function getSessionTest()
// Mock response
$name2 = 'name2-1052831874';
$creatorRole = 'creatorRole-1605962583';
$multiplexed = false;
$expectedResponse = new Session();
$expectedResponse->setName($name2);
$expectedResponse->setCreatorRole($creatorRole);
$expectedResponse->setMultiplexed($multiplexed);
$transport->addResponse($expectedResponse);
// Mock request
$formattedName = $gapicClient->sessionName('[PROJECT]', '[INSTANCE]', '[DATABASE]', '[SESSION]');
Expand Down
Loading