kv_sync_thread(this),
kv_stop(false),
logger(NULL),
- checksummer(new Checksummer)
+ checksummer(new Checksummer),
+ csum_type(bluestore_blob_t::CSUM_CRC32C)
{
_init_logger();
}
delete checksummer;
}
+const char **BlueStore::get_tracked_conf_keys() const
+{
+ static const char* KEYS[] = {
+ "bluestore_csum",
+ "bluestore_csum_type",
+ NULL
+ };
+ return KEYS;
+}
+
+void BlueStore::handle_conf_change(const struct md_config_t *conf,
+ const std::set<std::string> &changed)
+{
+ if (changed.count("bluestore_csum_type") ||
+ changed.count("bluestore_csum")) {
+ csum_type = bluestore_blob_t::get_csum_string_type(
+ conf->bluestore_csum_type);
+ if (csum_type < 0 || !conf->bluestore_csum) {
+ csum_type = bluestore_blob_t::CSUM_NONE;
+ }
+ dout(10) << __func__ << " csum_type "
+ << bluestore_blob_t::get_csum_type_string(csum_type)
+ << dendl;
+ }
+}
+
void BlueStore::_init_logger()
{
PerfCountersBuilder b(g_ceph_context, "BlueStore",
l_bluestore_last
};
-class BlueStore : public ObjectStore {
+class BlueStore : public ObjectStore,
+ public md_config_obs_t {
// -----------------------------------------------------
// types
public:
+ // config observer
+ virtual const char** get_tracked_conf_keys() const override;
+ virtual void handle_conf_change(const struct md_config_t *conf,
+ const std::set<std::string> &changed) override;
+
class TransContext;
/// an in-memory extent-map, shared by a group of objects (w/ same hash value)
list<CollectionRef> removed_collections;
Checksummer *checksummer;
+ int csum_type;
// --------------------------------------------------------
// private methods