void md_config_t::apply_changes(std::ostringstream *oss)
{
Mutex::Locker l(lock);
+ _apply_changes(oss);
+}
+
+void md_config_t::_apply_changes(std::ostringstream *oss)
+{
/* Maps observers to the configuration options that they care about which
* have changed. */
typedef std::map < md_config_obs_t*, std::set <std::string> > rev_obs_map_t;
for (changed_set_t::const_iterator c = changed.begin();
c != changed.end(); ++c) {
const std::string &key(*c);
- if ((oss) && (!get_val(key.c_str(), &bufptr, sizeof(buf)))) {
+ if ((oss) && (!_get_val(key.c_str(), &bufptr, sizeof(buf)))) {
(*oss) << "applying configuration change: " << key << " = '"
<< buf << "'\n";
}
*oss << "\n";
ret = -EINVAL;
}
- apply_changes(oss);
+ _apply_changes(oss);
return ret;
}
int md_config_t::get_val(const char *key, char **buf, int len) const
{
Mutex::Locker l(lock);
+ return _get_val(key, buf,len);
+}
+
+int md_config_t::_get_val(const char *key, char **buf, int len) const
+{
+ assert(lock.is_locked());
+
if (!key)
return -EINVAL;
// Expand all metavariables. Make any pending observer callbacks.
void apply_changes(std::ostringstream *oss);
+ void _apply_changes(std::ostringstream *oss);
void call_all_observers();
// Called by the Ceph daemons to make configuration changes at runtime
// Get a configuration value.
// No metavariables will be returned (they will have already been expanded)
int get_val(const char *key, char **buf, int len) const;
+ int _get_val(const char *key, char **buf, int len) const;
// Return a list of all the sections that the current entity is a member of.
void get_my_sections(std::vector <std::string> §ions) const;
virtual ~md_config_obs_t();
virtual const char** get_tracked_conf_keys() const = 0;
virtual void handle_conf_change(const struct md_config_t *conf,
- const std::set <std::string> &changed) = 0;
+ const std::set <std::string> &changed) = 0;
};
#endif