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:
parent
a6e615a7ba
commit
231fffd07c
1
env/env.cc
vendored
1
env/env.cc
vendored
@ -420,6 +420,7 @@ void AssignEnvOptions(EnvOptions* env_options, const DBOptions& options) {
|
|||||||
options.writable_file_max_buffer_size;
|
options.writable_file_max_buffer_size;
|
||||||
env_options->allow_fallocate = options.allow_fallocate;
|
env_options->allow_fallocate = options.allow_fallocate;
|
||||||
env_options->strict_bytes_per_sync = options.strict_bytes_per_sync;
|
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();
|
return Status::NotSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void SanitizeEnvOptions(EnvOptions* /*env_opts*/) const {}
|
||||||
|
|
||||||
// If you're adding methods here, remember to add them to EnvWrapper too.
|
// If you're adding methods here, remember to add them to EnvWrapper too.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -1363,6 +1365,9 @@ class EnvWrapper : public Env {
|
|||||||
Status GetFreeSpace(const std::string& path, uint64_t* diskfree) override {
|
Status GetFreeSpace(const std::string& path, uint64_t* diskfree) override {
|
||||||
return target_->GetFreeSpace(path, diskfree);
|
return target_->GetFreeSpace(path, diskfree);
|
||||||
}
|
}
|
||||||
|
void SanitizeEnvOptions(EnvOptions* env_opts) const override {
|
||||||
|
target_->SanitizeEnvOptions(env_opts);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Env* target_;
|
Env* target_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user