diff --git a/sstables/partition.cc b/sstables/partition.cc index e3ae511cc1..0c009bb636 100644 --- a/sstables/partition.cc +++ b/sstables/partition.cc @@ -1174,10 +1174,6 @@ public: } }; -mutation_reader sstable::read_rows(schema_ptr schema, const io_priority_class& pc, streamed_mutation::forwarding fwd) { - return mutation_reader_from_flat_mutation_reader(read_rows_flat(std::move(schema), pc, fwd)); -} - flat_mutation_reader sstable::read_rows_flat(schema_ptr schema, const io_priority_class& pc, streamed_mutation::forwarding fwd) { return make_flat_mutation_reader(shared_from_this(), std::move(schema), pc, no_resource_tracking(), fwd); } diff --git a/sstables/sstables.hh b/sstables/sstables.hh index d221138c7c..c9ece1c29e 100644 --- a/sstables/sstables.hh +++ b/sstables/sstables.hh @@ -356,7 +356,7 @@ public: return read_range_rows_flat(std::move(schema), range, full_slice); } - // read_rows() returns each of the rows in the sstable, in sequence, + // read_rows_flat() returns each of the rows in the sstable, in sequence, // converted to a "mutation" data structure. // This function is implemented efficiently - doing buffered, sequential // read of the data file (no need to access the index file). @@ -367,10 +367,6 @@ public: // The caller must ensure (e.g., using do_with()) that the context object, // as well as the sstable, remains alive as long as a read() is in // progress (i.e., returned a future which hasn't completed yet). - mutation_reader read_rows(schema_ptr schema, - const io_priority_class& pc = default_priority_class(), - streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no); - flat_mutation_reader read_rows_flat(schema_ptr schema, const io_priority_class& pc = default_priority_class(), streamed_mutation::forwarding fwd = streamed_mutation::forwarding::no); diff --git a/tests/perf/perf_sstable.hh b/tests/perf/perf_sstable.hh index 52f880571f..3b0cf7d687 100644 --- a/tests/perf/perf_sstable.hh +++ b/tests/perf/perf_sstable.hh @@ -153,14 +153,12 @@ public: } future read_sequential_partitions(int idx) { - return do_with(_sst[0]->read_rows(s), [this] (mutation_reader& r) { + return do_with(_sst[0]->read_rows_flat(s), [this] (flat_mutation_reader& r) { auto start = test_env::now(); auto total = make_lw_shared(0); auto done = make_lw_shared(false); return do_until([done] { return *done; }, [this, done, total, &r] { - return r().then([] (auto sm) { - return mutation_from_streamed_mutation(std::move(sm)); - }).then([this, done, total] (mutation_opt m) { + return read_mutation_from_flat_mutation_reader(s, r).then([this, done, total] (mutation_opt m) { if (!m) { *done = true; } else { diff --git a/tests/sstable_mutation_test.cc b/tests/sstable_mutation_test.cc index f66b95860f..07ed26a267 100644 --- a/tests/sstable_mutation_test.cc +++ b/tests/sstable_mutation_test.cc @@ -421,9 +421,8 @@ SEASTAR_TEST_CASE(test_sstable_can_write_and_read_range_tombstone) { sstables::sstable::format_types::big); write_memtable_to_sstable(*mt, sst).get(); sst->load().get(); - auto mr = sst->read_rows(s); - auto sm = mr().get0(); - auto mut = mutation_from_streamed_mutation(std::move(sm)).get0(); + auto mr = sst->read_rows_flat(s); + auto mut = read_mutation_from_flat_mutation_reader(s, mr).get0(); BOOST_REQUIRE(bool(mut)); auto& rts = mut->partition().row_tombstones(); BOOST_REQUIRE(rts.size() == 1); @@ -569,11 +568,9 @@ static future ka_sst(schema_ptr schema, sstring dir, unsigned long SEASTAR_TEST_CASE(tombstone_in_tombstone) { return ka_sst(tombstone_overlap_schema(), "tests/sstables/tombstone_overlap", 1).then([] (auto sstp) { auto s = tombstone_overlap_schema(); - return do_with(sstp->read_rows(s), [sstp, s] (auto& reader) { + return do_with(sstp->read_rows_flat(s), [sstp, s] (auto& reader) { return repeat([sstp, s, &reader] { - return reader().then([] (auto sm) { - return mutation_from_streamed_mutation(std::move(sm)); - }).then([s] (mutation_opt mut) { + return read_mutation_from_flat_mutation_reader(s, reader).then([s] (mutation_opt mut) { if (!mut) { return stop_iteration::yes; } @@ -634,11 +631,9 @@ SEASTAR_TEST_CASE(tombstone_in_tombstone) { SEASTAR_TEST_CASE(range_tombstone_reading) { return ka_sst(tombstone_overlap_schema(), "tests/sstables/tombstone_overlap", 4).then([] (auto sstp) { auto s = tombstone_overlap_schema(); - return do_with(sstp->read_rows(s), [sstp, s] (auto& reader) { + return do_with(sstp->read_rows_flat(s), [sstp, s] (auto& reader) { return repeat([sstp, s, &reader] { - return reader().then([] (auto sm) { - return mutation_from_streamed_mutation(std::move(sm)); - }).then([s] (mutation_opt mut) { + return read_mutation_from_flat_mutation_reader(s, reader).then([s] (mutation_opt mut) { if (!mut) { return stop_iteration::yes; } @@ -713,11 +708,9 @@ static schema_ptr tombstone_overlap_schema2() { SEASTAR_TEST_CASE(tombstone_in_tombstone2) { return ka_sst(tombstone_overlap_schema2(), "tests/sstables/tombstone_overlap", 3).then([] (auto sstp) { auto s = tombstone_overlap_schema2(); - return do_with(sstp->read_rows(s), [sstp, s] (auto& reader) { + return do_with(sstp->read_rows_flat(s), [sstp, s] (auto& reader) { return repeat([sstp, s, &reader] { - return reader().then([] (auto sm) { - return mutation_from_streamed_mutation(std::move(sm)); - }).then([s] (mutation_opt mut) { + return read_mutation_from_flat_mutation_reader(s, reader).then([s] (mutation_opt mut) { if (!mut) { return stop_iteration::yes; } @@ -797,9 +790,8 @@ SEASTAR_TEST_CASE(test_non_compound_table_row_is_not_marked_as_static) { sstables::sstable::format_types::big); write_memtable_to_sstable(*mt, sst).get(); sst->load().get(); - auto mr = sst->read_rows(s); - auto sm = mr().get0(); - auto mut = mutation_from_streamed_mutation(std::move(sm)).get0(); + auto mr = sst->read_rows_flat(s); + auto mut = read_mutation_from_flat_mutation_reader(s, mr).get0(); BOOST_REQUIRE(bool(mut)); }); }