From 3a72ef87f24b54ec58b9e1206bf7ee74ebb9f36d Mon Sep 17 00:00:00 2001 From: Vlad Zolotarov Date: Thu, 3 Mar 2016 13:31:14 +0200 Subject: [PATCH] gossiper: make _shadow_endpoint_state_map public and rename We will need to access it from a storage_service class when replicate token_metadata. Rename _shadow_endpoint_state_map -> shadow_endpoint_state_map according to our coding convention. Signed-off-by: Vlad Zolotarov --- gms/gossiper.cc | 8 ++++---- gms/gossiper.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gms/gossiper.cc b/gms/gossiper.cc index 6fcda58972..43c6f88495 100644 --- a/gms/gossiper.cc +++ b/gms/gossiper.cc @@ -499,7 +499,7 @@ void gossiper::run() { // We don't care about heart_beat change on other CPUs - so ingnore this // specific change. // - _shadow_endpoint_state_map[br_addr].set_heart_beat_state(hbs); + shadow_endpoint_state_map[br_addr].set_heart_beat_state(hbs); logger.trace("My heartbeat is now {}", endpoint_state_map[br_addr].get_heart_beat_state().get_heart_beat_version()); std::vector g_digests; @@ -554,13 +554,13 @@ void gossiper::run() { // them across all other shards. // - Reschedule the gossiper only after execution on all nodes is done. // - bool endpoint_map_changed = (_shadow_endpoint_state_map != endpoint_state_map); + bool endpoint_map_changed = (shadow_endpoint_state_map != endpoint_state_map); bool live_endpoint_changed = (_live_endpoints != _shadow_live_endpoints); bool unreachable_endpoint_changed = (_unreachable_endpoints != _shadow_unreachable_endpoints); if (endpoint_map_changed || live_endpoint_changed || unreachable_endpoint_changed) { if (endpoint_map_changed) { - _shadow_endpoint_state_map = endpoint_state_map; + shadow_endpoint_state_map = endpoint_state_map; } if (live_endpoint_changed) { @@ -576,7 +576,7 @@ void gossiper::run() { // Don't copy gossiper(CPU0) maps into themselves! if (engine().cpu_id() != 0) { if (endpoint_map_changed) { - local_gossiper.endpoint_state_map = _shadow_endpoint_state_map; + local_gossiper.endpoint_state_map = shadow_endpoint_state_map; } if (live_endpoint_changed) { diff --git a/gms/gossiper.hh b/gms/gossiper.hh index b61280c689..dc078ebf4f 100644 --- a/gms/gossiper.hh +++ b/gms/gossiper.hh @@ -116,6 +116,7 @@ public: public: /* map where key is the endpoint and value is the state associated with the endpoint */ std::unordered_map endpoint_state_map; + std::unordered_map shadow_endpoint_state_map; const std::vector DEAD_STATES = { versioned_value::REMOVING_TOKEN, @@ -199,7 +200,6 @@ private: clk::time_point _last_processed_message_at = now(); - std::unordered_map _shadow_endpoint_state_map; std::map _shadow_unreachable_endpoints; std::set _shadow_live_endpoints;