From 2f86feb581d35b1fa01704ac16172863cef0531f Mon Sep 17 00:00:00 2001 From: Asias He Date: Wed, 21 Oct 2015 08:51:20 +0800 Subject: [PATCH] storage_service: Move send_replication_notification to source file --- service/storage_service.cc | 23 +++++++++++++++++++++++ service/storage_service.hh | 25 +------------------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index b078bd4795..0ab51f8151 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -1889,4 +1889,27 @@ void storage_service::excise(std::unordered_set tokens, inet_address endp excise(tokens, endpoint); } +void storage_service::send_replication_notification(inet_address remote) { +#if 0 + // notify the remote token + MessageOut msg = new MessageOut(MessagingService.Verb.REPLICATION_FINISHED); + IFailureDetector failureDetector = FailureDetector.instance; + if (logger.isDebugEnabled()) + logger.debug("Notifying {} of replication completion\n", remote); + while (failureDetector.isAlive(remote)) + { + AsyncOneResponse iar = MessagingService.instance().sendRR(msg, remote); + try + { + iar.get(DatabaseDescriptor.getRpcTimeout(), TimeUnit.MILLISECONDS); + return; // done + } + catch(TimeoutException e) + { + // try again + } + } +#endif +} + } // namespace service diff --git a/service/storage_service.hh b/service/storage_service.hh index 3e07713c82..7af59f5a9d 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -814,30 +814,7 @@ private: * * @param remote node to send notification to */ - void send_replication_notification(inet_address remote) { -#if 0 - // notify the remote token - MessageOut msg = new MessageOut(MessagingService.Verb.REPLICATION_FINISHED); - IFailureDetector failureDetector = FailureDetector.instance; - if (logger.isDebugEnabled()) - logger.debug("Notifying {} of replication completion\n", remote); - while (failureDetector.isAlive(remote)) - { - AsyncOneResponse iar = MessagingService.instance().sendRR(msg, remote); - try - { - iar.get(DatabaseDescriptor.getRpcTimeout(), TimeUnit.MILLISECONDS); - return; // done - } - catch(TimeoutException e) - { - // try again - } - } -#endif - } - -private: + void send_replication_notification(inet_address remote); /** * Called when an endpoint is removed from the ring. This function checks * whether this node becomes responsible for new ranges as a