From ca3a52938d109e28dc7e1879b812860dbc72a572 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 15 Jul 2018 19:51:46 +0800 Subject: [PATCH] common/config: extract "changed" from md_config_impl<> to ConfigValues for the same reason why we moved ObserverMgr out of md_config_impl<>, "changed" cannot be shared among shards, we should move "changed" out of md_config_impl. we can put "changed" into ConfigValues or ConfigProxy, IMHO, it would be simpler if "changed" resides in ConfigValues: less fragmented this way. Signed-off-by: Kefu Chai --- src/common/config.cc | 3 ++- src/common/config.h | 8 -------- src/common/config_values.h | 5 ++++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/common/config.cc b/src/common/config.cc index 4cb5c8d5fb3..fb151dbbb96 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -1133,6 +1133,7 @@ void md_config_impl::finalize_reexpand_meta(ConfigValues& values, // meta expands could have modified anything. Copy it all out again. update_legacy_vals(values); _apply_changes(values, proxy, NULL); + values.changed.clear(); } } @@ -1445,7 +1446,7 @@ void md_config_impl::_refresh(ConfigValues& values, const Option& opt) values.set_logging(opt.subsys, actual_val.c_str()); } else { // normal option, advertise the change. - changed.insert(opt.name); + values.changed.insert(opt.name); } } diff --git a/src/common/config.h b/src/common/config.h index 747f0985957..d3f54e83838 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -90,13 +90,6 @@ public: /// true if we are a daemon (as per CephContext::code_env) const bool is_daemon; - /* Maps configuration options to the observer listening for them. */ - typedef std::multimap *> obs_map_t; - - /* Set of configuration options that have changed since the last - * apply_changes */ - typedef std::set < std::string > changed_set_t; - /* * Mapping from legacy config option names to class members */ @@ -357,7 +350,6 @@ private: string do_show_config_value; obs_map_t observers; - changed_set_t changed; vector