sstables: add sstable_run::run_identifier()

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho
2023-09-15 13:31:02 -03:00
parent 8235889b8a
commit 4b193c04dd
2 changed files with 6 additions and 0 deletions

View File

@@ -97,6 +97,10 @@ double sstable_run::estimate_droppable_tombstone_ratio(gc_clock::time_point gc_b
return _all.size() ? estimate_sum / _all.size() : double(0);
}
sstables::run_id sstable_run::run_identifier() const {
return (_all.empty()) ? run_id() : (*_all.begin())->run_identifier();
}
std::ostream& operator<<(std::ostream& os, const sstables::sstable_run& run) {
os << "Run = {\n";
if (run.all().empty()) {

View File

@@ -11,6 +11,7 @@
#include "readers/flat_mutation_reader_fwd.hh"
#include "readers/flat_mutation_reader_v2.hh"
#include "sstables/progress_monitor.hh"
#include "sstables/types_fwd.hh"
#include "shared_sstable.hh"
#include "dht/i_partitioner.hh"
#include <seastar/core/shared_ptr.hh>
@@ -50,6 +51,7 @@ public:
uint64_t data_size() const;
const sstable_set& all() const { return _all; }
double estimate_droppable_tombstone_ratio(gc_clock::time_point gc_before) const;
run_id run_identifier() const;
};
using shared_sstable_run = lw_shared_ptr<sstable_run>;