-
Notifications
You must be signed in to change notification settings - Fork 348
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
Basic implementation of bigtable::Table::ReadModifyWrite() #303
Comments
Understanding: To implement ReadModifyWrite function I was thinking two ways.
table.h => TableAdmin.h => Third way I can think of: ReadModifyWrite function declaration. |
The issue explicitly spells out that this is to be a member function of
While that is what we did for row reader, because the state machine is complex, for other functions (e.g.
Where?
I am not sure what file you are referring to:
Well, you can not declare a variadic function with a concrete list of types (I think) so it should be: template<typename... Args>
void ReadModifyWrite(std::string row_key, Args&&... rules); But it makes no sense to call the function with 0 arguments, so I think it should be something like: template <typename... Args>
void ReadModifyWrite(std::string row_key, bigtable::ReadModifyWriteRule rule, Args&&... rules) And to clarify even further my notes about how template <typename... Args>
void ReadModifyWrite(std::string row_key, bigtable::ReadModifyWriteRule rule, Args&&... rules) {
using RpcUtils = bigtable::internal::UnaryRpcUtils<DataClient>;
using StubType = RpcUtils::StubType;
using btproto = google::bigtable::v2;
btproto::ReadModifyWriteRequest request;
request.set_table_name(table_name_);
request.set_row_key(std::move(row_key));
*request.add_rules() = std::move(rule);
// TODO() - need to add any additional rules in the variadic argument list.
// TODO() - the rest of the code can be refactored to the .cc file in a private member function.
auto result = RpcUtils::CallWithoutRetry(*client_, rpc_retry_policy_->clone(),
&StubType::ReadModifyWrite, request,
"ReadModifyWrite()"); // TODO() - add more details to error message, table name and row are enough...
Row row;
// TODO() - convert the result into a Row object
return row;
} I hope that answers your questions, I should be available tomorrow morning for IM if that would help. |
This depends on #300, it must include (a potentially super trivial) unit test.
The text was updated successfully, but these errors were encountered: