// -*- 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";
}
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);
#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"
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());
#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"
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));
#include "common/debug.h"
#include "test/common/ObjectContents.h"
#include "FileStoreTracker.h"
-#include "os/LevelDBStore.h"
#include "os/KeyValueDB.h"
#include "os/ObjectStore.h"
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));
#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;
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);