gossip: Pass const ref for versioned_value in on_change and before_change
This commit is contained in:
@@ -65,9 +65,9 @@ public:
|
||||
*/
|
||||
virtual void on_join(inet_address endpoint, endpoint_state ep_state) = 0;
|
||||
|
||||
virtual void before_change(inet_address endpoint, endpoint_state current_state, application_state new_statekey, versioned_value newvalue) = 0;
|
||||
virtual void before_change(inet_address endpoint, endpoint_state current_state, application_state new_statekey, const versioned_value& newvalue) = 0;
|
||||
|
||||
virtual void on_change(inet_address endpoint, application_state state, versioned_value value) = 0;
|
||||
virtual void on_change(inet_address endpoint, application_state state, const versioned_value& value) = 0;
|
||||
|
||||
virtual void on_alive(inet_address endpoint, endpoint_state state) = 0;
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
reconnectable_snitch_helper(sstring local_dc)
|
||||
: _local_dc(local_dc) {}
|
||||
|
||||
void before_change(gms::inet_address endpoint, gms::endpoint_state cs, gms::application_state new_state_key, gms::versioned_value new_value) override {
|
||||
void before_change(gms::inet_address endpoint, gms::endpoint_state cs, gms::application_state new_state_key, const gms::versioned_value& new_value) override {
|
||||
// do nothing.
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void on_change(gms::inet_address endpoint, gms::application_state state, gms::versioned_value value) override {
|
||||
void on_change(gms::inet_address endpoint, gms::application_state state, const gms::versioned_value& value) override {
|
||||
if (state == gms::application_state::INTERNAL_IP) {
|
||||
reconnect(endpoint, value);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
_gossiper.unregister_(shared_from_this());
|
||||
}
|
||||
|
||||
void on_change(gms::inet_address endpoint, gms::application_state state, gms::versioned_value value) {
|
||||
void on_change(gms::inet_address endpoint, gms::application_state state, const gms::versioned_value& value) {
|
||||
if (state == gms::application_state::LOAD) {
|
||||
_load_info[endpoint] = std::stod(value.value);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void before_change(gms::inet_address endpoint, gms::endpoint_state current_state, gms::application_state new_state_key, gms::versioned_value newValue) {}
|
||||
void before_change(gms::inet_address endpoint, gms::endpoint_state current_state, gms::application_state new_state_key, const gms::versioned_value& newValue) {}
|
||||
|
||||
void on_alive(gms::inet_address endpoint, gms::endpoint_state) override {}
|
||||
|
||||
|
||||
@@ -697,7 +697,7 @@ void storage_service::handle_state_removing(inet_address endpoint, std::vector<s
|
||||
|
||||
void storage_service::on_join(gms::inet_address endpoint, gms::endpoint_state ep_state) {
|
||||
logger.debug("endpoint={} on_join", endpoint);
|
||||
for (auto e : ep_state.get_application_state_map()) {
|
||||
for (const auto& e : ep_state.get_application_state_map()) {
|
||||
on_change(endpoint, e.first, e.second);
|
||||
}
|
||||
get_local_migration_manager().schedule_schema_pull(endpoint, ep_state).handle_exception([endpoint] (auto ep) {
|
||||
@@ -722,11 +722,11 @@ void storage_service::on_alive(gms::inet_address endpoint, gms::endpoint_state s
|
||||
}
|
||||
}
|
||||
|
||||
void storage_service::before_change(gms::inet_address endpoint, gms::endpoint_state current_state, gms::application_state new_state_key, gms::versioned_value new_value) {
|
||||
void storage_service::before_change(gms::inet_address endpoint, gms::endpoint_state current_state, gms::application_state new_state_key, const gms::versioned_value& new_value) {
|
||||
logger.debug("endpoint={} before_change: new app_state={}, new versioned_value={}", endpoint, new_state_key, new_value);
|
||||
}
|
||||
|
||||
void storage_service::on_change(inet_address endpoint, application_state state, versioned_value value) {
|
||||
void storage_service::on_change(inet_address endpoint, application_state state, const versioned_value& value) {
|
||||
logger.debug("endpoint={} on_change: app_state={}, versioned_value={}", endpoint, state, value);
|
||||
if (state == application_state::STATUS) {
|
||||
std::vector<sstring> pieces;
|
||||
|
||||
@@ -649,7 +649,7 @@ public:
|
||||
|
||||
public:
|
||||
virtual void on_join(gms::inet_address endpoint, gms::endpoint_state ep_state) override;
|
||||
virtual void before_change(gms::inet_address endpoint, gms::endpoint_state current_state, gms::application_state new_state_key, gms::versioned_value new_value) override;
|
||||
virtual void before_change(gms::inet_address endpoint, gms::endpoint_state current_state, gms::application_state new_state_key, const gms::versioned_value& new_value) override;
|
||||
/*
|
||||
* Handle the reception of a new particular ApplicationState for a particular endpoint. Note that the value of the
|
||||
* ApplicationState has not necessarily "changed" since the last known value, if we already received the same update
|
||||
@@ -682,7 +682,7 @@ public:
|
||||
* Note: Any time a node state changes from STATUS_NORMAL, it will not be visible to new nodes. So it follows that
|
||||
* you should never bootstrap a new node during a removenode, decommission or move.
|
||||
*/
|
||||
virtual void on_change(inet_address endpoint, application_state state, versioned_value value) override;
|
||||
virtual void on_change(inet_address endpoint, application_state state, const versioned_value& value) override;
|
||||
virtual void on_alive(gms::inet_address endpoint, gms::endpoint_state state) override;
|
||||
virtual void on_dead(gms::inet_address endpoint, gms::endpoint_state state) override;
|
||||
virtual void on_remove(gms::inet_address endpoint) override;
|
||||
|
||||
@@ -398,8 +398,8 @@ public:
|
||||
|
||||
public:
|
||||
virtual void on_join(inet_address endpoint, endpoint_state ep_state) override {}
|
||||
virtual void before_change(inet_address endpoint, endpoint_state current_state, application_state new_state_key, versioned_value new_value) override {}
|
||||
virtual void on_change(inet_address endpoint, application_state state, versioned_value value) override {}
|
||||
virtual void before_change(inet_address endpoint, endpoint_state current_state, application_state new_state_key, const versioned_value& new_value) override {}
|
||||
virtual void on_change(inet_address endpoint, application_state state, const versioned_value& value) override {}
|
||||
virtual void on_alive(inet_address endpoint, endpoint_state state) override {}
|
||||
virtual void on_dead(inet_address endpoint, endpoint_state state) override {}
|
||||
virtual void on_remove(inet_address endpoint) override { close_session(stream_session_state::FAILED); }
|
||||
|
||||
Reference in New Issue
Block a user