tree: use emit_only_live_rows::no

emit_only_live_rows is a convenience so downstream consumers of the
mutation compactors don't have to check the `bool is_live` already
passed to them. This convenience however causes a template parameter and
additional logic for the compactor. As the most prominent of these
consumers (the query result builder) will soon have to switch to
emit_only_live_rows::no for other reasons anyway (it will want to count
tombstones), we take the opportunity to switch everybody to ::no. This
can be done with very little additional complexity to these consumer --
basically an additional if or two.
This prepares the ground for removing this template parameter and the
associate logic from the compactor.
This commit is contained in:
Botond Dénes
2022-06-30 08:57:20 +03:00
parent 742dc10185
commit bedc82e52c
5 changed files with 26 additions and 15 deletions

View File

@@ -380,7 +380,6 @@ static query::partition_slice make_partition_slice(const schema& s) {
class data_query_result_builder {
public:
using result_type = query::result;
static constexpr emit_only_live_rows only_live = emit_only_live_rows::yes;
private:
query::result::builder _res_builder;
@@ -1958,8 +1957,11 @@ public:
return stop_iteration::no;
}
stop_iteration consume(clustering_row&& cr, row_tombstone, bool) {
stop_iteration consume(clustering_row&& cr, row_tombstone, bool is_live) {
inject_failure("view_builder_consume_clustering_row");
if (!is_live) {
return stop_iteration::no;
}
if (_views_to_build.empty() || _builder._as.abort_requested()) {
return stop_iteration::yes;
}
@@ -2034,7 +2036,7 @@ public:
// Called in the context of a seastar::thread.
void view_builder::execute(build_step& step, exponential_backoff_retry r) {
gc_clock::time_point now = gc_clock::now();
auto consumer = compact_for_query_v2<emit_only_live_rows::yes, view_builder::consumer>(
auto consumer = compact_for_query_v2<emit_only_live_rows::no, view_builder::consumer>(
*step.reader.schema(),
now,
step.pslice,