diff options
author | costan <costan@google.com> | 2018-08-14 15:23:53 -0700 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2018-08-14 15:30:29 -0700 |
commit | f7b0e1d901da26ac5ce6ad7f0a9806ce1440197e (patch) | |
tree | 2cc4735f612860a94982e1db830ab2632cb2a1bf /include | |
parent | 6caf73ad9dae0ee91873bcb39554537b85163770 (diff) | |
download | leveldb-f7b0e1d901da26ac5ce6ad7f0a9806ce1440197e.tar.gz |
Expose WriteBatch::Append().
WriteBatchInternal has a method for efficiently concatenating two
WriteBatches. This commit exposes the method to the public API.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208724311
Diffstat (limited to 'include')
-rw-r--r-- | include/leveldb/write_batch.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/leveldb/write_batch.h b/include/leveldb/write_batch.h index b6d72cb..9386ace 100644 --- a/include/leveldb/write_batch.h +++ b/include/leveldb/write_batch.h @@ -54,6 +54,13 @@ class LEVELDB_EXPORT WriteBatch { // releases. It is intended for LevelDB usage metrics. size_t ApproximateSize(); + // Copies the operations in "source" to this batch. + // + // This runs in O(source size) time. However, the constant factor is better + // than calling Iterate() over the source batch with a Handler that replicates + // the operations into this batch. + void Append(const WriteBatch& source); + // Support for iterating over the contents of a batch. class Handler { public: |