Add missing RemapFileSystem::ReopenWritableFile (#12941)

Summary:
`RemapFileSystem::ReopenWritableFile` is missing, add it.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12941

Reviewed By: pdillinger

Differential Revision: D61822540

Pulled By: cbi42

fbshipit-source-id: dc228f7e8b842216f63de8b925cb663898455345
This commit is contained in:
leipeng 2024-09-17 13:08:25 -07:00 committed by Facebook GitHub Bot
parent 0e04ef1a96
commit 8648fbcba3
2 changed files with 16 additions and 0 deletions

11
env/fs_remap.cc vendored
View File

@ -77,6 +77,17 @@ IOStatus RemapFileSystem::NewWritableFile(
result, dbg); result, dbg);
} }
IOStatus RemapFileSystem::ReopenWritableFile(
const std::string& fname, const FileOptions& options,
std::unique_ptr<FSWritableFile>* result, IODebugContext* dbg) {
auto status_and_enc_path = EncodePathWithNewBasename(fname);
if (!status_and_enc_path.first.ok()) {
return status_and_enc_path.first;
}
return FileSystemWrapper::ReopenWritableFile(status_and_enc_path.second,
options, result, dbg);
}
IOStatus RemapFileSystem::ReuseWritableFile( IOStatus RemapFileSystem::ReuseWritableFile(
const std::string& fname, const std::string& old_fname, const std::string& fname, const std::string& old_fname,
const FileOptions& options, std::unique_ptr<FSWritableFile>* result, const FileOptions& options, std::unique_ptr<FSWritableFile>* result,

5
env/fs_remap.h vendored
View File

@ -65,6 +65,11 @@ class RemapFileSystem : public FileSystemWrapper {
std::unique_ptr<FSWritableFile>* result, std::unique_ptr<FSWritableFile>* result,
IODebugContext* dbg) override; IODebugContext* dbg) override;
IOStatus ReopenWritableFile(const std::string& fname,
const FileOptions& options,
std::unique_ptr<FSWritableFile>* result,
IODebugContext* dbg) override;
IOStatus ReuseWritableFile(const std::string& fname, IOStatus ReuseWritableFile(const std::string& fname,
const std::string& old_fname, const std::string& old_fname,
const FileOptions& options, const FileOptions& options,