This is an automated email from the ASF dual-hosted git repository.
zhaoliwei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git
The following commit(s) were added to refs/heads/master by this push:
new bd10cd0 refactor: use rocksdb_wrapper to reimplement empty_put (#670)
bd10cd0 is described below
commit bd10cd0c31f7454f19003468b407ab58d60a17e3
Author: zhao liwei <[email protected]>
AuthorDate: Thu Jan 7 10:08:02 2021 +0800
refactor: use rocksdb_wrapper to reimplement empty_put (#670)
---
src/server/pegasus_write_service_impl.h | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/server/pegasus_write_service_impl.h
b/src/server/pegasus_write_service_impl.h
index 8d15709..0ff99ce 100644
--- a/src/server/pegasus_write_service_impl.h
+++ b/src/server/pegasus_write_service_impl.h
@@ -104,15 +104,14 @@ public:
int empty_put(int64_t decree)
{
- int err = db_write_batch_put(decree, dsn::string_view(),
dsn::string_view(), 0);
+ int err =
+ _rocksdb_wrapper->write_batch_put(decree, dsn::string_view(),
dsn::string_view(), 0);
+ auto cleanup = dsn::defer([this]() {
_rocksdb_wrapper->clear_up_write_batch(); });
if (err) {
- clear_up_batch_states(decree, err);
return err;
}
- err = db_write(decree);
-
- clear_up_batch_states(decree, err);
+ err = _rocksdb_wrapper->write(decree);
return err;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]