Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[API] unified API for custom kvstores #17010

Merged
merged 37 commits into from
Dec 17, 2019
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into unify-kvb
eric-haibin-lin authored Dec 12, 2019
commit 034d868710c131f4131a2d9f7a5b04740986b07c
24 changes: 15 additions & 9 deletions src/kvstore/kvstore_dist_server.h
Original file line number Diff line number Diff line change
@@ -371,15 +371,21 @@ class KVStoreDistServer {
*/
bool has_pull = false;
for (const auto& req : update_buf->request) {
/**
* Request can be for either push, pull or pushpull
* If pull flag is set, respond immediately with the updated values
* Otherwise, only send the notification
*/
if (req.pull) {
stored.WaitToRead();
DefaultStorageResponse(type, key, req, req_data, server);
} else {
has_pull = has_pull || req.pull;
}
if (has_pull) {
// if there is a pull request, perform WaitToRead() once before DefaultStorageResponse
if (has_multi_precision_copy(type)) CopyFromTo(stored, store_[key]);
stored.WaitToRead();
for (const auto& req : update_buf->request) {
if (req.pull) {
DefaultStorageResponse(type, key, req, req_data, server);
}
}
update_buf->request.clear();
} else {
// otherwise, send response directly
for (const auto& req : update_buf->request) {
server->Response(req);
}
update_buf->request.clear();
You are viewing a condensed version of this merge commit. You can view the full changes here.