`md_config_obs_t` is defined as
```
using md_config_obs_t = ceph::md_config_obs_impl<ConfigProxy>;
```
in `common/config_obs.h`. it takes advantage of a fact that
somebody exposes the correct version of `ConfigProxy` to the global
namespace. this is intended to fulfill the needs of other components
which expects `md_config_obs_t`. otherwise we need to specify
`ceph::md_config_obs_impl<ceph::ConfigProxy>` or
`ceph::md_config_obs_impl<crimson::common::ConfigProxy>` depending on
if we are programming crimson or not.
but in this case, we are actually defining
`crimson::common::ConfigProxy`, so it'd be better to define
`md_config_obs_t` explicitly instead relying on "somebody" which exposes
`ConfigProxy`. and `ConfigObserver` is defined using the current
`ConfigProxy`, so it's more correct and more readable than using
`md_config_obs_t` defined in `common/config_obs.h`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
ObserverMgr<ConfigObserver>::rev_obs_map rev_obs;
proxy.obs_mgr.for_each_change(proxy.values->changed, proxy,
- [&rev_obs](md_config_obs_t *obs,
- const std::string &key) {
- rev_obs[obs].insert(key);
- }, nullptr);
+ [&rev_obs](ConfigObserver *obs, const std::string& key) {
+ rev_obs[obs].insert(key);
+ }, nullptr);
for (auto& obs_keys : rev_obs) {
obs_keys.first->handle_conf_change(proxy, obs_keys.second);
}