From: Ronen Friedman Date: Sun, 2 Mar 2025 12:53:05 +0000 (-0600) Subject: librados,msg: replace obsolete get_tracked_conf_keys() X-Git-Tag: v20.3.0~441^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea80b5fa6eb10adde37bdbd857ab935c51b1e43a;p=ceph.git librados,msg: replace obsolete get_tracked_conf_keys() .. 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 --- diff --git a/src/librados/RadosClient.cc b/src/librados/RadosClient.cc index 8557b92df75e..0fabbf058964 100644 --- a/src/librados/RadosClient.cc +++ b/src/librados/RadosClient.cc @@ -55,6 +55,7 @@ using std::ostringstream; using std::string; using std::map; using std::vector; +using namespace std::literals; namespace bc = boost::container; namespace bs = boost::system; @@ -1169,14 +1170,13 @@ int librados::RadosClient::get_inconsistent_pgs(int64_t pool_id, return 0; } -const char** librados::RadosClient::get_tracked_conf_keys() const +std::vector librados::RadosClient::get_tracked_keys() + const noexcept { - static const char *config_keys[] = { - "librados_thread_count", - "rados_mon_op_timeout", - nullptr + return { + "librados_thread_count"s, + "rados_mon_op_timeout"s }; - return config_keys; } void librados::RadosClient::handle_conf_change(const ConfigProxy& conf, diff --git a/src/librados/RadosClient.h b/src/librados/RadosClient.h index ecbb827bc891..6d95d6fd19b3 100644 --- a/src/librados/RadosClient.h +++ b/src/librados/RadosClient.h @@ -191,7 +191,7 @@ public: mon_feature_t get_required_monitor_features() const; int get_inconsistent_pgs(int64_t pool_id, std::vector* pgs); - const char** get_tracked_conf_keys() const override; + std::vector get_tracked_keys() const noexcept override; void handle_conf_change(const ConfigProxy& conf, const std::set &changed) override; }; diff --git a/src/msg/compressor_registry.cc b/src/msg/compressor_registry.cc index 80b155fbdf8e..47970305ae81 100644 --- a/src/msg/compressor_registry.cc +++ b/src/msg/compressor_registry.cc @@ -4,6 +4,8 @@ #include "compressor_registry.h" #include "common/dout.h" +using namespace std::literals; + #define dout_subsys ceph_subsys_ms #undef dout_prefix #define dout_prefix *_dout << "CompressorRegistry(" << this << ") " @@ -19,16 +21,14 @@ CompressorRegistry::~CompressorRegistry() cct->_conf.remove_observer(this); } -const char** CompressorRegistry::get_tracked_conf_keys() const +std::vector CompressorRegistry::get_tracked_keys() const noexcept { - static const char *keys[] = { - "ms_osd_compress_mode", - "ms_osd_compression_algorithm", - "ms_osd_compress_min_size", - "ms_compress_secure", - nullptr + return { + "ms_osd_compress_mode"s, + "ms_osd_compression_algorithm"s, + "ms_osd_compress_min_size"s, + "ms_compress_secure"s }; - return keys; } void CompressorRegistry::handle_conf_change( diff --git a/src/msg/compressor_registry.h b/src/msg/compressor_registry.h index d6b3f6867d8e..81bf6c34ad6f 100644 --- a/src/msg/compressor_registry.h +++ b/src/msg/compressor_registry.h @@ -21,7 +21,7 @@ public: _refresh_config(); } - const char** get_tracked_conf_keys() const override; + std::vector get_tracked_keys() const noexcept override; void handle_conf_change(const ConfigProxy& conf, const std::set& changed) override;