From 4b222e7f374229139863a5d69fd1ab9afb707da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Wed, 27 Apr 2022 14:50:52 +0300 Subject: [PATCH] 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. --- sstables/kl/reader.cc | 19 +++++++++++++++++++ sstables/sstable_mutation_reader.cc | 10 ---------- sstables/sstable_mutation_reader.hh | 13 ------------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/sstables/kl/reader.cc b/sstables/kl/reader.cc index d1940a4e1c..cd693dfe8f 100644 --- a/sstables/kl/reader.cc +++ b/sstables/kl/reader.cc @@ -23,6 +23,25 @@ static inline bytes_view pop_back(std::vector& 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 diff --git a/sstables/sstable_mutation_reader.cc b/sstables/sstable_mutation_reader.cc index 6811ba64d6..1f15472446 100644 --- a/sstables/sstable_mutation_reader.cc +++ b/sstables/sstable_mutation_reader.cc @@ -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 diff --git a/sstables/sstable_mutation_reader.hh b/sstables/sstable_mutation_reader.hh index 626628437c..ae3196e0e3 100644 --- a/sstables/sstable_mutation_reader.hh +++ b/sstables/sstable_mutation_reader.hh @@ -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,