浏览代码

添加合并逻辑-朱陈媛

main
朱陈媛 7 个月前
父节点
当前提交
7acbdab58b
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      leveldb_base/db/write_batch.cc

+ 2
- 2
leveldb_base/db/write_batch.cc 查看文件

@ -20,7 +20,7 @@
#include "db/write_batch_internal.h" #include "db/write_batch_internal.h"
#include "leveldb/db.h" #include "leveldb/db.h"
#include "util/coding.h" #include "util/coding.h"
// 添加所需头文件- // 添加所需头文件-朱陈媛
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <ctime> #include <ctime>
@ -105,7 +105,7 @@ void WriteBatch::Put(const Slice& key, const Slice& value) {
PutLengthPrefixedSlice(&rep_, key); PutLengthPrefixedSlice(&rep_, key);
PutLengthPrefixedSlice(&rep_, value); PutLengthPrefixedSlice(&rep_, value);
} }
// 添加ttl,新的put方法- // 添加ttl,新的put方法-朱陈媛
void WriteBatch::Put(const Slice& key, const Slice& value, uint64_t ttl) { void WriteBatch::Put(const Slice& key, const Slice& value, uint64_t ttl) {
WriteBatchInternal::SetCount(this, WriteBatchInternal::Count(this) + 1); WriteBatchInternal::SetCount(this, WriteBatchInternal::Count(this) + 1);
rep_.push_back(static_cast<char>(kTypeValue)); rep_.push_back(static_cast<char>(kTypeValue));

||||||
x
 
000:0
正在加载...
取消
保存