storage_service: Use get_gossip_status to get status

The help is introduced recently, use it. Avoid to open code it.
This commit is contained in:
Asias He
2016-02-25 14:32:00 +08:00
parent 8e2c924de3
commit 59564591d5
2 changed files with 3 additions and 8 deletions

View File

@@ -499,7 +499,7 @@ public:
bool is_silent_shutdown_state(const endpoint_state& ep_state) const;
void mark_as_shutdown(const inet_address& endpoint);
void force_newer_generation();
private:
public:
sstring get_gossip_status(const endpoint_state& ep_state) const;
sstring get_gossip_status(const inet_address& endpoint) const;
public:

View File

@@ -1145,15 +1145,10 @@ future<> storage_service::check_for_endpoint_collision() {
if (dht::range_streamer::use_strict_consistency()) {
found_bootstrapping_node = false;
for (auto& x : gossiper.get_endpoint_states()) {
auto status = x.second.get_application_state(application_state::STATUS);
if (!status) {
auto state = gossiper.get_gossip_status(x.second);
if (state.empty()) {
continue;
}
std::vector<sstring> pieces;
boost::split(pieces, status.value().value, boost::is_any_of(sstring(versioned_value::DELIMITER_STR)));
assert(pieces.size() > 0);
auto state = pieces[0];
logger.debug("Checking bootstrapping/leaving/moving nodes: node={}, status={} (check_for_endpoint_collision)", x.first, state);
if (state == sstring(versioned_value::STATUS_BOOTSTRAPPING) ||
state == sstring(versioned_value::STATUS_LEAVING) ||