sstables: move mp_row_consumer_reader_k_l to kl/reader.cc

Its only user is in said file, so that is a better place for it.
This commit is contained in:
Botond Dénes
2022-04-27 14:50:52 +03:00
parent 4f77e74bd4
commit 4b222e7f37
3 changed files with 19 additions and 23 deletions

View File

@@ -23,6 +23,25 @@ static inline bytes_view pop_back(std::vector<bytes_view>& vec) {
return b;
}
class mp_row_consumer_reader_k_l : public mp_row_consumer_reader_base, public flat_mutation_reader::impl {
friend class sstables::kl::mp_row_consumer_k_l;
public:
mp_row_consumer_reader_k_l(schema_ptr s, reader_permit permit, shared_sstable sst)
: mp_row_consumer_reader_base(std::move(sst))
, impl(std::move(s), std::move(permit))
{}
void on_next_partition(dht::decorated_key key, tombstone tomb) {
_partition_finished = false;
_before_partition = false;
_end_of_stream = false;
_current_partition_key = std::move(key);
push_mutation_fragment(
mutation_fragment(*_schema, _permit, partition_start(*_current_partition_key, tomb)));
_sst->get_stats().on_partition_read();
}
};
// Important note: the row key, column name and column value, passed to the
// consume_* functions, are passed as a "bytes_view" object, which points to
// internal data held by the feeder. This internal data is only valid for the

View File

@@ -149,14 +149,4 @@ position_in_partition_view get_slice_upper_bound(const schema& s, const query::p
return position_in_partition_view::for_range_end(ranges.back());
}
void mp_row_consumer_reader_k_l::on_next_partition(dht::decorated_key key, tombstone tomb) {
_partition_finished = false;
_before_partition = false;
_end_of_stream = false;
_current_partition_key = std::move(key);
push_mutation_fragment(
mutation_fragment(*_schema, _permit, partition_start(*_current_partition_key, tomb)));
_sst->get_stats().on_partition_read();
}
} // namespace sstables

View File

@@ -22,8 +22,6 @@
#include "clustering_ranges_walker.hh"
#include "binary_search.hh"
#include "../dht/i_partitioner.hh"
#include "readers/flat_mutation_reader_v2.hh"
#include "readers/flat_mutation_reader.hh"
#include "sstables/mx/partition_reversing_data_source.hh"
namespace sstables {
@@ -66,17 +64,6 @@ public:
virtual void on_out_of_clustering_range() = 0;
};
class mp_row_consumer_reader_k_l : public mp_row_consumer_reader_base, public flat_mutation_reader::impl {
friend class sstables::kl::mp_row_consumer_k_l;
public:
mp_row_consumer_reader_k_l(schema_ptr s, reader_permit permit, shared_sstable sst)
: mp_row_consumer_reader_base(std::move(sst))
, impl(std::move(s), std::move(permit))
{}
void on_next_partition(dht::decorated_key, tombstone);
};
inline atomic_cell make_atomic_cell(const abstract_type& type,
api::timestamp_type timestamp,
fragmented_temporary_buffer::view value,