]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: use KeyValueDB directly (not LevelDBStore!)
authorSage Weil <sage@redhat.com>
Mon, 19 Oct 2015 15:30:57 +0000 (11:30 -0400)
committerSage Weil <sage@redhat.com>
Mon, 19 Oct 2015 16:40:05 +0000 (12:40 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/ObjectMap/test_keyvaluedb_atomicity.cc
src/test/ObjectMap/test_keyvaluedb_iterators.cc
src/test/ObjectMap/test_object_map.cc
src/test/objectstore/test_idempotent.cc
src/tools/ceph_osdomap_tool.cc

index 04cef95d90ca5e946abc5d226eb651d329ab90f7..ac8b27a5e4fc32a94a993dcbae1e6a01d2a41562 100644 (file)
@@ -1,15 +1,19 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 #include <pthread.h>
 #include "include/buffer.h"
-#include "os/LevelDBStore.h"
+#include "os/KeyValueDB.h"
 #include <sys/types.h>
 #include <dirent.h>
 #include <string>
 #include <vector>
 #include "include/memory.h"
 #include <boost/scoped_ptr.hpp>
+#include <iostream>
 #include <sstream>
 #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);
 
index cbe2ab1fb47a9a31e4ac487ee5c0c7107e9ee3ea..32a038183ee4521fd1734118941309daf001a789 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "test/ObjectMap/KeyValueDBMemory.h"
 #include "os/KeyValueDB.h"
-#include "os/LevelDBStore.h"
 #include <sys/types.h>
 #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());
index 6ab3f82eb82cf81f79e6780d33ea95d298ea9e16..500ca32626f80675a787300a3a6ab90a1f90214e 100644 (file)
@@ -9,7 +9,6 @@
 #include "os/KeyValueDB.h"
 #include "os/DBObjectMap.h"
 #include "os/HashIndex.h"
-#include "os/LevelDBStore.h"
 #include <sys/types.h>
 #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));
index 098bc81c85f482b3b584d831c20e6957baf9d9bc..72b8e24dcc3e95cdf61813fe8a452c78514d53d0 100644 (file)
@@ -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<KeyValueDB> db(_db);
   boost::scoped_ptr<ObjectStore> store(new FileStore(store_path, store_dev));
index fb950faac90f6466f3285159a81574e6c71c5495..a22e9b876e59d03d5dab088aa225d55859756980 100644 (file)
@@ -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);