From: Sage Weil Date: Mon, 19 Oct 2015 15:30:57 +0000 (-0400) Subject: test: use KeyValueDB directly (not LevelDBStore!) X-Git-Tag: v10.0.1~116^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=79c43b90ec1d81d5553e5cdbc1c4e2c25d9afd32;p=ceph.git test: use KeyValueDB directly (not LevelDBStore!) Signed-off-by: Sage Weil --- diff --git a/src/test/ObjectMap/test_keyvaluedb_atomicity.cc b/src/test/ObjectMap/test_keyvaluedb_atomicity.cc index 04cef95d90ca..ac8b27a5e4fc 100644 --- a/src/test/ObjectMap/test_keyvaluedb_atomicity.cc +++ b/src/test/ObjectMap/test_keyvaluedb_atomicity.cc @@ -1,15 +1,19 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- #include #include "include/buffer.h" -#include "os/LevelDBStore.h" +#include "os/KeyValueDB.h" #include #include #include #include #include "include/memory.h" #include +#include #include #include "stdlib.h" +#include "global/global_context.h" + +using namespace std; const string CONTROL_PREFIX = "CONTROL"; const string PRIMARY_PREFIX = "PREFIX"; @@ -84,7 +88,7 @@ int main() { } string strpath(path); std::cerr << "Using path: " << strpath << std::endl; - LevelDBStore *store = new LevelDBStore(NULL, strpath); + KeyValueDB *store = KeyValueDB::create(g_ceph_context, "leveldb", strpath); assert(!store->create_and_open(std::cerr)); db.reset(store); diff --git a/src/test/ObjectMap/test_keyvaluedb_iterators.cc b/src/test/ObjectMap/test_keyvaluedb_iterators.cc index cbe2ab1fb47a..32a038183ee4 100644 --- a/src/test/ObjectMap/test_keyvaluedb_iterators.cc +++ b/src/test/ObjectMap/test_keyvaluedb_iterators.cc @@ -18,7 +18,6 @@ #include "test/ObjectMap/KeyValueDBMemory.h" #include "os/KeyValueDB.h" -#include "os/LevelDBStore.h" #include #include "global/global_init.h" #include "common/ceph_argparse.h" @@ -37,7 +36,7 @@ public: virtual void SetUp() { assert(!store_path.empty()); - LevelDBStore *db_ptr = new LevelDBStore(g_ceph_context, store_path); + KeyValueDB *db_ptr = KeyValueDB::create(g_ceph_context, "leveldb", store_path); assert(!db_ptr->create_and_open(std::cerr)); db.reset(db_ptr); mock.reset(new KeyValueDBMemory()); diff --git a/src/test/ObjectMap/test_object_map.cc b/src/test/ObjectMap/test_object_map.cc index 6ab3f82eb82c..500ca32626f8 100644 --- a/src/test/ObjectMap/test_object_map.cc +++ b/src/test/ObjectMap/test_object_map.cc @@ -9,7 +9,6 @@ #include "os/KeyValueDB.h" #include "os/DBObjectMap.h" #include "os/HashIndex.h" -#include "os/LevelDBStore.h" #include #include "global/global_init.h" #include "common/ceph_argparse.h" @@ -534,7 +533,7 @@ public: string strpath(path); cerr << "using path " << strpath << std::endl; - LevelDBStore *store = new LevelDBStore(g_ceph_context, strpath); + KeyValueDB *store = KeyValueDB::create(g_ceph_context, "leveldb", strpath); assert(!store->create_and_open(cerr)); db.reset(new DBObjectMap(store)); diff --git a/src/test/objectstore/test_idempotent.cc b/src/test/objectstore/test_idempotent.cc index 098bc81c85f4..72b8e24dcc3e 100644 --- a/src/test/objectstore/test_idempotent.cc +++ b/src/test/objectstore/test_idempotent.cc @@ -21,7 +21,6 @@ #include "common/debug.h" #include "test/common/ObjectContents.h" #include "FileStoreTracker.h" -#include "os/LevelDBStore.h" #include "os/KeyValueDB.h" #include "os/ObjectStore.h" @@ -63,7 +62,7 @@ int main(int argc, char **argv) { bool start_new = false; if (string(args[0]) == string("new")) start_new = true; - LevelDBStore *_db = new LevelDBStore(g_ceph_context, db_path); + KeyValueDB *_db = KeyValueDB::create(g_ceph_context, "leveldb", db_path); assert(!_db->create_and_open(std::cerr)); boost::scoped_ptr db(_db); boost::scoped_ptr store(new FileStore(store_path, store_dev)); diff --git a/src/tools/ceph_osdomap_tool.cc b/src/tools/ceph_osdomap_tool.cc index fb950faac90f..a22e9b876e59 100644 --- a/src/tools/ceph_osdomap_tool.cc +++ b/src/tools/ceph_osdomap_tool.cc @@ -20,7 +20,7 @@ #include "global/global_init.h" #include "os/DBObjectMap.h" -#include "os/LevelDBStore.h" +#include "os/KeyValueDB.h" namespace po = boost::program_options; using namespace std; @@ -86,11 +86,11 @@ int main(int argc, char **argv) { return 1; } - LevelDBStore* store(new LevelDBStore(g_ceph_context, store_path)); - if (vm.count("paranoid")) { + KeyValueDB* store(KeyValueDB::create(g_ceph_context, "leveldb", store_path)); + /*if (vm.count("paranoid")) { std::cerr << "Enabling paranoid checks" << std::endl; store->options.paranoid_checks = true; - } + }*/ DBObjectMap omap(store); stringstream out; int r = store->open(out);