[MooncakeStore] support batch api#428
Conversation
support to put/get a batch of data in order to reduce master rpc call.
xiaguan
left a comment
There was a problem hiding this comment.
I think the interface is good! It's just in the implementation that I feel we might need to pay a bit more attention to the parallelism aspect.
| const std::vector<std::string>& keys, | ||
| std::unordered_map<std::string, std::vector<Replica::Descriptor>>& | ||
| batch_replica_list) { | ||
| for (const auto& key : keys) { |
There was a problem hiding this comment.
I'm not sure putting the batch processing directly in the master is the best approach, as it might lose some parallelism.
I think a better option could be to put it in the master client instead. We could give each request its own task there, which would allow for better parallel execution. What do you think of that idea?
There was a problem hiding this comment.
Thanks for your comments! I will implement async concurrent gRPC call on master client side, will update PR later
| ObjectInfo object_info; | ||
| object_info.replica_list = object_info_it->second; | ||
| object_info.error_code = ErrorCode::OK; | ||
| if (Get(key, object_info, slices_it->second) != ErrorCode::OK) { |
There was a problem hiding this comment.
The same goes for the data transfer part – I think transferring objects one by one might also limit batch parallelism.
There was a problem hiding this comment.
Yes, it makes sense. I'd like to improve the batch transfer in following PRs
|
I think the interface looks good. We can probably improve the implementation step by step in future PRs. If you're okay with that, I'm happy to approve this one for now? |
Sure, I will improve the implementation in the following PRs |
* support batch api support to put/get a batch of data in order to reduce master rpc call. * fix typo
* support batch api support to put/get a batch of data in order to reduce master rpc call. * fix typo
This PR supports to put/get a batch of data in order to reduce master rpc call. It provides BatchPutStart, BatchPutEnd, BatchPutRevode and BatchGet APIs. I am still working on Python Store Batch API and will post it soon. Related RFC: #380