Skip to content

Commit

Permalink
Add Env::SanitizeEnvOptions (#5885)
Browse files Browse the repository at this point in the history
Summary:
Add Env::SanitizeEnvOptions to allow underlying environments properly
configure env options.
Pull Request resolved: #5885

Test Plan:
```
make check
```

Differential Revision: D17910327

Pulled By: riversand963

fbshipit-source-id: 86a1ac616e485742c35c4a9cc9f1227c529fc00f
  • Loading branch information
riversand963 authored and facebook-github-bot committed Oct 14, 2019
1 parent a6e615a commit 231fffd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions env/env.cc
Expand Up @@ -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);
}

}
Expand Down
5 changes: 5 additions & 0 deletions include/rocksdb/env.h
Expand Up @@ -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:
Expand Down Expand Up @@ -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_;
Expand Down

0 comments on commit 231fffd

Please sign in to comment.