]>
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
,
18 map
<string
,string
> options
,
22 if (type
== "leveldb") {
23 return new LevelDBStore(cct
, dir
);
27 if (type
== "kinetic" &&
28 cct
->check_experimental_feature_enabled("kinetic")) {
29 return new KineticStore(cct
);
32 #ifdef HAVE_LIBROCKSDB
33 if (type
== "rocksdb") {
34 return new RocksDBStore(cct
, dir
, options
, p
);
38 if ((type
== "memdb") &&
39 cct
->check_experimental_feature_enabled("memdb")) {
40 return new MemDB(cct
, dir
, p
);
45 int KeyValueDB::test_init(const string
& type
, const string
& dir
)
48 if (type
== "leveldb") {
49 return LevelDBStore::_test_init(dir
);
53 if (type
== "kinetic") {
54 return KineticStore::_test_init(g_ceph_context
);
57 #ifdef HAVE_LIBROCKSDB
58 if (type
== "rocksdb") {
59 return RocksDBStore::_test_init(dir
);
63 if (type
== "memdb") {
64 return MemDB::_test_init(dir
);