sstables: add method to grab filter size

This is one of the statistics we need to export

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This commit is contained in:
Glauber Costa
2015-08-20 18:38:52 -05:00
parent 7f04c1bf9b
commit 2bfc2697c1
2 changed files with 8 additions and 0 deletions

View File

@@ -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;
});
}

View File

@@ -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<uint64_t> 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;