|
@ -1234,7 +1234,7 @@ Status DBImpl::Get(const ReadOptions& options, const Slice& key, |
|
|
mem->Unref(); |
|
|
mem->Unref(); |
|
|
if (imm != nullptr) imm->Unref(); |
|
|
if (imm != nullptr) imm->Unref(); |
|
|
current->Unref(); |
|
|
current->Unref(); |
|
|
|
|
|
|
|
|
|
|
|
if(!s.ok())return s; |
|
|
if(value->c_str()[0]==0x00){ |
|
|
if(value->c_str()[0]==0x00){ |
|
|
*value=value->substr(1); |
|
|
*value=value->substr(1); |
|
|
return s; |
|
|
return s; |
|
@ -1575,17 +1575,6 @@ void DBImpl::GetApproximateSizes(const Range* range, int n, uint64_t* sizes) { |
|
|
v->Unref(); |
|
|
v->Unref(); |
|
|
} |
|
|
} |
|
|
std::vector<std::pair<uint64_t,std::pair<uint64_t,uint64_t>>> DBImpl::WriteValueLog(std::vector<Slice> values){ |
|
|
std::vector<std::pair<uint64_t,std::pair<uint64_t,uint64_t>>> DBImpl::WriteValueLog(std::vector<Slice> values){ |
|
|
//lock
|
|
|
|
|
|
// std::vector<std::pair<uint64_t,std::pair<uint64_t,uint64_t>>> res;
|
|
|
|
|
|
// for(int i=0;i<values.size();i++){
|
|
|
|
|
|
// int len=values[i].size();
|
|
|
|
|
|
// valuelogfile_->Append(values[i]);
|
|
|
|
|
|
// res.push_back({valuelogfile_number_,{valuelogfile_offset,len}});
|
|
|
|
|
|
// valuelogfile_offset+=len;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// //unlock
|
|
|
|
|
|
// valuelogfile_->Flush();
|
|
|
|
|
|
// return res;
|
|
|
|
|
|
std::string file_name_=ValueLogFileName(dbname_,valuelogfile_number_); |
|
|
std::string file_name_=ValueLogFileName(dbname_,valuelogfile_number_); |
|
|
std::ofstream valueFile(file_name_, std::ios::app | std::ios::binary); |
|
|
std::ofstream valueFile(file_name_, std::ios::app | std::ios::binary); |
|
|
if (!valueFile.is_open()) { |
|
|
if (!valueFile.is_open()) { |
|
|