From d0a30935c612d5420d9e4925bdfee8c3e55d2b60 Mon Sep 17 00:00:00 2001 From: Dhruba Borthakur Date: Tue, 11 Dec 2012 23:54:03 -0800 Subject: [PATCH] Expose the serialized string that represents a WriteBatch. Summary: Expose the serialized string that represents a WriteBatch. This is helpful to replicate a writebatch operation from one machine to another. Test Plan: make clean check Reviewers: sheki Reviewed By: sheki CC: leveldb Differential Revision: https://reviews.facebook.net/D7317 --- include/leveldb/write_batch.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/leveldb/write_batch.h b/include/leveldb/write_batch.h index ee9aab68e..ac0e2e11d 100644 --- a/include/leveldb/write_batch.h +++ b/include/leveldb/write_batch.h @@ -51,6 +51,9 @@ class WriteBatch { }; Status Iterate(Handler* handler) const; + // Returns the serialized string + std::string Data() { return rep_; } + private: friend class WriteBatchInternal; -- GitLab