mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-01 20:46:56 +00:00
sstables: allow read_toc to be called more than once
We do that by bailing immediately if we detect that the components map is already populated. This allow us to call read_toc() earlier if we need to - for instance, to inquire about the existence of the Summary - without the need to re-read the components again later. Signed-off-by: Glauber Costa <glauber@scylladb.com>
This commit is contained in:
@@ -696,6 +696,10 @@ inline void write(file_writer& out, estimated_histogram& eh) {
|
||||
// This is small enough, and well-defined. Easier to just read it all
|
||||
// at once
|
||||
future<> sstable::read_toc() {
|
||||
if (_components.size()) {
|
||||
return make_ready_future<>();
|
||||
}
|
||||
|
||||
auto file_path = filename(sstable::component_type::TOC);
|
||||
|
||||
sstlog.debug("Reading TOC file {} ", file_path);
|
||||
|
||||
Reference in New Issue
Block a user