-
Notifications
You must be signed in to change notification settings - Fork 385
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
refactor(bigtable): future-proof ReadRows mocking #11725
refactor(bigtable): future-proof ReadRows mocking #11725
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #11725 +/- ##
=======================================
Coverage 93.78% 93.78%
=======================================
Files 1829 1829
Lines 164878 164947 +69
=======================================
+ Hits 154627 154695 +68
- Misses 10251 10252 +1
☔ View full report in Codecov by Sentry. |
Can you stop the In some stuff I'm working on with a new "params-destined option", the client calls now look like ...
Or, might an existing |
No, I don't think so. I have to keep calling this connection method from the client (which doesn't accept an app profile id): google-cloud-cpp/google/cloud/bigtable/table.cc Lines 222 to 223 in 1260047
I could reverse the flow of the Connection methods. But then there would be no point to extracting the option. I would have to add it back in. Table::ReadRows(..., opts) {
opts = internal::MergeOptions(std::move(opts), options_);
auto app_profile_id = internal::ExtractOption<AppProfileIdOption>(opts);
OptionsSpan o(std::move(opts));
auto params = ReadRowsParams{...};
connection_->ReadRowsFull(params);
}
DataConnection::ReadRowsFull(ReadRowsParams params) {
auto options = internal::CurrentOptions();
options.set<AppProfileIdOption>(params.app_profile_id);
OptionsSpan o(std::move(options));
return ReadRows(params.foo, params.bar, params.baz, params.etc);
}
Yeah, that can also be a problem.
Yeah, that looks right to me. I just can't use it in |
EDIT: The mystery feature was #12010
Part of the work for <mystery bigtable feature>
Googlers can see: go/cloud-cxx:how-to-grow-bigtable-read-rows
The new Connection API allows us to add additional
ReadRowsRequest
configuration parameters.I think we should include
app_profile_id
in the params struct. It is easier to check in the params struct than ingoogle::cloud::mocks::CurrentOptions()
.Note that we cannot
internal::ExtractOption<AppProfileIdOption>
in the connection layer, because the current options areconst&
. I think it is safer to just use.get<>
instead of changing the method toOptions& internal::CurrentOptions()
.This change is