From c90e9c97f504de389870e99055312d5d9656d484 Mon Sep 17 00:00:00 2001 From: Asias He Date: Thu, 5 Nov 2015 17:22:34 +0800 Subject: [PATCH] token_metadata: Add add_moving_endpoint --- locator/token_metadata.cc | 4 ++++ locator/token_metadata.hh | 19 ++----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/locator/token_metadata.cc b/locator/token_metadata.cc index 7d1f9508c4..5561ee7f8a 100644 --- a/locator/token_metadata.cc +++ b/locator/token_metadata.cc @@ -483,6 +483,10 @@ token_metadata token_metadata::clone_after_all_settled() { return metadata; } +void token_metadata::add_moving_endpoint(token t, inet_address endpoint) { + _moving_endpoints[t] = endpoint; +} + /////////////////// class topology ///////////////////////////////////////////// inline void topology::clear() { _dc_endpoints.clear(); diff --git a/locator/token_metadata.hh b/locator/token_metadata.hh index 479c029ba7..382235fb12 100644 --- a/locator/token_metadata.hh +++ b/locator/token_metadata.hh @@ -473,29 +473,14 @@ public: void remove_bootstrap_tokens(std::unordered_set tokens); void add_leaving_endpoint(inet_address endpoint); +public: -#if 0 /** * Add a new moving endpoint * @param token token which is node moving to * @param endpoint address of the moving node */ - public void addMovingEndpoint(Token token, InetAddress endpoint) - { - assert endpoint != null; - - lock.writeLock().lock(); - - try - { - _moving_endpoints.add(Pair.create(token, endpoint)); - } - finally - { - lock.writeLock().unlock(); - } - } -#endif + void add_moving_endpoint(token t, inet_address endpoint); public: void remove_endpoint(inet_address endpoint);