From 2bfc2697c170e6f9e211e337c3a11df427139bf8 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 20 Aug 2015 18:38:52 -0500 Subject: [PATCH] sstables: add method to grab filter size This is one of the statistics we need to export Signed-off-by: Glauber Costa --- sstables/filter.cc | 4 ++++ sstables/sstables.hh | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sstables/filter.cc b/sstables/filter.cc index a773039675..37002d639d 100644 --- a/sstables/filter.cc +++ b/sstables/filter.cc @@ -32,7 +32,11 @@ future<> sstable::read_filter() { } } _filter = utils::filter::create_filter(filter.hashes, std::move(bs)); + }).then([this] { + return engine().file_size(this->filename(sstable::component_type::Filter)); }); + }).then([this] (auto size) { + _filter_file_size = size; }); } diff --git a/sstables/sstables.hh b/sstables/sstables.hh index ce368c9d29..1d6c4e64f4 100644 --- a/sstables/sstables.hh +++ b/sstables/sstables.hh @@ -233,6 +233,9 @@ public: uint64_t index_size() { return _index_file_size; } + uint64_t filter_size() { + return _filter_file_size; + } // Returns the total bytes of all components. future bytes_on_disk(); @@ -266,6 +269,7 @@ private: file _data_file; uint64_t _data_file_size; uint64_t _index_file_size; + uint64_t _filter_file_size = 0; uint64_t _bytes_on_disk = 0; sstring _ks;