[CF] Add full_options_ to ColumnFamilyData

Summary:
Lots of code expects Options on construction/function call. My original idea was to split Options argument into ColumnFamilyOptions and DBOptions (the latter only if needed). However, this will require huge code changes very deep in the stack.

The better idea is to have ColumnFamilyData hold both ColumnFamilyOptions and Options. ColumnFamilyData::Options would be constructed from DBOptions (same for each column family) and ColumnFamilyOptions (different for each column family)

Now when we construct a class or call any method that requires Options, we can just push him ColumnFamilyData::Options and be sure that it's using column-family-specific settings.

Test Plan: make check

Reviewers: dhruba, haobo, kailiu, sdong

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15927
This commit is contained in:
Igor Canadi
2014-02-05 12:20:40 -08:00
parent 328ac7ee02
commit 6e56ab5702
5 changed files with 23 additions and 27 deletions

View File

@@ -24,8 +24,7 @@ class Env;
class TableCache {
public:
TableCache(const std::string& dbname, const Options* db_options,
const ColumnFamilyOptions* cf_options,
TableCache(const std::string& dbname, const Options* options,
const EnvOptions& storage_options, Cache* cache);
~TableCache();
@@ -67,8 +66,7 @@ class TableCache {
private:
Env* const env_;
const std::string dbname_;
const Options* db_options_;
const ColumnFamilyOptions* cf_options_;
const Options* options_;
const EnvOptions& storage_options_;
Cache* const cache_;