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