提交 231fffd0 编写于 作者: Y Yanqin Jin 提交者: Facebook Github Bot

Add Env::SanitizeEnvOptions (#5885)

Summary:
Add Env::SanitizeEnvOptions to allow underlying environments properly
configure env options.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5885

Test Plan:
```
make check
```

Differential Revision: D17910327

Pulled By: riversand963

fbshipit-source-id: 86a1ac616e485742c35c4a9cc9f1227c529fc00f
上级 a6e615a7
......@@ -420,6 +420,7 @@ void AssignEnvOptions(EnvOptions* env_options, const DBOptions& options) {
options.writable_file_max_buffer_size;
env_options->allow_fallocate = options.allow_fallocate;
env_options->strict_bytes_per_sync = options.strict_bytes_per_sync;
options.env->SanitizeEnvOptions(env_options);
}
}
......
......@@ -528,6 +528,8 @@ class Env {
return Status::NotSupported();
}
virtual void SanitizeEnvOptions(EnvOptions* /*env_opts*/) const {}
// If you're adding methods here, remember to add them to EnvWrapper too.
protected:
......@@ -1363,6 +1365,9 @@ class EnvWrapper : public Env {
Status GetFreeSpace(const std::string& path, uint64_t* diskfree) override {
return target_->GetFreeSpace(path, diskfree);
}
void SanitizeEnvOptions(EnvOptions* env_opts) const override {
target_->SanitizeEnvOptions(env_opts);
}
private:
Env* target_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册