From db49ccccb05c2e6cdcf25a18469ead75b85e32cf Mon Sep 17 00:00:00 2001 From: Kamil Braun Date: Wed, 11 Oct 2023 15:09:11 +0200 Subject: [PATCH] view: remove unused `_backing_secondary_index` This boolean was only used for a sanity check which was replaced with a stronger sanity check in the previous commit that doesn't require the boolean. --- db/view/view.cc | 7 +++---- db/view/view.hh | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/db/view/view.cc b/db/view/view.cc index 3450b2e65d..96c49ae50e 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -577,7 +577,7 @@ private: const std::optional& _existing; public: - value_getter(const schema& base, const partition_key& base_key, const clustering_or_static_row& update, const std::optional& existing, bool backing_secondary_index) + value_getter(const schema& base, const partition_key& base_key, const clustering_or_static_row& update, const std::optional& existing) : _base(base) , _base_key(base_key) , _update(update) @@ -647,7 +647,7 @@ private: std::vector view_updates::get_view_rows(const partition_key& base_key, const clustering_or_static_row& update, const std::optional& existing) { - value_getter getter(*_base, base_key, update, existing, _backing_secondary_index); + value_getter getter(*_base, base_key, update, existing); auto get_value = boost::adaptors::transformed(std::ref(getter)); @@ -1452,8 +1452,7 @@ view_update_builder make_view_update_builder( " base schema version of the view ({}) for view {}.{} of {}.{}", base->version(), v.base->base_schema()->version(), v.view->ks_name(), v.view->cf_name(), base->ks_name(), base->cf_name())); } - bool is_index = base_table.get_index_manager().is_index(v.view); - return view_updates(std::move(v), is_index); + return view_updates(std::move(v)); })); return view_update_builder(std::move(db), base_table, base, std::move(vs), std::move(updates), std::move(existings), now); } diff --git a/db/view/view.hh b/db/view/view.hh index b8d578551f..84341c62db 100644 --- a/db/view/view.hh +++ b/db/view/view.hh @@ -210,15 +210,13 @@ class view_updates final { base_info_ptr _base_info; std::unordered_map _updates; mutable size_t _op_count = 0; - const bool _backing_secondary_index; public: - explicit view_updates(view_and_base vab, bool backing_secondary_index) + explicit view_updates(view_and_base vab) : _view(std::move(vab.view)) , _view_info(*_view->view_info()) , _base(vab.base->base_schema()) , _base_info(vab.base) , _updates(8, partition_key::hashing(*_view), partition_key::equality(*_view)) - , _backing_secondary_index(backing_secondary_index) { }