|
|
@ -122,14 +122,14 @@ void SstFileManagerImpl::OnDeleteFileImpl(const std::string& file_path) { |
|
|
|
SstFileManager* NewSstFileManager(Env* env, std::shared_ptr<Logger> info_log, |
|
|
|
SstFileManager* NewSstFileManager(Env* env, std::shared_ptr<Logger> info_log, |
|
|
|
std::string trash_dir, |
|
|
|
std::string trash_dir, |
|
|
|
int64_t rate_bytes_per_sec, |
|
|
|
int64_t rate_bytes_per_sec, |
|
|
|
bool delete_exisitng_trash, Status* status) { |
|
|
|
bool delete_existing_trash, Status* status) { |
|
|
|
SstFileManagerImpl* res = |
|
|
|
SstFileManagerImpl* res = |
|
|
|
new SstFileManagerImpl(env, info_log, trash_dir, rate_bytes_per_sec); |
|
|
|
new SstFileManagerImpl(env, info_log, trash_dir, rate_bytes_per_sec); |
|
|
|
|
|
|
|
|
|
|
|
Status s; |
|
|
|
Status s; |
|
|
|
if (trash_dir != "" && rate_bytes_per_sec > 0) { |
|
|
|
if (trash_dir != "" && rate_bytes_per_sec > 0) { |
|
|
|
s = env->CreateDirIfMissing(trash_dir); |
|
|
|
s = env->CreateDirIfMissing(trash_dir); |
|
|
|
if (s.ok() && delete_exisitng_trash) { |
|
|
|
if (s.ok() && delete_existing_trash) { |
|
|
|
std::vector<std::string> files_in_trash; |
|
|
|
std::vector<std::string> files_in_trash; |
|
|
|
s = env->GetChildren(trash_dir, &files_in_trash); |
|
|
|
s = env->GetChildren(trash_dir, &files_in_trash); |
|
|
|
if (s.ok()) { |
|
|
|
if (s.ok()) { |
|
|
@ -161,7 +161,7 @@ SstFileManager* NewSstFileManager(Env* env, std::shared_ptr<Logger> info_log, |
|
|
|
SstFileManager* NewSstFileManager(Env* env, std::shared_ptr<Logger> info_log, |
|
|
|
SstFileManager* NewSstFileManager(Env* env, std::shared_ptr<Logger> info_log, |
|
|
|
std::string trash_dir, |
|
|
|
std::string trash_dir, |
|
|
|
int64_t rate_bytes_per_sec, |
|
|
|
int64_t rate_bytes_per_sec, |
|
|
|
bool delete_exisitng_trash, Status* status) { |
|
|
|
bool delete_existing_trash, Status* status) { |
|
|
|
if (status) { |
|
|
|
if (status) { |
|
|
|
*status = |
|
|
|
*status = |
|
|
|
Status::NotSupported("SstFileManager is not supported in ROCKSDB_LITE"); |
|
|
|
Status::NotSupported("SstFileManager is not supported in ROCKSDB_LITE"); |
|
|
|