Skip to content

Commit 408021d

Browse files
authored
Merge pull request ceph#62328 from ronen-fr/wip-rf-fin1-keys
common: md_config_obs_impl: remove deprecated get_tracked_conf_keys() Reviewed-by: Patrick Donnelly <[email protected]>
2 parents 44a1eb5 + 0727321 commit 408021d

File tree

3 files changed

+10
-29
lines changed

3 files changed

+10
-29
lines changed

src/common/config_cacher.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@
2020

2121
/**
2222
* A simple class to cache a single configuration value.
23-
* Points to note:
24-
* - as get_tracked_conf_keys() must return a pointer to a null-terminated
25-
* array of C-strings, 'keys' - an array - is used to hold the sole key
26-
* that this observer is interested in.
27-
* - the const cast should be removed once we change the
28-
* get_tracked_conf_keys() to return const char* const * (or something
29-
* similar).
23+
*
24+
* The md_config_cacher_t object registers itself to receive
25+
* notifications of changes to the specified single configuration
26+
* option. When the option changes, the new value is stored
27+
* in an atomic variable. The value can be accessed using
28+
* the dereference operator.
3029
*/
3130
template <typename ValueT>
3231
class md_config_cacher_t : public md_config_obs_t {

src/common/config_obs.h

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,16 @@ class md_config_obs_impl {
3333
public:
3434
virtual ~md_config_obs_impl() {}
3535

36-
/** @brief Get a table of strings specifying the configuration keys in which the object is interested.
37-
* This is called when the object is subscribed to configuration changes with add_observer().
38-
* The returned table should not be freed until the observer is removed with remove_observer().
39-
* Note that it is not possible to change the set of tracked keys without re-subscribing.
40-
*
41-
* DEPRECATED! Use get_tracked_keys() instead.
42-
*/
43-
virtual const char** get_tracked_conf_keys() const {
44-
return nullptr;
45-
}
46-
4736
/**
4837
* Returns a vector of strings specifying the configuration keys in which
49-
* the object is interested.
38+
* the object is interested. This is called when the object is subscribed to
39+
* configuration changes with add_observer().
40+
*
5041
* Note - the strings in the returned vector are 'moveable'. The caller
5142
* (ostensibly the observer manager) is expected to move them into its
5243
* map.
5344
*/
54-
virtual std::vector<std::string> get_tracked_keys() const noexcept {
55-
return {};
56-
}
45+
virtual std::vector<std::string> get_tracked_keys() const noexcept = 0;
5746

5847
/// React to a configuration change.
5948
virtual void handle_conf_change(const ConfigProxy& conf,

src/common/config_obs_mgr.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ void ObserverMgr<ConfigObs>::add_observer(ConfigObs* observer)
6565
for (auto&& k : observer->get_tracked_keys()) {
6666
observers.emplace(std::move(k), ptr);
6767
}
68-
69-
// legacy observer interface:
70-
if (const char** keys = observer->get_tracked_conf_keys(); keys) {
71-
for (const char** k = keys; *k; ++k) {
72-
observers.emplace(*k, ptr);
73-
}
74-
}
7568
}
7669

7770
template<class ConfigObs>

0 commit comments

Comments
 (0)