int main(int argc, char **argv) {
po::options_description desc("Allowed options");
- string store_path, cmd, oid;
+ string store_path, cmd, oid, backend;
bool debug = false;
desc.add_options()
("help", "produce help message")
("oid", po::value<string>(&oid), "Restrict to this object id when dumping objects")
("command", po::value<string>(&cmd),
"command arg is one of [dump-raw-keys, dump-raw-key-vals, dump-objects, dump-objects-with-keys, check, dump-headers, repair], mandatory")
+ ("backend", po::value<string>(&backend),
+ "DB backend (default rocksdb)")
;
po::positional_options_description p;
p.add("command", 1);
return 1;
}
- KeyValueDB* store(KeyValueDB::create(g_ceph_context, "leveldb", store_path));
+ if (vm.count("backend") == 0) {
+ backend = "rocksdb";
+ }
+
+ KeyValueDB* store(KeyValueDB::create(g_ceph_context, backend, store_path));
+ if (store == NULL) {
+ std::cerr << "Invalid backend '" << backend << "' specified" << std::endl;
+ return 1;
+ }
/*if (vm.count("paranoid")) {
std::cerr << "Enabling paranoid checks" << std::endl;
store->options.paranoid_checks = true;