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(bigquery/storage/managedwriter): improve method parity in managedwriter #5007

Merged
merged 4 commits into from Oct 21, 2021

Conversation

shollyman
Copy link
Contributor

@shollyman shollyman commented Oct 20, 2021

This PR exposes the raw methods for creating and committing streams to the wrapped managedwriter client.

It allows users to interact with all the methods of the underlying API using the managedwriter client (which itself wraps the raw v1 client). The disadvantage is that it couples managedwriter directly to v1, as it accepts requests in the v1 namespace. The existing append interactions all use abstractions local to the managedwriter.

PR also gets rid of the utility method for batch committing write streams; there's not a great deal of utility saved here vs the underlying method.

Towards: #4366

@shollyman shollyman requested a review from a team October 20, 2021 17:33
@shollyman shollyman requested a review from a team as a code owner October 20, 2021 17:33
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 20, 2021
@shollyman shollyman changed the title fr: improve method parity for managedwriter feat(bigquery): improve method parity in managedwriter Oct 20, 2021
@shollyman shollyman changed the title feat(bigquery): improve method parity in managedwriter feat(bigquery/storage/managedwriter): improve method parity in managedwriter Oct 20, 2021
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Oct 21, 2021
// CreateWriteStream. It is a stream that can be used simultaneously by any
// number of clients. Data written to this stream is considered committed as
// soon as an acknowledgement is received.
func (c *Client) CreateWriteStream(ctx context.Context, req *storagepb.CreateWriteStreamRequest, opts ...gax.CallOption) (*storagepb.WriteStream, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we should be creating wrapper types for req objs? One think I generally like our manual layers is that a user does not have to import two namespaces to interact with our clients, but when we other package types in the parameters they do. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the bit I'm struggling with. This service in general does lots of subtle things with protobuf, so the expectation is that users will be more aware of those kinds of interactions.

The other strategy would be to keep the wrapped batch commit method, and extend ManagedWriter further to allow for things like mutable schemas, and mechanisms for returning existing table schemas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not super enamored of just copying the request protos themselves, but I suppose that's another option.

Copy link
Member

Choose a reason for hiding this comment

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

👍🏻 Seems fine for now. Might want to take another look at the whole surface before it is stabilized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's definitely warranted.

@shollyman shollyman added the automerge Merge the pull request once unit tests and other checks pass. label Oct 21, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit a2af4de into googleapis:master Oct 21, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 21, 2021
@shollyman shollyman deleted the fr-method-parity branch October 21, 2021 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants