From 4cd143de87f44a5be2436471cf03deeecafbad89 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 23 Jul 2015 10:28:42 -0400 Subject: [PATCH] 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 --- sstables/filter.cc | 2 ++ sstables/filter.hh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sstables/filter.cc b/sstables/filter.cc index 182d12490f..e750ffca20 100644 --- a/sstables/filter.cc +++ b/sstables/filter.cc @@ -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(); return make_ready_future<>(); diff --git a/sstables/filter.hh b/sstables/filter.hh index 8b6c952d4e..5f4db86f7e 100644 --- a/sstables/filter.hh +++ b/sstables/filter.hh @@ -36,6 +36,8 @@ class filter_tracker { public: filter_tracker(lw_shared_ptr>&& ptr) : _ptr(std::move(ptr)) {} + future<> stop() { return make_ready_future<>(); } + void add_false_positive() { false_positive++; }