public void run() { if (FailureDetector.instance.isAlive(neighbor)) { AnticompactionRequest acr = new AnticompactionRequest(parentSession, successfulRanges); CassandraVersion peerVersion = SystemKeyspace.getReleaseVersion(neighbor); if (peerVersion != null && peerVersion.compareTo(VERSION_CHECKER) > 0) { MessagingService.instance().sendRR(acr.createMessage(), neighbor, new AnticompactionCallback(this), TimeUnit.DAYS.toMillis(1), true); } else { // immediately return after sending request MessagingService.instance().sendOneWay(acr.createMessage(), neighbor); maybeSetResult(neighbor); } } else { maybeSetException(new IOException(neighbor + " is down")); } }
public void run() { if (FailureDetector.instance.isAlive(neighbor)) { AnticompactionRequest acr = new AnticompactionRequest(parentSession, successfulRanges); CassandraVersion peerVersion = SystemKeyspace.getReleaseVersion(neighbor); if (peerVersion != null && peerVersion.compareTo(VERSION_CHECKER) > 0) { MessagingService.instance().sendRR(acr.createMessage(), neighbor, new AnticompactionCallback(this), TimeUnit.DAYS.toMillis(1), true); } else { // immediately return after sending request MessagingService.instance().sendOneWay(acr.createMessage(), neighbor); maybeSetResult(neighbor); } } else { maybeSetException(new IOException(neighbor + " is down")); } }
public void run() { if (FailureDetector.instance.isAlive(neighbor)) { AnticompactionRequest acr = new AnticompactionRequest(parentSession, successfulRanges); CassandraVersion peerVersion = SystemKeyspace.getReleaseVersion(neighbor); if (peerVersion != null && peerVersion.compareTo(VERSION_CHECKER) > 0) { MessagingService.instance().sendRR(acr.createMessage(), neighbor, new AnticompactionCallback(this), TimeUnit.DAYS.toMillis(1), true); } else { // immediately return after sending request MessagingService.instance().sendOneWay(acr.createMessage(), neighbor); maybeSetResult(neighbor); } } else { maybeSetException(new IOException(neighbor + " is down")); } }
public void run() { if (FailureDetector.instance.isAlive(neighbor)) { AnticompactionRequest acr = new AnticompactionRequest(parentSession); SemanticVersion peerVersion = SystemKeyspace.getReleaseVersion(neighbor); if (peerVersion != null && peerVersion.compareTo(VERSION_CHECKER) > 0) { if (doAnticompaction) { MessagingService.instance().sendRR(acr.createMessage(), neighbor, new AnticompactionCallback(this), TimeUnit.DAYS.toMillis(1), true); } else { // we need to clean up parent session MessagingService.instance().sendRR(new CleanupMessage(parentSession).createMessage(), neighbor, new AnticompactionCallback(this), TimeUnit.DAYS.toMillis(1), true); } } else { MessagingService.instance().sendOneWay(acr.createMessage(), neighbor); // immediately return after sending request set(neighbor); } } else { setException(new IOException(neighbor + " is down")); } }