|
|
|
@ -94,7 +94,8 @@ struct SavePoints { |
|
|
|
|
|
|
|
|
|
WriteBatch::WriteBatch(size_t reserved_bytes) |
|
|
|
|
: save_points_(nullptr), content_flags_(0), rep_() { |
|
|
|
|
rep_.reserve((reserved_bytes > WriteBatchInternal::kHeader) ? reserved_bytes : WriteBatchInternal::kHeader); |
|
|
|
|
rep_.reserve((reserved_bytes > WriteBatchInternal::kHeader) ?
|
|
|
|
|
reserved_bytes : WriteBatchInternal::kHeader); |
|
|
|
|
rep_.resize(WriteBatchInternal::kHeader); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -327,7 +328,9 @@ void WriteBatchInternal::SetSequence(WriteBatch* b, SequenceNumber seq) { |
|
|
|
|
EncodeFixed64(&b->rep_[0], seq); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
size_t WriteBatchInternal::GetFirstOffset(WriteBatch* b) { return WriteBatchInternal::kHeader; } |
|
|
|
|
size_t WriteBatchInternal::GetFirstOffset(WriteBatch* b) {
|
|
|
|
|
return WriteBatchInternal::kHeader;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WriteBatchInternal::Put(WriteBatch* b, uint32_t column_family_id, |
|
|
|
|
const Slice& key, const Slice& value) { |
|
|
|
@ -838,7 +841,8 @@ void WriteBatchInternal::SetContents(WriteBatch* b, const Slice& contents) { |
|
|
|
|
void WriteBatchInternal::Append(WriteBatch* dst, const WriteBatch* src) { |
|
|
|
|
SetCount(dst, Count(dst) + Count(src)); |
|
|
|
|
assert(src->rep_.size() >= WriteBatchInternal::kHeader); |
|
|
|
|
dst->rep_.append(src->rep_.data() + WriteBatchInternal::kHeader, src->rep_.size() - WriteBatchInternal::kHeader); |
|
|
|
|
dst->rep_.append(src->rep_.data() + WriteBatchInternal::kHeader,
|
|
|
|
|
src->rep_.size() - WriteBatchInternal::kHeader); |
|
|
|
|
dst->content_flags_.store( |
|
|
|
|
dst->content_flags_.load(std::memory_order_relaxed) | |
|
|
|
|
src->content_flags_.load(std::memory_order_relaxed), |
|
|
|
|