Browse Source

添加合并逻辑-朱陈媛

main
朱陈媛 3 weeks ago
parent
commit
7acbdab58b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      leveldb_base/db/write_batch.cc

+ 2
- 2
leveldb_base/db/write_batch.cc View File

@ -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));

Loading…
Cancel
Save