feat: Support BatchWrite API#99
Conversation
| ## | ||
| # Part of the BatchWrite DSL. This object is passed as a parameter to the block | ||
| # passed to {Google::Cloud::Spanner::Client#batch_write}. Use this object to add | ||
| # mutation groups to the batch. |
There was a problem hiding this comment.
I'd say split the last sentence to make it more explicit, and to follow pattern with other files.
| request_options: request_options, | ||
| call_options: call_options | ||
| results = BatchWriteResults.new response | ||
| @last_updated_at = Time.now |
There was a problem hiding this comment.
Maybe it doesnt need to be done here, but I think we should use Process.clock_gettime. The method idle_since? has a concept of elapsed time and CLOCK_MONOTONIC is better for that case.
There was a problem hiding this comment.
You're right, this should be changed to use CLOCK_MONOTONIC. And yes, let's keep that separate. I filed #109 to track it.
| # | ||
| # @return [::Array<::Integer>] | ||
| # | ||
| def ok_indexes |
There was a problem hiding this comment.
successful_mutation_indexes (or indices)? Unless this name was already predetermined.
There was a problem hiding this comment.
You're right, that's an awkward name. Changed to successful_indexes.
Implementation of the BatchWrite API. See internal link go/cs-batch-write-client-spec for details. This pull request includes the implementation and tests but not the samples (which will appear in https://github.com/GoogleCloudPlatform/ruby-docs-samples).