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): add base client #4422

Merged
merged 10 commits into from Jul 14, 2021

Conversation

shollyman
Copy link
Contributor

@shollyman shollyman commented Jul 12, 2021

This PR adds a base client and managed stream abstraction, and
implements some of the associated surfaces. All the
streaming client abstractions are elided and will be introduced in
subsequent PRs, but this PR does include non-streaming RPC methods

Alongside the client, we introduce an option type (WriterOption) for
constructing a client in a variadic fashion.

The client contains an internal settings type, streamSettings, which
contains fields of note for both the streaming client abstraction and
its flow controller.

Testing: This PR contains unit tests, but doesn't include integration
tests. I'll start hoisting that in soon.

Towards: #4366

This PR adds a base client and implements some of the surface.  All the
streaming client abstractions are elided and will be introduced in
subsequent PRs, but this PR does include non-streaming RPC methods

Alongside the client, we introduce an option type (WriterOption) for
constructing a client in a variadic fashion.

The client contains an internal settings type, streamSettings, which
contains fields of note for both the streaming client abstraction and
its flow controller.

Testing: This PR contains unit tests, but doesn't include integration
tests.  I'll start hoisting that in soon.
@shollyman shollyman requested a review from a team as a code owner July 12, 2021 22:09
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Jul 12, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 12, 2021
@shollyman shollyman requested a review from codyoss July 12, 2021 22:10
bigquery/storage/managedwriter/client.go Outdated Show resolved Hide resolved
bigquery/storage/managedwriter/client.go Outdated Show resolved Hide resolved
bigquery/storage/managedwriter/client.go Outdated Show resolved Hide resolved
@shollyman shollyman requested a review from codyoss July 13, 2021 22:42
}

// NewManagedStream establishes a new stream for writing.
func (c *Client) NewManagedStream(ctx context.Context, table *bigquery.Table, opts ...WriterOption) (*ManagedStream, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I think table could just be datasetID and tableID. I worry about this client reaching for code in both directions up and down the file structure. This means the core bigquery package could never rely on this package due to cycles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine switching it to string, now I'm wondering if it should be a variadic argument. We don't do anything with the reference other than for the construct a stream case, but if we allow users to pass in an optional stream ID perhaps we let them treat table as optional as well? Will switch it and augment the validation (your other comment) and see how it plays.

bigquery/storage/managedwriter/client.go Outdated Show resolved Hide resolved
@shollyman shollyman requested a review from codyoss July 14, 2021 16:46
@shollyman shollyman added the automerge Merge the pull request once unit tests and other checks pass. label Jul 14, 2021
@shollyman shollyman merged commit 4f7193b into googleapis:master Jul 14, 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 Jul 14, 2021
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