diff --git a/sstables/sstables.cc b/sstables/sstables.cc index 0a70531dfa..49fcc2fce8 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -1673,6 +1673,23 @@ future<> sstable::write_components( }); } +future<> sstable::write_components( + flat_mutation_reader_v2 mr, + uint64_t estimated_partitions, + schema_ptr schema, + const sstable_writer_config& cfg, + encoding_stats stats, + const io_priority_class& pc) { + assert_large_data_handler_is_running(); + return seastar::async([this, mr = std::move(mr), estimated_partitions, schema = std::move(schema), cfg, stats, &pc] () mutable { + auto close_mr = deferred_close(mr); + auto wr = get_writer(*schema, estimated_partitions, cfg, stats, pc); + mr.consume_in_thread(std::move(wr)); + }).finally([this] { + assert_large_data_handler_is_running(); + }); +} + future<> sstable::generate_summary(const io_priority_class& pc) { if (_components->summary) { co_return; diff --git a/sstables/sstables.hh b/sstables/sstables.hh index 696dadc629..9a4b9ab0ad 100644 --- a/sstables/sstables.hh +++ b/sstables/sstables.hh @@ -70,6 +70,7 @@ namespace fs = std::filesystem; extern logging::logger sstlog; class key; class sstable_writer; +class sstable_writer_v2; class sstables_manager; class metadata_collector; @@ -259,6 +260,13 @@ public: encoding_stats stats, const io_priority_class& pc = default_priority_class()); + future<> write_components(flat_mutation_reader_v2 mr, + uint64_t estimated_partitions, + schema_ptr schema, + const sstable_writer_config&, + encoding_stats stats, + const io_priority_class& pc = default_priority_class()); + sstable_writer get_writer(const schema& s, uint64_t estimated_partitions, const sstable_writer_config&,