fragment_and_freeze: drop streamed_mutation overload

This commit is contained in:
Paweł Dziepak
2017-11-10 14:18:14 +00:00
parent 6f1e0d3ed8
commit e2481a89e1
3 changed files with 0 additions and 57 deletions

View File

@@ -38,7 +38,6 @@
#include "idl/uuid.dist.impl.hh"
#include "idl/keys.dist.impl.hh"
#include "idl/mutation.dist.impl.hh"
#include "mutation_reader.hh"
//
// Representation layout:
@@ -270,11 +269,3 @@ future<> fragment_and_freeze(flat_mutation_reader mr, frozen_mutation_consumer_f
});
});
}
future<> fragment_and_freeze(streamed_mutation sm, frozen_mutation_consumer_fn c, size_t fragment_size)
{
auto s = sm.schema();
auto mr = make_reader_returning(std::move(sm));
auto fmr = flat_mutation_reader_from_mutation_reader(std::move(s), std::move(mr), streamed_mutation::forwarding::no);
return fragment_and_freeze(std::move(fmr), std::move(c), fragment_size);
}

View File

@@ -108,8 +108,6 @@ future<frozen_mutation> freeze(streamed_mutation sm);
static constexpr size_t default_frozen_fragment_size = 128 * 1024;
using frozen_mutation_consumer_fn = std::function<future<stop_iteration>(frozen_mutation, bool)>;
future<> fragment_and_freeze(streamed_mutation sm, frozen_mutation_consumer_fn c,
size_t fragment_size = default_frozen_fragment_size);
future<> fragment_and_freeze(flat_mutation_reader mr, frozen_mutation_consumer_fn c,
size_t fragment_size = default_frozen_fragment_size);

View File

@@ -219,52 +219,6 @@ SEASTAR_TEST_CASE(test_freezing_streamed_mutations) {
});
}
SEASTAR_TEST_CASE(test_fragmenting_and_freezing_streamed_mutations) {
return seastar::async([] {
storage_service_for_tests ssft;
for_each_mutation([&] (const mutation& m) {
std::vector<frozen_mutation> fms;
fragment_and_freeze(streamed_mutation_from_mutation(mutation(m)), [&] (auto fm, bool frag) {
BOOST_REQUIRE(!frag);
fms.emplace_back(std::move(fm));
return make_ready_future<stop_iteration>(stop_iteration::no);
}, std::numeric_limits<size_t>::max()).get0();
BOOST_REQUIRE_EQUAL(fms.size(), 1);
auto m1 = fms.back().unfreeze(m.schema());
BOOST_REQUIRE_EQUAL(m, m1);
fms.clear();
stdx::optional<bool> fragmented;
fragment_and_freeze(streamed_mutation_from_mutation(mutation(m)), [&] (auto fm, bool frag) {
BOOST_REQUIRE(!fragmented || *fragmented == frag);
*fragmented = frag;
fms.emplace_back(std::move(fm));
return make_ready_future<stop_iteration>(stop_iteration::no);
}, 1).get0();
auto&& rows = m.partition().non_dummy_rows();
auto expected_fragments = std::distance(rows.begin(), rows.end())
+ m.partition().row_tombstones().size()
+ !m.partition().static_row().empty();
BOOST_REQUIRE_EQUAL(fms.size(), std::max(expected_fragments, size_t(1)));
BOOST_REQUIRE(expected_fragments < 2 || *fragmented);
auto m2 = fms.back().unfreeze(m.schema());
fms.pop_back();
while (!fms.empty()) {
m2.partition().apply(*m.schema(), fms.back().partition(), *m.schema());
fms.pop_back();
}
BOOST_REQUIRE_EQUAL(m, m2);
});
});
}
SEASTAR_TEST_CASE(test_range_tombstones_stream) {
return seastar::async([] {
auto s = schema_builder("ks", "cf")