leveldb
Static Public Member Functions | List of all members
leveldb::WriteBatchInternal Class Reference

#include <write_batch_internal.h>

Static Public Member Functions

static int Count (const WriteBatch *batch)
 
static void SetCount (WriteBatch *batch, int n)
 
static SequenceNumber Sequence (const WriteBatch *batch)
 
static void SetSequence (WriteBatch *batch, SequenceNumber seq)
 
static Slice Contents (const WriteBatch *batch)
 
static size_t ByteSize (const WriteBatch *batch)
 
static void SetContents (WriteBatch *batch, const Slice &contents)
 
static Status InsertInto (const WriteBatch *batch, MemTable *memtable)
 
static void Append (WriteBatch *dst, const WriteBatch *src)
 

Detailed Description

Definition at line 17 of file write_batch_internal.h.

Member Function Documentation

§ Append()

void leveldb::WriteBatchInternal::Append ( WriteBatch dst,
const WriteBatch src 
)
static

Definition at line 141 of file write_batch.cc.

141  {
142  SetCount(dst, Count(dst) + Count(src));
143  assert(src->rep_.size() >= kHeader);
144  dst->rep_.append(src->rep_.data() + kHeader, src->rep_.size() - kHeader);
145 }
static void SetCount(WriteBatch *batch, int n)
Definition: write_batch.cc:86
static int Count(const WriteBatch *batch)
Definition: write_batch.cc:82
static const size_t kHeader
Definition: write_batch.cc:27
Here is the caller graph for this function:

§ ByteSize()

static size_t leveldb::WriteBatchInternal::ByteSize ( const WriteBatch batch)
inlinestatic

Definition at line 36 of file write_batch_internal.h.

36  {
37  return batch->rep_.size();
38  }
Here is the call graph for this function:
Here is the caller graph for this function:

§ Contents()

static Slice leveldb::WriteBatchInternal::Contents ( const WriteBatch batch)
inlinestatic

Definition at line 32 of file write_batch_internal.h.

32  {
33  return Slice(batch->rep_);
34  }
Here is the caller graph for this function:

§ Count()

int leveldb::WriteBatchInternal::Count ( const WriteBatch batch)
static

Definition at line 82 of file write_batch.cc.

82  {
83  return DecodeFixed32(b->rep_.data() + 8);
84 }
uint32_t DecodeFixed32(const char *ptr)
Definition: coding.h:58
Here is the call graph for this function:
Here is the caller graph for this function:

§ InsertInto()

Status leveldb::WriteBatchInternal::InsertInto ( const WriteBatch batch,
MemTable memtable 
)
static

Definition at line 128 of file write_batch.cc.

129  {
130  MemTableInserter inserter;
131  inserter.sequence_ = WriteBatchInternal::Sequence(b);
132  inserter.mem_ = memtable;
133  return b->Iterate(&inserter);
134 }
static SequenceNumber Sequence(const WriteBatch *batch)
Definition: write_batch.cc:90
Here is the call graph for this function:
Here is the caller graph for this function:

§ Sequence()

SequenceNumber leveldb::WriteBatchInternal::Sequence ( const WriteBatch batch)
static

Definition at line 90 of file write_batch.cc.

90  {
91  return SequenceNumber(DecodeFixed64(b->rep_.data()));
92 }
uint64_t DecodeFixed64(const char *ptr)
Definition: coding.h:72
uint64_t SequenceNumber
Definition: dbformat.h:63
Here is the call graph for this function:
Here is the caller graph for this function:

§ SetContents()

void leveldb::WriteBatchInternal::SetContents ( WriteBatch batch,
const Slice contents 
)
static

Definition at line 136 of file write_batch.cc.

136  {
137  assert(contents.size() >= kHeader);
138  b->rep_.assign(contents.data(), contents.size());
139 }
static const size_t kHeader
Definition: write_batch.cc:27
Here is the call graph for this function:
Here is the caller graph for this function:

§ SetCount()

void leveldb::WriteBatchInternal::SetCount ( WriteBatch batch,
int  n 
)
static

Definition at line 86 of file write_batch.cc.

86  {
87  EncodeFixed32(&b->rep_[8], n);
88 }
void EncodeFixed32(char *buf, uint32_t value)
Definition: coding.cc:9
Here is the call graph for this function:
Here is the caller graph for this function:

§ SetSequence()

void leveldb::WriteBatchInternal::SetSequence ( WriteBatch batch,
SequenceNumber  seq 
)
static

Definition at line 94 of file write_batch.cc.

94  {
95  EncodeFixed64(&b->rep_[0], seq);
96 }
void EncodeFixed64(char *buf, uint64_t value)
Definition: coding.cc:20
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: