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
This commit is contained in:
Yanqin Jin 2019-10-14 12:23:39 -07:00 committed by Facebook Github Bot
parent a6e615a7ba
commit 231fffd07c
2 changed files with 6 additions and 0 deletions

1
env/env.cc vendored
View File

@ -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);
}
}

View File

@ -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_;