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 <vladz@cloudius-systems.com>
This commit is contained in:
Vlad Zolotarov
2016-03-03 13:31:14 +02:00
parent 4a21d48cc5
commit 3a72ef87f2
2 changed files with 5 additions and 5 deletions

View File

@@ -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<gossip_digest> 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) {

View File

@@ -116,6 +116,7 @@ public:
public:
/* map where key is the endpoint and value is the state associated with the endpoint */
std::unordered_map<inet_address, endpoint_state> endpoint_state_map;
std::unordered_map<inet_address, endpoint_state> shadow_endpoint_state_map;
const std::vector<sstring> DEAD_STATES = {
versioned_value::REMOVING_TOKEN,
@@ -199,7 +200,6 @@ private:
clk::time_point _last_processed_message_at = now();
std::unordered_map<inet_address, endpoint_state> _shadow_endpoint_state_map;
std::map<inet_address, clk::time_point> _shadow_unreachable_endpoints;
std::set<inet_address> _shadow_live_endpoints;