sstable_set: update make_local_shard_sstable_reader() to flat_mutation_reader_v2

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho
2021-12-03 10:20:22 -03:00
parent 6b664067dd
commit c3c070a5ca
5 changed files with 14 additions and 14 deletions

View File

@@ -894,7 +894,7 @@ public:
}
flat_mutation_reader make_sstable_reader() const override {
return _compacting->make_local_shard_sstable_reader(_schema,
return downgrade_to_v1(_compacting->make_local_shard_sstable_reader(_schema,
_permit,
query::full_partition_range,
_schema->full_slice(),
@@ -902,7 +902,7 @@ public:
tracing::trace_state_ptr(),
::streamed_mutation::forwarding::no,
::mutation_reader::forwarding::no,
default_read_monitor_generator());
default_read_monitor_generator()));
}
std::string_view report_start_desc() const override {
@@ -940,7 +940,7 @@ public:
}
flat_mutation_reader make_sstable_reader() const override {
return _compacting->make_local_shard_sstable_reader(_schema,
return downgrade_to_v1(_compacting->make_local_shard_sstable_reader(_schema,
_permit,
query::full_partition_range,
_schema->full_slice(),
@@ -948,7 +948,7 @@ public:
tracing::trace_state_ptr(),
::streamed_mutation::forwarding::no,
::mutation_reader::forwarding::no,
_monitor_generator);
_monitor_generator));
}
std::string_view report_start_desc() const override {

View File

@@ -1521,7 +1521,7 @@ future<> view_builder::initialize_reader_at_current_token(build_step& step) {
return step.reader.close().then([this, &step] {
step.pslice = make_partition_slice(*step.base->schema());
step.prange = dht::partition_range(dht::ring_position::starting_at(step.current_token()), dht::ring_position::max());
step.reader = step.base->get_sstable_set().make_local_shard_sstable_reader(
step.reader = downgrade_to_v1(step.base->get_sstable_set().make_local_shard_sstable_reader(
step.base->schema(),
_permit,
step.prange,
@@ -1529,7 +1529,7 @@ future<> view_builder::initialize_reader_at_current_token(build_step& step) {
default_priority_class(),
nullptr,
streamed_mutation::forwarding::no,
mutation_reader::forwarding::no);
mutation_reader::forwarding::no));
});
}

View File

@@ -34,7 +34,6 @@
#include "sstable_set_impl.hh"
#include "database.hh"
#include "flat_mutation_reader_v2.hh"
namespace sstables {
@@ -1110,7 +1109,7 @@ sstable_set::make_range_sstable_reader(
fwd_mr);
}
flat_mutation_reader
flat_mutation_reader_v2
sstable_set::make_local_shard_sstable_reader(
schema_ptr s,
reader_permit permit,
@@ -1129,15 +1128,15 @@ sstable_set::make_local_shard_sstable_reader(
};
if (auto sstables = _impl->all(); sstables->size() == 1) [[unlikely]] {
auto sst = *sstables->begin();
return downgrade_to_v1(reader_factory_fn(sst, pr));
return reader_factory_fn(sst, pr);
}
return make_combined_reader(s, std::move(permit), std::make_unique<incremental_reader_selector>(s,
return upgrade_to_v2(make_combined_reader(s, std::move(permit), std::make_unique<incremental_reader_selector>(s,
shared_from_this(),
pr,
std::move(trace_state),
std::move(reader_factory_fn)),
fwd,
fwd_mr);
fwd_mr));
}
flat_mutation_reader sstable_set::make_crawling_reader(

View File

@@ -22,6 +22,7 @@
#pragma once
#include "flat_mutation_reader.hh"
#include "flat_mutation_reader_v2.hh"
#include "sstables/progress_monitor.hh"
#include "shared_sstable.hh"
#include "dht/i_partitioner.hh"
@@ -134,7 +135,7 @@ public:
read_monitor_generator& rmg = default_read_monitor_generator()) const;
// Filters out mutations that don't belong to the current shard.
flat_mutation_reader make_local_shard_sstable_reader(
flat_mutation_reader_v2 make_local_shard_sstable_reader(
schema_ptr,
reader_permit,
const dht::partition_range&,

View File

@@ -84,8 +84,8 @@ table::make_sstable_reader(schema_ptr s,
return sstables->create_single_key_sstable_reader(const_cast<column_family*>(this), std::move(s), std::move(permit),
_stats.estimated_sstable_per_read, pr, slice, pc, std::move(trace_state), fwd, fwd_mr);
} else {
return sstables->make_local_shard_sstable_reader(std::move(s), std::move(permit), pr, slice, pc,
std::move(trace_state), fwd, fwd_mr);
return downgrade_to_v1(sstables->make_local_shard_sstable_reader(std::move(s), std::move(permit), pr, slice, pc,
std::move(trace_state), fwd, fwd_mr));
}
}