database.hh: make_multishard_streaming_reader with range parameter

We add an overload of make_multishard_streaming_reader
which reads all the data in the given range. We will use it later
in row level repair if --smp is different on the
nodes and the number of partitions is small.
This commit is contained in:
Petr Gusev
2023-06-12 13:26:42 +04:00
parent 614a1b3770
commit f05ab33ee7
2 changed files with 18 additions and 0 deletions

View File

@@ -2916,6 +2916,21 @@ flat_mutation_reader_v2 make_multishard_streaming_reader(distributed<replica::da
std::move(range_generator), std::move(full_slice), {}, mutation_reader::forwarding::no);
}
flat_mutation_reader_v2 make_multishard_streaming_reader(distributed<replica::database>& db,
schema_ptr schema, reader_permit permit, const dht::partition_range& range)
{
const auto table_id = schema->id();
const auto& full_slice = schema->full_slice();
auto erm = db.local().find_column_family(schema).get_effective_replication_map();
return make_multishard_combining_reader_v2(
make_shared<replica::streaming_reader_lifecycle_policy>(db, table_id),
std::move(schema),
std::move(erm),
std::move(permit),
range,
full_slice);
}
std::ostream& operator<<(std::ostream& os, gc_clock::time_point tp) {
auto sec = std::chrono::duration_cast<std::chrono::seconds>(tp.time_since_epoch()).count();
std::ostream tmp(os.rdbuf());

View File

@@ -1767,4 +1767,7 @@ future<> start_large_data_handler(sharded<replica::database>& db);
flat_mutation_reader_v2 make_multishard_streaming_reader(distributed<replica::database>& db, schema_ptr schema, reader_permit permit,
std::function<std::optional<dht::partition_range>()> range_generator);
flat_mutation_reader_v2 make_multishard_streaming_reader(distributed<replica::database>& db,
schema_ptr schema, reader_permit permit, const dht::partition_range& range);
bool is_internal_keyspace(std::string_view name);