sstables/sstable: expose v2 variant of write_components()

In parallel to the existing v1 one. In the next patches we start
migrating users to the v2 variant incrementally and finally remove the
v1 variant.
This commit is contained in:
Botond Dénes
2022-01-31 16:23:12 +02:00
parent 105bf8888a
commit fed5b73147
2 changed files with 25 additions and 0 deletions

View File

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

View File

@@ -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&,