From 32d87837b133d0f3803875e0aa8f22e8de7a04e3 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Tue, 6 Jul 2021 10:57:53 +0200 Subject: [PATCH] db,view: move make_partition_slice helper function up No functional changes, it will be needed for a future patch. --- db/view/view.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/db/view/view.cc b/db/view/view.cc index eedc3be8ea..85a560bf0a 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -317,6 +317,20 @@ static bool is_partition_key_empty( } } +static query::partition_slice make_partition_slice(const schema& s) { + query::partition_slice::option_set opts; + opts.set(query::partition_slice::option::send_partition_key); + opts.set(query::partition_slice::option::send_clustering_key); + opts.set(query::partition_slice::option::send_timestamp); + opts.set(query::partition_slice::option::send_ttl); + return query::partition_slice( + {query::full_clustering_range}, + { }, + boost::copy_range(s.regular_columns() + | boost::adaptors::transformed(std::mem_fn(&column_definition::id))), + std::move(opts)); +} + bool matches_view_filter(const schema& base, const view_info& view, const partition_key& key, const clustering_row& update, gc_clock::time_point now) { return clustering_prefix_matches(base, view, key, update.key(), now) && boost::algorithm::all_of( @@ -1384,20 +1398,6 @@ future<> view_builder::stop() { }); } -static query::partition_slice make_partition_slice(const schema& s) { - query::partition_slice::option_set opts; - opts.set(query::partition_slice::option::send_partition_key); - opts.set(query::partition_slice::option::send_clustering_key); - opts.set(query::partition_slice::option::send_timestamp); - opts.set(query::partition_slice::option::send_ttl); - return query::partition_slice( - {query::full_clustering_range}, - { }, - boost::copy_range(s.regular_columns() - | boost::adaptors::transformed(std::mem_fn(&column_definition::id))), - std::move(opts)); -} - view_builder::build_step& view_builder::get_or_create_build_step(utils::UUID base_id) { auto it = _base_to_build_step.find(base_id); if (it == _base_to_build_step.end()) {