[CF] OpenWithColumnFamilies -> Open

Summary: By discussion with @dhruba, overloading Open makes more sense

Test Plan: compiles!

Reviewers: dhruba

CC: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D16017
This commit is contained in:
Igor Canadi 2014-02-07 14:48:48 -08:00
parent 9ff9abeb83
commit 8d4db63a2d
3 changed files with 8 additions and 12 deletions

View File

@ -41,8 +41,7 @@ class ColumnFamilyTest {
column_families.push_back(
ColumnFamilyDescriptor(x, column_family_options_));
}
return DB::OpenWithColumnFamilies(db_options_, dbname_, column_families,
&handles_, &db_);
return DB::Open(db_options_, dbname_, column_families, &handles_, &db_);
}
void Destroy() {

View File

@ -3732,14 +3732,12 @@ Status DB::Open(const Options& options, const std::string& dbname, DB** dbptr) {
column_families.push_back(
ColumnFamilyDescriptor(default_column_family_name, cf_options));
std::vector<ColumnFamilyHandle> handles;
return DB::OpenWithColumnFamilies(db_options, dbname, column_families,
&handles, dbptr);
return DB::Open(db_options, dbname, column_families, &handles, dbptr);
}
Status DB::OpenWithColumnFamilies(
const DBOptions& db_options, const std::string& dbname,
const std::vector<ColumnFamilyDescriptor>& column_families,
std::vector<ColumnFamilyHandle>* handles, DB** dbptr) {
Status DB::Open(const DBOptions& db_options, const std::string& dbname,
const std::vector<ColumnFamilyDescriptor>& column_families,
std::vector<ColumnFamilyHandle>* handles, DB** dbptr) {
*dbptr = nullptr;
EnvOptions soptions;

View File

@ -104,10 +104,9 @@ class DB {
// If everything is OK, handles will on return be the same size
// as column_families --- handles[i] will be a handle that you
// will use to operate on column family column_family[i]
static Status OpenWithColumnFamilies(
const DBOptions& db_options, const std::string& name,
const std::vector<ColumnFamilyDescriptor>& column_families,
std::vector<ColumnFamilyHandle>* handles, DB** dbptr);
static Status Open(const DBOptions& db_options, const std::string& name,
const std::vector<ColumnFamilyDescriptor>& column_families,
std::vector<ColumnFamilyHandle>* handles, DB** dbptr);
// ListColumnFamilies will open the DB specified by argument name
// and return the list of all column families in that DB