diff --git a/sstables/mx/writer.cc b/sstables/mx/writer.cc index 69141c7fec..4348e91808 100644 --- a/sstables/mx/writer.cc +++ b/sstables/mx/writer.cc @@ -816,6 +816,7 @@ public: stop_iteration consume(range_tombstone_change&& rtc) override; stop_iteration consume_end_of_partition() override; void consume_end_of_stream() override; + uint64_t data_file_position_for_tests() const override; }; writer::~writer() { @@ -1545,6 +1546,10 @@ void writer::consume_end_of_stream() { _sst.seal_sstable(_cfg.backup).get(); } +uint64_t writer::data_file_position_for_tests() const { + return _data_writer->offset(); +} + std::unique_ptr make_writer(sstable& sst, const schema& s, uint64_t estimated_partitions, diff --git a/sstables/sstable_writer.hh b/sstables/sstable_writer.hh index 9bc315962d..29f16682f3 100644 --- a/sstables/sstable_writer.hh +++ b/sstables/sstable_writer.hh @@ -44,6 +44,7 @@ public: stop_iteration consume_end_of_partition(); void consume_end_of_stream(); void set_repaired_at(int64_t repaired_at); + uint64_t data_file_position_for_tests() const; }; } // namespace sstables diff --git a/sstables/writer.cc b/sstables/writer.cc index a652c2559f..43677b357e 100644 --- a/sstables/writer.cc +++ b/sstables/writer.cc @@ -77,6 +77,10 @@ void sstable_writer::set_repaired_at(int64_t repaired_at) { _impl->set_repaired_at(repaired_at); } +uint64_t sstable_writer::data_file_position_for_tests() const { + return _impl->data_file_position_for_tests(); +} + sstable_writer::sstable_writer(sstable_writer&& o) = default; sstable_writer& sstable_writer::operator=(sstable_writer&& o) = default; sstable_writer::~sstable_writer() { diff --git a/sstables/writer_impl.hh b/sstables/writer_impl.hh index ab533be098..cf6e0468e2 100644 --- a/sstables/writer_impl.hh +++ b/sstables/writer_impl.hh @@ -52,6 +52,7 @@ struct sstable_writer::writer_impl { void set_repaired_at(uint64_t repaired_at) { _collector.set_repaired_at(repaired_at); } + virtual uint64_t data_file_position_for_tests() const = 0; }; }