mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Merge commit 'e8893e96780685b9e39447199d946739e565fef5' as 'src/hyperleveldb'
This commit is contained in:
49
src/hyperleveldb/db/write_batch_internal.h
Normal file
49
src/hyperleveldb/db/write_batch_internal.h
Normal file
@@ -0,0 +1,49 @@
|
||||
// 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_HYPERLEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
||||
#define STORAGE_HYPERLEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
||||
|
||||
#include "../hyperleveldb/write_batch.h"
|
||||
|
||||
namespace hyperleveldb {
|
||||
|
||||
class MemTable;
|
||||
|
||||
// WriteBatchInternal provides static methods for manipulating a
|
||||
// WriteBatch that we don't want in the public WriteBatch interface.
|
||||
class WriteBatchInternal {
|
||||
public:
|
||||
// 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);
|
||||
|
||||
// Return the seqeunce number for the start of this batch.
|
||||
static SequenceNumber Sequence(const WriteBatch* batch);
|
||||
|
||||
// Store the specified number as the seqeunce number for the start of
|
||||
// this batch.
|
||||
static void SetSequence(WriteBatch* batch, SequenceNumber seq);
|
||||
|
||||
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 Status InsertInto(const WriteBatch* batch, MemTable* memtable);
|
||||
|
||||
static void Append(WriteBatch* dst, const WriteBatch* src);
|
||||
};
|
||||
|
||||
} // namespace hyperleveldb
|
||||
|
||||
|
||||
#endif // STORAGE_HYPERLEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
||||
Reference in New Issue
Block a user