From 4dc4e54e50b0134b03b9f2167ef5f8bb136f9c97 Mon Sep 17 00:00:00 2001 From: Asias He Date: Tue, 2 Jun 2015 09:33:00 +0800 Subject: [PATCH] storage_service: Add is_joined --- service/storage_service.cc | 5 ++--- service/storage_service.hh | 11 +++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index a323d7402a..1c585cdb0b 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -20,7 +20,7 @@ bool storage_service::should_bootstrap() { } future<> storage_service::prepare_to_join() { - if (!joined) { + if (!_joined) { std::map app_states; #if 0 if (DatabaseDescriptor.isReplacing() && !(Boolean.parseBoolean(System.getProperty("cassandra.join_ring", "true")))) @@ -89,9 +89,8 @@ future<> storage_service::prepare_to_join() { future<> storage_service::join_token_ring(int delay) { auto f = make_ready_future<>(); + _joined = true; #if 0 - joined = true; - // We bootstrap if we haven't successfully bootstrapped before, as long as we are not a seed. // If we are a seed, or if the user manually sets auto_bootstrap to false, // we'll skip streaming data from other nodes and jump directly into the ring. diff --git a/service/storage_service.hh b/service/storage_service.hh index 1e519ee694..159bbeed76 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -129,7 +129,7 @@ private: bool _initialized; - bool joined = false; + bool _joined = false; #if 0 /* the probability for tracing any particular request, 0 disables tracing and 1 enables for all */ @@ -584,12 +584,11 @@ private: Auth.setup(); } } - - public boolean isJoined() - { - return joined; +#endif + bool is_joined() { + return _joined; } - +#if 0 public void rebuild(String sourceDc) { logger.info("rebuild from dc: {}", sourceDc == null ? "(any dc)" : sourceDc);