use of org.apache.cassandra.repair.messages.CleanupMessage in project cassandra by apache.
the class ActiveRepairService method cleanUp.
/**
* Send Verb.CLEANUP_MSG to the given endpoints. This results in removing parent session object from the
* endpoint's cache.
* This method does not throw an exception in case of a messaging failure.
*/
public void cleanUp(UUID parentRepairSession, Set<InetAddressAndPort> endpoints) {
for (InetAddressAndPort endpoint : endpoints) {
try {
if (FailureDetector.instance.isAlive(endpoint)) {
CleanupMessage message = new CleanupMessage(parentRepairSession);
Message<CleanupMessage> msg = Message.out(Verb.CLEANUP_MSG, message);
RequestCallback loggingCallback = new RequestCallback() {
@Override
public void onResponse(Message msg) {
logger.trace("Successfully cleaned up {} parent repair session on {}.", parentRepairSession, endpoint);
}
@Override
public void onFailure(InetAddressAndPort from, RequestFailureReason failureReason) {
logger.debug("Failed to clean up parent repair session {} on {}. The uncleaned sessions will " + "be removed on a node restart. This should not be a problem unless you see thousands " + "of messages like this.", parentRepairSession, endpoint);
}
};
MessagingService.instance().sendWithCallback(msg, endpoint, loggingCallback);
}
} catch (Exception exc) {
logger.warn("Failed to send a clean up message to {}", endpoint, exc);
}
}
}
Aggregations