database: keyspace_metadata: pass const locator::token_metadata& around
No need to modify token_metadata on this path. Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
@@ -895,7 +895,7 @@ keyspace::set_replication_strategy(std::unique_ptr<locator::abstract_replication
|
||||
_replication_strategy = std::move(replication_strategy);
|
||||
}
|
||||
|
||||
void keyspace::update_from(locator::token_metadata& tm, ::lw_shared_ptr<keyspace_metadata> ksm) {
|
||||
void keyspace::update_from(const locator::token_metadata& tm, ::lw_shared_ptr<keyspace_metadata> ksm) {
|
||||
_metadata = std::move(ksm);
|
||||
create_replication_strategy(tm, _metadata->strategy_options());
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ keyspace_metadata::keyspace_metadata(std::string_view name,
|
||||
}
|
||||
}
|
||||
|
||||
void keyspace_metadata::validate(locator::token_metadata& tm) const {
|
||||
void keyspace_metadata::validate(const locator::token_metadata& tm) const {
|
||||
using namespace locator;
|
||||
abstract_replication_strategy::validate_replication_strategy(name(), strategy_name(), tm, strategy_options());
|
||||
}
|
||||
|
||||
@@ -1080,7 +1080,7 @@ public:
|
||||
std::map<sstring, sstring> options,
|
||||
bool durables_writes,
|
||||
std::vector<schema_ptr> cf_defs = std::vector<schema_ptr>{});
|
||||
void validate(locator::token_metadata& tm) const;
|
||||
void validate(const locator::token_metadata& tm) const;
|
||||
const sstring& name() const {
|
||||
return _name;
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ private:
|
||||
public:
|
||||
explicit keyspace(lw_shared_ptr<keyspace_metadata> metadata, config cfg);
|
||||
|
||||
void update_from(locator::token_metadata& tm, lw_shared_ptr<keyspace_metadata>);
|
||||
void update_from(const locator::token_metadata& tm, lw_shared_ptr<keyspace_metadata>);
|
||||
|
||||
/** Note: return by shared pointer value, since the meta data is
|
||||
* semi-volatile. I.e. we could do alter keyspace at any time, and
|
||||
|
||||
Reference in New Issue
Block a user