diff --git a/cql3/statements/batch_statement.hh b/cql3/statements/batch_statement.hh index 3fd689d708..ed88180e42 100644 --- a/cql3/statements/batch_statement.hh +++ b/cql3/statements/batch_statement.hh @@ -97,7 +97,7 @@ private: // Cassandra returns a result set only if CAS succeeds. If // any statement in the batch has IF EXISTS, we must return // all columns of the table, including the primary key. - column_mask _columns_of_cas_result_set; + column_set _columns_of_cas_result_set; cql_stats& _stats; public: /** diff --git a/cql3/statements/cas_request.cc b/cql3/statements/cas_request.cc index 2bd071683e..8d99f11c40 100644 --- a/cql3/statements/cas_request.cc +++ b/cql3/statements/cas_request.cc @@ -82,7 +82,7 @@ std::optional cas_request::apply_updates(api::timestamp_type ts) const lw_shared_ptr cas_request::read_command() const { - column_mask columns_to_read; + column_set columns_to_read; std::vector ranges; for (const cas_row_update& op : _updates) { diff --git a/cql3/statements/modification_statement.cc b/cql3/statements/modification_statement.cc index 31061c8202..f629082e86 100644 --- a/cql3/statements/modification_statement.cc +++ b/cql3/statements/modification_statement.cc @@ -380,7 +380,7 @@ modification_statement::execute_with_condition(service::storage_proxy& proxy, se seastar::shared_ptr modification_statement::build_cas_result_set(seastar::shared_ptr metadata, - const column_mask& columns, + const column_set& columns, bool is_applied, const update_parameters::prefetch_data& rows) { @@ -393,7 +393,7 @@ modification_statement::build_cas_result_set(seastar::shared_ptr std::vector row; row.reserve(metadata->value_count()); row.emplace_back(boolean_type->decompose(is_applied)); - for (ordinal_column_id id = columns.find_first(); id != column_mask::npos; id = columns.find_next(id)) { + for (ordinal_column_id id = columns.find_first(); id != column_set::npos; id = columns.find_next(id)) { const auto it = cell_map.cells.find(id); if (it == cell_map.cells.end()) { row.emplace_back(bytes_opt{}); diff --git a/cql3/statements/modification_statement.hh b/cql3/statements/modification_statement.hh index d22a4f6478..a99ebc4e9e 100644 --- a/cql3/statements/modification_statement.hh +++ b/cql3/statements/modification_statement.hh @@ -90,14 +90,14 @@ private: // columns, to match Cassandra behaviour. // This bitset contains a mask of ordinal_id identifiers // of the required columns. - column_mask _columns_to_read; + column_set _columns_to_read; // A CAS statement returns a result set with the columns // used in condition expression. This is a mask of ordinal_id // identifiers of the required columns. Contains all columns // of a schema if we have IF EXISTS/IF NOT EXISTS. Does *not* // contain LIST columns prefetched to apply updates, unless // these columns are also used in conditions. - column_mask _columns_of_cas_result_set; + column_set _columns_of_cas_result_set; public: const schema_ptr s; const std::unique_ptr attrs; @@ -201,7 +201,7 @@ public: // CAS. static seastar::shared_ptr build_cas_result_set(seastar::shared_ptr metadata, - const column_mask& mask, bool is_applied, + const column_set& mask, bool is_applied, const update_parameters::prefetch_data& rows); public: virtual dht::partition_range_vector build_partition_keys(const query_options& options, const json_cache_opt& json_cache); @@ -223,11 +223,11 @@ public: bool requires_read() const { return _requires_read; } // Columns used in this statement conditions or operations. - const column_mask& columns_to_read() const { return _columns_to_read; } + const column_set& columns_to_read() const { return _columns_to_read; } // Columns of the statement result set (only CAS statement // returns a result set). - const column_mask& columns_of_cas_result_set() { return _columns_of_cas_result_set; } + const column_set& columns_of_cas_result_set() { return _columns_of_cas_result_set; } // Build a read_command instance to fetch the previous mutation from storage. The mutation is // fetched if we need to check LWT conditions or apply updates to non-frozen list elements. diff --git a/query-request.hh b/query-request.hh index 7f9c44d2a3..b8b50ff971 100644 --- a/query-request.hh +++ b/query-request.hh @@ -168,7 +168,7 @@ public: std::unique_ptr specific_ranges = nullptr, cql_serialization_format = cql_serialization_format::internal(), uint32_t partition_row_limit = max_rows); - partition_slice(clustering_row_ranges ranges, const schema& schema, const column_mask& mask, option_set options); + partition_slice(clustering_row_ranges ranges, const schema& schema, const column_set& mask, option_set options); partition_slice(const partition_slice&); partition_slice(partition_slice&&); ~partition_slice(); diff --git a/query.cc b/query.cc index 8464a008d4..2d22194d06 100644 --- a/query.cc +++ b/query.cc @@ -125,11 +125,11 @@ partition_slice::partition_slice(clustering_row_ranges row_ranges, , _partition_row_limit(partition_row_limit) {} -partition_slice::partition_slice(clustering_row_ranges ranges, const schema& s, const column_mask& mask, option_set options) +partition_slice::partition_slice(clustering_row_ranges ranges, const schema& s, const column_set& columns, option_set options) : partition_slice(ranges, query::column_id_vector{}, query::column_id_vector{}, options) { - regular_columns.reserve(mask.count()); - for (ordinal_column_id id = mask.find_first(); id != column_mask::npos; id = mask.find_next(id)) { + regular_columns.reserve(columns.count()); + for (ordinal_column_id id = columns.find_first(); id != column_set::npos; id = columns.find_next(id)) { const column_definition& def = s.column_at(id); if (def.is_static()) { static_columns.push_back(def.id); diff --git a/schema.cc b/schema.cc index b6b2d1db5d..e37f5f0631 100644 --- a/schema.cc +++ b/schema.cc @@ -37,13 +37,13 @@ constexpr int32_t schema::NAME_LENGTH; -void column_mask::union_with(const column_mask& with) { +void column_set::union_with(const column_set& with) { // boost::dynamic_bitset doesn't support logical // or of bitsets of different sizes, work this around. if (_mask.size() > with._mask.size()) { if (with._mask.size()) { - column_mask::bitset tmp = with._mask; + column_set::bitset tmp = with._mask; tmp.resize(_mask.size()); _mask |= tmp; } diff --git a/schema.hh b/schema.hh index 44b0a14e1f..de50e4aca2 100644 --- a/schema.hh +++ b/schema.hh @@ -58,7 +58,7 @@ std::ostream& operator<<(std::ostream& os, ordinal_column_id id); // identified by ordinal_id. // // @sa column_definition::ordinal_id. -class column_mask { +class column_set { public: using bitset = boost::dynamic_bitset; using size_type = bitset::size_type; @@ -94,7 +94,7 @@ public: return static_cast(_mask.find_next(static_cast(pos))); } // Logical or - void union_with(const column_mask& with); + void union_with(const column_set& with); private: bitset _mask; };