diff options
Diffstat (limited to 'src/third_party/wiredtiger/api/leveldb/leveldb/db/write_batch_internal.h')
-rw-r--r-- | src/third_party/wiredtiger/api/leveldb/leveldb/db/write_batch_internal.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/api/leveldb/leveldb/db/write_batch_internal.h b/src/third_party/wiredtiger/api/leveldb/leveldb/db/write_batch_internal.h new file mode 100644 index 00000000000..c8421cce124 --- /dev/null +++ b/src/third_party/wiredtiger/api/leveldb/leveldb/db/write_batch_internal.h @@ -0,0 +1,53 @@ +// Copyright (c) 2011 The LevelDB Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. See the AUTHORS file for names of contributors. + +#ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ +#define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ + +#include "leveldb_wt.h" +#include "db/dbformat.h" + +namespace leveldb { + +// WriteBatchInternal provides static methods for manipulating a +// WriteBatch that we don't want in the public WriteBatch interface. +class WriteBatchInternal { + public: +#ifdef HAVE_ROCKSDB + // WriteBatch methods with column_family_id instead of ColumnFamilyHandle* + static void Put(WriteBatch* batch, uint32_t column_family_id, + const Slice& key, const Slice& value); + + static void Put(WriteBatch* batch, uint32_t column_family_id, + const SliceParts& key, const SliceParts& value); + + static void Delete(WriteBatch* batch, uint32_t column_family_id, + const Slice& key); + + static void Merge(WriteBatch* batch, uint32_t column_family_id, + const Slice& key, const Slice& value); +#endif + // Return the number of entries in the batch. + static int Count(const WriteBatch* batch); + + // Set the count for the number of entries in the batch. + static void SetCount(WriteBatch* batch, int n); + + static Slice Contents(const WriteBatch* batch) { + return Slice(batch->rep_); + } + + static size_t ByteSize(const WriteBatch* batch) { + return batch->rep_.size(); + } + + static void SetContents(WriteBatch* batch, const Slice& contents); + + static void Append(WriteBatch* dst, const WriteBatch* src); +}; + +} // namespace leveldb + + +#endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ |