column_computation.hh, schema.cc: compute_value interface refactor

The compute_value function of column_computation has had previously the
following signature:
    virtual bytes_opt compute_value(const schema& schema, const partition_key& key, const clustering_row& row) const override;

This is superfluous, since never in the history of Scylla, the last
parameter (row) was used in any implentation, and never did it happen
that it returned bytes_opt. The absurdity of this interface can be seen
especially when looking at call sites like following, where dummy empty
row was created:
```
    token_column.get_computation().compute_value(
            *_schema, pkv_linearized, clustering_row(clustering_key_prefix::make_empty()));
```
This commit is contained in:
Michał Radwański
2022-05-17 15:48:27 +02:00
committed by Nadav Har'El
parent 166afd46b5
commit 2babee2cdc
5 changed files with 16 additions and 27 deletions

View File

@@ -495,12 +495,9 @@ deletable_row& view_updates::get_view_row(const partition_key& base_key, const c
if (!service::get_local_storage_proxy().local_db().find_column_family(_base->id()).get_index_manager().is_index(*_view)) {
throw std::logic_error(format("Column {} doesn't exist in base and this view is not backing a secondary index", cdef.name_as_text()));
}
computed_value = legacy_token_column_computation().compute_value(*_base, base_key, update);
computed_value = legacy_token_column_computation().compute_value(*_base, base_key);
} else {
computed_value = cdef.get_computation().compute_value(*_base, base_key, update);
}
if (!computed_value) {
throw std::logic_error(format("No value computed for primary key column {}", cdef.name()));
computed_value = cdef.get_computation().compute_value(*_base, base_key);
}
return managed_bytes_view(linearized_values.emplace_back(*computed_value));
}