mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
mutation_query: reconcilable_result: add merge_disjoint()
Merging two disjoint reconcilable_result instances.
This commit is contained in:
@@ -42,6 +42,15 @@ reconcilable_result::operator==(const reconcilable_result& other) const {
|
||||
return boost::equal(_partitions, other._partitions);
|
||||
}
|
||||
|
||||
void
|
||||
reconcilable_result::merge_disjoint(schema_ptr schema, const reconcilable_result& other) {
|
||||
std::copy(other._partitions.begin(), other._partitions.end(), std::back_inserter(_partitions));
|
||||
_short_read = _short_read || other._short_read;
|
||||
uint64_t row_count = this->row_count() + other.row_count();
|
||||
_row_count_low_bits = static_cast<uint32_t>(row_count);
|
||||
_row_count_high_bits = static_cast<uint32_t>(row_count >> 32);
|
||||
}
|
||||
|
||||
auto fmt::formatter<reconcilable_result::printer>::format(
|
||||
const reconcilable_result::printer& pr,
|
||||
fmt::format_context& ctx) const -> decltype(ctx.out()) {
|
||||
|
||||
@@ -108,6 +108,10 @@ public:
|
||||
|
||||
bool operator==(const reconcilable_result& other) const;
|
||||
|
||||
// other must be disjoint with this
|
||||
// does not merge or update memory trackers
|
||||
void merge_disjoint(schema_ptr schema, const reconcilable_result& other);
|
||||
|
||||
struct printer {
|
||||
const reconcilable_result& self;
|
||||
schema_ptr schema;
|
||||
|
||||
Reference in New Issue
Block a user