.set_default(false)
.set_description("Enable use of rocksdb column families for bluestore metadata"),
+ Option("bluestore_rocksdb_cfs", Option::TYPE_STR, Option::LEVEL_DEV)
+ .set_default("M= P= L=")
+ .set_description("List of whitespace-separate key/value pairs where key is CF name and value is CF options"),
+
Option("bluestore_fsck_on_mount", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.set_description("Run fsck at mount"),
#include "include/compat.h"
#include "include/intarith.h"
#include "include/stringify.h"
+#include "include/str_map.h"
#include "common/errno.h"
#include "common/safe_io.h"
#include "Allocator.h"
const string PREFIX_ALLOC_BITMAP = "b"; // (see BitmapFreelistManager)
const string PREFIX_SHARED_BLOB = "X"; // u64 offset -> shared_blob_t
-const std::vector<KeyValueDB::ColumnFamily> cfs = {
- KeyValueDB::ColumnFamily(PREFIX_OMAP, ""),
- KeyValueDB::ColumnFamily(PREFIX_PGMETA_OMAP, ""),
- KeyValueDB::ColumnFamily(PREFIX_DEFERRED, ""),
-};
-
// write a label in the first block. always use this size. note that
// bluefs makes a matching assumption about the location of its
// superblock (always the second block of the device).
ceph::shared_ptr<Int64ArrayMergeOperator> merge_op(new Int64ArrayMergeOperator);
string kv_backend;
+ std::vector<KeyValueDB::ColumnFamily> cfs;
+
if (create) {
kv_backend = cct->_conf->bluestore_kvbackend;
} else {
db->set_cache_size(cache_size * cache_kv_ratio);
- if (kv_backend == "rocksdb")
+ if (kv_backend == "rocksdb") {
options = cct->_conf->bluestore_rocksdb_options;
+
+ map<string,string> cf_map;
+ get_str_map(cct->_conf->get_val<string>("bluestore_rocksdb_cfs"), &cf_map,
+ " \t");
+ for (auto& i : cf_map) {
+ dout(10) << "column family " << i.first << ": " << i.second << dendl;
+ cfs.push_back(KeyValueDB::ColumnFamily(i.first, i.second));
+ }
+ }
+
db->init(options);
if (create) {
if (cct->_conf->get_val<bool>("bluestore_rocksdb_cf")) {