|
|
@ -34,6 +34,7 @@ |
|
|
|
#include "util/coding.h"
|
|
|
|
#include "util/logging.h"
|
|
|
|
#include "util/mutexlock.h"
|
|
|
|
#include "util/serialize_value.h"
|
|
|
|
|
|
|
|
namespace leveldb { |
|
|
|
|
|
|
@ -1164,6 +1165,18 @@ Status DBImpl::Get(const ReadOptions& options, const Slice& key, |
|
|
|
return s; |
|
|
|
} |
|
|
|
|
|
|
|
Status DBImpl::GetFields(const ReadOptions& options, const Slice& key, |
|
|
|
FieldArray* fields) { |
|
|
|
std::string value; |
|
|
|
Status s = DBImpl::Get(options, key, &value); |
|
|
|
fields = ParseValue(value); |
|
|
|
return s; |
|
|
|
} |
|
|
|
|
|
|
|
std::vector<std::string> DBImpl::FindKeysByField(Field &field){//todo
|
|
|
|
return std::vector<std::string>(); |
|
|
|
} |
|
|
|
|
|
|
|
Iterator* DBImpl::NewIterator(const ReadOptions& options) { |
|
|
|
SequenceNumber latest_snapshot; |
|
|
|
uint32_t seed; |
|
|
@ -1198,6 +1211,10 @@ Status DBImpl::Put(const WriteOptions& o, const Slice& key, const Slice& val) { |
|
|
|
return DB::Put(o, key, val); |
|
|
|
} |
|
|
|
|
|
|
|
Status DBImpl::PutFields(const WriteOptions& o, const Slice& key, const FieldArray& fields) { |
|
|
|
return DB::PutFields(o, key, fields); |
|
|
|
} |
|
|
|
|
|
|
|
Status DBImpl::Delete(const WriteOptions& options, const Slice& key) { |
|
|
|
return DB::Delete(options, key); |
|
|
|
} |
|
|
@ -1491,6 +1508,11 @@ Status DB::Put(const WriteOptions& opt, const Slice& key, const Slice& value) { |
|
|
|
return Write(opt, &batch); |
|
|
|
} |
|
|
|
|
|
|
|
Status DB::PutFields(const WriteOptions& opt, const Slice& key, const FieldArray& fields) { |
|
|
|
std::string value = SerializeValue(fields); |
|
|
|
DB::Put(opt, key, value); |
|
|
|
} |
|
|
|
|
|
|
|
Status DB::Delete(const WriteOptions& opt, const Slice& key) { |
|
|
|
WriteBatch batch; |
|
|
|
batch.Delete(key); |
|
|
|