diff --git a/include/rocksdb/write_batch.h b/include/rocksdb/write_batch.h index 798807045fde0a2bd8bf13c1819195d66abc8f6c..30abead502f28628ba3589f8572edc27d8fc17b2 100644 --- a/include/rocksdb/write_batch.h +++ b/include/rocksdb/write_batch.h @@ -88,7 +88,10 @@ class WriteBatch { Status Iterate(Handler* handler) const; // Retrieve the serialized version of this batch. - std::string Data() { return rep_; } + std::string Data() const { return rep_; } + + // Retrieve data size of the batch. + size_t GetDataSize() const { return rep_.size(); } // Returns the number of updates in the batch int Count() const;