]>
git.proxmox.com Git - ceph.git/blob - ceph/src/kv/KeyValueDB.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #include "KeyValueDB.h"
6 #include "LevelDBStore.h"
10 #include "RocksDBStore.h"
13 #include "KineticStore.h"
16 KeyValueDB
*KeyValueDB::create(CephContext
*cct
, const string
& type
,
21 if (type
== "leveldb") {
22 return new LevelDBStore(cct
, dir
);
26 if (type
== "kinetic" &&
27 cct
->check_experimental_feature_enabled("kinetic")) {
28 return new KineticStore(cct
);
31 #ifdef HAVE_LIBROCKSDB
32 if (type
== "rocksdb") {
33 return new RocksDBStore(cct
, dir
, p
);
37 if ((type
== "memdb") &&
38 cct
->check_experimental_feature_enabled("memdb")) {
39 return new MemDB(cct
, dir
, p
);
44 int KeyValueDB::test_init(const string
& type
, const string
& dir
)
47 if (type
== "leveldb") {
48 return LevelDBStore::_test_init(dir
);
52 if (type
== "kinetic") {
53 return KineticStore::_test_init(g_ceph_context
);
56 #ifdef HAVE_LIBROCKSDB
57 if (type
== "rocksdb") {
58 return RocksDBStore::_test_init(dir
);
62 if (type
== "memdb") {
63 return MemDB::_test_init(dir
);