]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados,msg: replace obsolete get_tracked_conf_keys()
authorRonen Friedman <rfriedma@redhat.com>
Sun, 2 Mar 2025 12:53:05 +0000 (06:53 -0600)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 2 Mar 2025 14:39:45 +0000 (08:39 -0600)
.. 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>
src/librados/RadosClient.cc
src/librados/RadosClient.h
src/msg/compressor_registry.cc
src/msg/compressor_registry.h

index 8557b92df75e18623e0b8ba96146b4ef53570932..0fabbf0589646aeeadd61f427a7c206e97498550 100644 (file)
@@ -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<std::string> 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,
index ecbb827bc891efb11c608826e0f1bbefebdc09b4..6d95d6fd19b305ae2cc0a6ed8c3a0d3c1bd80fc9 100644 (file)
@@ -191,7 +191,7 @@ public:
   mon_feature_t get_required_monitor_features() const;
 
   int get_inconsistent_pgs(int64_t pool_id, std::vector<std::string>* pgs);
-  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;
 };
index 80b155fbdf8eddc1fb56aad9decd3847e9221b99..47970305ae81c22f68c4094dd560f2f5e983f9d9 100644 (file)
@@ -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<std::string> 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(
index d6b3f6867d8e01ee81c100cb656240595bb9e4d3..81bf6c34ad6f7a3534583514a1d3341bdb32ec01 100644 (file)
@@ -21,7 +21,7 @@ public:
     _refresh_config();
   }
 
-  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;