filter_tracker: define and call a stop method
All sharded services "should" define a stop method. Calling them is also a good practice. For this one specifically, though, we will not call stop. We miss a good way to add a Deleter to a shared_ptr class, and that would be the only reliable way to tie into its lifetime. Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
@@ -16,6 +16,8 @@ namespace sstables {
|
||||
future<> sstable::read_filter() {
|
||||
auto ft = _filter_tracker;
|
||||
return _filter_tracker->start(std::move(ft)).then([this] {
|
||||
// FIXME: should stop this service. This one is definitely wrong to stop at_exit.
|
||||
// We should use a Deleter class in lw_shared_ptr
|
||||
if (!has_component(sstable::component_type::Filter)) {
|
||||
_filter = std::make_unique<utils::filter::always_present_filter>();
|
||||
return make_ready_future<>();
|
||||
|
||||
@@ -36,6 +36,8 @@ class filter_tracker {
|
||||
public:
|
||||
filter_tracker(lw_shared_ptr<distributed<filter_tracker>>&& ptr) : _ptr(std::move(ptr)) {}
|
||||
|
||||
future<> stop() { return make_ready_future<>(); }
|
||||
|
||||
void add_false_positive() {
|
||||
false_positive++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user