.. with get_tracked_keys().
Following https://github.com/ceph/ceph/pull/61394,
all uses of the deprecated interface will be updated,
and that old interface will be removed.
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
#define dout_prefix *_dout << "mgr.server " << __func__ << " "
using namespace TOPNSPC::common;
+using namespace std::literals;
using std::list;
using std::ostream;
daemon_state.cull("mgr", have);
}
-const char** DaemonServer::get_tracked_conf_keys() const
+std::vector<std::string> DaemonServer::get_tracked_keys() const noexcept
{
- static const char *KEYS[] = {
- "mgr_stats_threshold",
- "mgr_stats_period",
- nullptr
+ return {
+ "mgr_stats_threshold"s,
+ "mgr_stats_period"s
};
-
- return KEYS;
}
void DaemonServer::handle_conf_change(const ConfigProxy& conf,
void reregister_mds_perf_queries();
int get_mds_perf_counters(MDSPerfCollector *collector);
- virtual const char** get_tracked_conf_keys() const override;
- virtual void handle_conf_change(const ConfigProxy& conf,
+ std::vector<std::string> get_tracked_keys() const noexcept override;
+ void handle_conf_change(const ConfigProxy& conf,
const std::set <std::string> &changed) override;
void schedule_tick(double delay_sec);
using std::map;
using std::string;
using std::vector;
+using namespace std::literals;
MgrStandby::MgrStandby(int argc, const char **argv) :
Dispatcher(g_ceph_context),
MgrStandby::~MgrStandby() = default;
-const char** MgrStandby::get_tracked_conf_keys() const
+std::vector<std::string> MgrStandby::get_tracked_keys() const noexcept
{
- static const char* KEYS[] = {
+ return {
// clog & admin clog
- "clog_to_monitors",
- "clog_to_syslog",
- "clog_to_syslog_facility",
- "clog_to_syslog_level",
- "clog_to_graylog",
- "clog_to_graylog_host",
- "clog_to_graylog_port",
- "mgr_standby_modules",
- "host",
- "fsid",
- NULL
+ "clog_to_monitors"s,
+ "clog_to_syslog"s,
+ "clog_to_syslog_facility"s,
+ "clog_to_syslog_level"s,
+ "clog_to_graylog"s,
+ "clog_to_graylog_host"s,
+ "clog_to_graylog_port"s,
+ "mgr_standby_modules"s,
+ "host"s,
+ "fsid"s
};
- return KEYS;
}
void MgrStandby::handle_conf_change(
public md_config_obs_t {
public:
// config observer bits
- const char** get_tracked_conf_keys() const override;
+ std::vector<std::string> get_tracked_keys() const noexcept override;
void handle_conf_change(const ConfigProxy& conf,
const std::set <std::string> &changed) override;
#define dout_subsys ceph_subsys_mon
using namespace TOPNSPC::common;
+using namespace std::literals;
using std::cerr;
using std::cout;
log_external_close_fds();
}
+std::vector<std::string> LogMonitor::get_tracked_keys() const noexcept
+{
+ return {
+ "mon_cluster_log_to_syslog"s,
+ "mon_cluster_log_to_syslog_facility"s,
+ "mon_cluster_log_file"s,
+ "mon_cluster_log_level"s,
+ "mon_cluster_log_to_graylog"s,
+ "mon_cluster_log_to_graylog_host"s,
+ "mon_cluster_log_to_graylog_port"s,
+ "mon_cluster_log_to_journald"s
+ };}
void LogMonitor::handle_conf_change(const ConfigProxy& conf,
const std::set<std::string> &changed)
g_conf().remove_observer(this);
}
- const char **get_tracked_conf_keys() const override {
- static const char* KEYS[] = {
- "mon_cluster_log_to_syslog",
- "mon_cluster_log_to_syslog_facility",
- "mon_cluster_log_file",
- "mon_cluster_log_level",
- "mon_cluster_log_to_graylog",
- "mon_cluster_log_to_graylog_host",
- "mon_cluster_log_to_graylog_port",
- "mon_cluster_log_to_journald",
- NULL
- };
- return KEYS;
- }
+ std::vector<std::string> get_tracked_keys() const noexcept override;
void handle_conf_change(const ConfigProxy& conf,
const std::set<std::string> &changed) override;
};
#undef dout_prefix
#define dout_prefix _prefix(_dout, this)
using namespace TOPNSPC::common;
+using namespace std::literals;
using std::cout;
using std::dec;
t->put(MONITOR_NAME, COMPAT_SET_LOC, bl);
}
-const char** Monitor::get_tracked_conf_keys() const
+std::vector<std::string> Monitor::get_tracked_keys() const noexcept
{
- static const char* KEYS[] = {
- "crushtool", // helpful for testing
- "mon_election_timeout",
- "mon_lease",
- "mon_lease_renew_interval_factor",
- "mon_lease_ack_timeout_factor",
- "mon_accept_timeout_factor",
+ return {
+ "crushtool"s, // helpful for testing
+ "mon_election_timeout"s,
+ "mon_lease"s,
+ "mon_lease_renew_interval_factor"s,
+ "mon_lease_ack_timeout_factor"s,
+ "mon_accept_timeout_factor"s,
// clog & admin clog
- "clog_to_monitors",
- "clog_to_syslog",
- "clog_to_syslog_facility",
- "clog_to_syslog_level",
- "clog_to_graylog",
- "clog_to_graylog_host",
- "clog_to_graylog_port",
- "mon_cluster_log_to_file",
- "host",
- "fsid",
+ "clog_to_monitors"s,
+ "clog_to_syslog"s,
+ "clog_to_syslog_facility"s,
+ "clog_to_syslog_level"s,
+ "clog_to_graylog"s,
+ "clog_to_graylog_host"s,
+ "clog_to_graylog_port"s,
+ "mon_cluster_log_to_file"s,
+ "host"s,
+ "fsid"s,
// periodic health to clog
- "mon_health_to_clog",
- "mon_health_to_clog_interval",
- "mon_health_to_clog_tick_interval",
+ "mon_health_to_clog"s,
+ "mon_health_to_clog_interval"s,
+ "mon_health_to_clog_tick_interval"s,
// scrub interval
- "mon_scrub_interval",
- "mon_allow_pool_delete",
+ "mon_scrub_interval"s,
+ "mon_allow_pool_delete"s,
// osdmap pruning - observed, not handled.
- "mon_osdmap_full_prune_enabled",
- "mon_osdmap_full_prune_min",
- "mon_osdmap_full_prune_interval",
- "mon_osdmap_full_prune_txsize",
+ "mon_osdmap_full_prune_enabled"s,
+ "mon_osdmap_full_prune_min"s,
+ "mon_osdmap_full_prune_interval"s,
+ "mon_osdmap_full_prune_txsize"s,
// debug options - observed, not handled
- "mon_debug_extra_checks",
- "mon_debug_block_osdmap_trim",
- NULL
+ "mon_debug_extra_checks"s,
+ "mon_debug_block_osdmap_trim"s
};
- return KEYS;
}
void Monitor::handle_conf_change(const ConfigProxy& conf,
static int check_features(MonitorDBStore *store);
// config observer
- const char** get_tracked_conf_keys() const override;
+ std::vector<std::string> get_tracked_keys() const noexcept override;
void handle_conf_change(const ConfigProxy& conf,
const std::set<std::string> &changed) override;
}
}
-const char **NVMeofGwMon::get_tracked_conf_keys() const
-{
- static const char* KEYS[] = {
- NULL
- };
- return KEYS;
-}
-
version_t NVMeofGwMon::get_trim_to() const
{
// we don't actually need *any* old states, but keep a few.
~NVMeofGwMon() override {}
// config observer
- const char** get_tracked_conf_keys() const override;
+ std::vector<std::string> get_tracked_keys() const noexcept override {
+ return {};
+ }
void handle_conf_change(
const ConfigProxy& conf, const std::set<std::string> &changed) override {};
using ceph::Formatter;
using ceph::JSONFormatter;
using ceph::make_message;
+using namespace std::literals;
#define dout_subsys ceph_subsys_mon
static const string OSD_PG_CREATING_PREFIX("osd_pg_creating");
}
}
-const char **OSDMonitor::get_tracked_conf_keys() const
+std::vector<std::string> OSDMonitor::get_tracked_keys() const noexcept
{
- static const char* KEYS[] = {
- "mon_memory_target",
- "mon_memory_autotune",
- "rocksdb_cache_size",
- NULL
+ return {
+ "mon_memory_target"s,
+ "mon_memory_autotune"s,
+ "rocksdb_cache_size"s
};
- return KEYS;
}
void OSDMonitor::handle_conf_change(const ConfigProxy& conf,
OSDMap osdmap;
// config observer
- const char** get_tracked_conf_keys() const override;
+ std::vector<std::string> get_tracked_keys() const noexcept override;
void handle_conf_change(const ConfigProxy& conf,
const std::set<std::string> &changed) override;
// [leader]