From 8d4db63a2d18991e963e71c39d7ec4df86a96434 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Fri, 7 Feb 2014 14:48:48 -0800 Subject: [PATCH] [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 --- db/column_family_test.cc | 3 +-- db/db_impl.cc | 10 ++++------ include/rocksdb/db.h | 7 +++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/db/column_family_test.cc b/db/column_family_test.cc index 539f70127..dbf8148d4 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -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() { diff --git a/db/db_impl.cc b/db/db_impl.cc index 379a63d96..afc425b59 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -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 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& column_families, - std::vector* handles, DB** dbptr) { +Status DB::Open(const DBOptions& db_options, const std::string& dbname, + const std::vector& column_families, + std::vector* handles, DB** dbptr) { *dbptr = nullptr; EnvOptions soptions; diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index 871cf015a..b963a66c0 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -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& column_families, - std::vector* handles, DB** dbptr); + static Status Open(const DBOptions& db_options, const std::string& name, + const std::vector& column_families, + std::vector* handles, DB** dbptr); // ListColumnFamilies will open the DB specified by argument name // and return the list of all column families in that DB