diff --git a/mutation_query.cc b/mutation_query.cc index bb2e293c8d..e1bdf05b88 100644 --- a/mutation_query.cc +++ b/mutation_query.cc @@ -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(row_count); + _row_count_high_bits = static_cast(row_count >> 32); +} + auto fmt::formatter::format( const reconcilable_result::printer& pr, fmt::format_context& ctx) const -> decltype(ctx.out()) { diff --git a/mutation_query.hh b/mutation_query.hh index df77817a05..87ef2697dd 100644 --- a/mutation_query.hh +++ b/mutation_query.hh @@ -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;