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] Upgrade to PHP V2 #7193

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

feat!: [Spanner] Upgrade to PHP V2 #7193

wants to merge 4 commits into from

Conversation

ajupazhamayil
Copy link
Contributor

@ajupazhamayil ajupazhamayil commented Apr 1, 2024

PR for Spanner V2.

  • Migrate LRO APIs to V2
  • Spanner library changes

}

return $this->requestHandler->sendRequest(
OperationsGrpcClient::class,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I am using OperationsGrpcClient instead of OperationsClient of the DatabaseAdminClient.

If DatabaseAdminClient would have used the V2 OperationsGrpcClient, I could have simply extracted this from the DatabaseAdminClient->getOperationsClient method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Operations Client will be released this Friday in #7212 as google/longrunning:0.4.0

@ajupazhamayil ajupazhamayil force-pushed the spanner-v2 branch 2 times, most recently from 843be5e to 55a81e9 Compare April 1, 2024 18:01
Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is in draft mode, but the design is confusing to me. Do you have a document or anything to describe this approach?

*
* This trait should be used by a user-facing client which implements LRO.
*/
trait LROTraitV2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would try to avoid using version numbers in the class/trait names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, I will find a better name, how about LROManagerTrait?

Copy link
Contributor

@bshaffer bshaffer May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manager would be more for a class than a trait. Something like LROManagementTrait would make more sense. However, I think the verb is unnecessary. What about simply LongRunningOperationTrait?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LongRunningOperationTrait sounds great, will change to that name

use Google\Cloud\Core\Iterator\ItemIterator;
use Google\Cloud\Core\Iterator\PageIterator;
use Google\Cloud\Core\RequestHandler;
# TODO: Point to the correct request class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the correct request class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct class, this comment added here to discuss further on the arrival of new OperationsClient

I will remove this comment.

@ajupazhamayil
Copy link
Contributor Author

I see this is in draft mode, but the design is confusing to me. Do you have a document or anything to describe this approach?

We did not create any design document for these changes. We are following a V2 parent doc drafted by @saranshdhingra. Basically we are trying to remove usage of connection class objects and replace the usage with RequestHandler

Please let me know if you would like me to create a doc for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants