|
|
@ -948,6 +948,39 @@ Status BlobDBImpl::Write(const WriteOptions& opts, WriteBatch* updates) { |
|
|
|
return Status::OK(); |
|
|
|
return Status::OK(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Status BlobDBImpl::GetLiveFiles(std::vector<std::string>& ret, |
|
|
|
|
|
|
|
uint64_t* manifest_file_size, |
|
|
|
|
|
|
|
bool flush_memtable) { |
|
|
|
|
|
|
|
// Hold a lock in the beginning to avoid updates to base DB during the call
|
|
|
|
|
|
|
|
ReadLock rl(&mutex_); |
|
|
|
|
|
|
|
Status s = db_->GetLiveFiles(ret, manifest_file_size, flush_memtable); |
|
|
|
|
|
|
|
if (!s.ok()) { |
|
|
|
|
|
|
|
return s; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ret.reserve(ret.size() + blob_files_.size()); |
|
|
|
|
|
|
|
for (auto bfile_pair : blob_files_) { |
|
|
|
|
|
|
|
auto blob_file = bfile_pair.second; |
|
|
|
|
|
|
|
ret.emplace_back(blob_file->PathName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Status::OK(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BlobDBImpl::GetLiveFilesMetaData(std::vector<LiveFileMetaData>* metadata) { |
|
|
|
|
|
|
|
// Hold a lock in the beginning to avoid updates to base DB during the call
|
|
|
|
|
|
|
|
ReadLock rl(&mutex_); |
|
|
|
|
|
|
|
db_->GetLiveFilesMetaData(metadata); |
|
|
|
|
|
|
|
for (auto bfile_pair : blob_files_) { |
|
|
|
|
|
|
|
auto blob_file = bfile_pair.second; |
|
|
|
|
|
|
|
LiveFileMetaData filemetadata; |
|
|
|
|
|
|
|
filemetadata.size = blob_file->GetFileSize(); |
|
|
|
|
|
|
|
filemetadata.name = blob_file->PathName(); |
|
|
|
|
|
|
|
auto cfh = |
|
|
|
|
|
|
|
reinterpret_cast<ColumnFamilyHandleImpl*>(DefaultColumnFamily()); |
|
|
|
|
|
|
|
filemetadata.column_family_name = cfh->GetName(); |
|
|
|
|
|
|
|
metadata->emplace_back(filemetadata); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Status BlobDBImpl::PutWithTTL(const WriteOptions& options, |
|
|
|
Status BlobDBImpl::PutWithTTL(const WriteOptions& options, |
|
|
|
const Slice& key, const Slice& value, |
|
|
|
const Slice& key, const Slice& value, |
|
|
|
uint64_t ttl) { |
|
|
|
uint64_t ttl) { |
|
|
|