repair: Change partition_key_and_mutation_fragments to use chunked_vector
With the change in "repair: Avoid too many fragments in a single repair_row_on_wire", the std::list<frozen_mutation_fragment> _mfs; in partition_key_and_mutation_fragments will not contain large number of fragments any more. Switch to use chunked_vector.
This commit is contained in:
@@ -22,7 +22,7 @@ class repair_hash {
|
||||
|
||||
struct partition_key_and_mutation_fragments {
|
||||
partition_key get_key();
|
||||
std::list<frozen_mutation_fragment> get_mutation_fragments();
|
||||
utils::chunked_vector<frozen_mutation_fragment> get_mutation_fragments();
|
||||
};
|
||||
|
||||
class repair_sync_boundary {
|
||||
|
||||
@@ -195,19 +195,19 @@ struct node_repair_meta_id {
|
||||
// Represent a partition_key and frozen_mutation_fragments within the partition_key.
|
||||
class partition_key_and_mutation_fragments {
|
||||
partition_key _key;
|
||||
std::list<frozen_mutation_fragment> _mfs;
|
||||
utils::chunked_vector<frozen_mutation_fragment> _mfs;
|
||||
public:
|
||||
partition_key_and_mutation_fragments()
|
||||
: _key(std::vector<bytes>() ) {
|
||||
}
|
||||
partition_key_and_mutation_fragments(partition_key key, std::list<frozen_mutation_fragment> mfs)
|
||||
partition_key_and_mutation_fragments(partition_key key, utils::chunked_vector<frozen_mutation_fragment> mfs)
|
||||
: _key(std::move(key))
|
||||
, _mfs(std::move(mfs)) {
|
||||
}
|
||||
const partition_key& get_key() const { return _key; }
|
||||
const std::list<frozen_mutation_fragment>& get_mutation_fragments() const { return _mfs; }
|
||||
const utils::chunked_vector<frozen_mutation_fragment>& get_mutation_fragments() const { return _mfs; }
|
||||
partition_key& get_key() { return _key; }
|
||||
std::list<frozen_mutation_fragment>& get_mutation_fragments() { return _mfs; }
|
||||
utils::chunked_vector<frozen_mutation_fragment>& get_mutation_fragments() { return _mfs; }
|
||||
void push_mutation_fragment(frozen_mutation_fragment mf) { _mfs.push_back(std::move(mf)); }
|
||||
future<> clear_gently() { return utils::clear_gently(_mfs); };
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <seastar/util/bool_class.hh>
|
||||
#include "utils/user_provided_param.hh"
|
||||
#include "locator/tablet_metadata_guard.hh"
|
||||
#include "utils/chunked_vector.hh"
|
||||
|
||||
using namespace seastar;
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "test/lib/sstable_utils.hh"
|
||||
#include "readers/mutation_fragment_v1_stream.hh"
|
||||
#include "schema/schema_registry.hh"
|
||||
#include "utils/chunked_vector.hh"
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(repair_test)
|
||||
|
||||
@@ -93,7 +94,7 @@ repair_rows_on_wire make_random_repair_rows_on_wire(random_mutation_generator& g
|
||||
m->apply(mut);
|
||||
auto reader = mutation_fragment_v1_stream(m2->make_mutation_reader(s, permit));
|
||||
auto close_reader = deferred_close(reader);
|
||||
std::list<frozen_mutation_fragment> mfs;
|
||||
utils::chunked_vector<frozen_mutation_fragment> mfs;
|
||||
reader.consume_pausable([s, &mfs](mutation_fragment mf) {
|
||||
if ((mf.is_partition_start() && !mf.as_partition_start().partition_tombstone()) || mf.is_end_of_partition()) {
|
||||
// Stream of mutations coming from the wire doesn't contain partition_end
|
||||
|
||||
Reference in New Issue
Block a user