Search in sources :

Example 16 with MessageOut

use of org.apache.cassandra.net.MessageOut in project cassandra by apache.

the class Gossiper method markAlive.

private void markAlive(final InetAddress addr, final EndpointState localState) {
    localState.markDead();
    MessageOut<EchoMessage> echoMessage = new MessageOut<EchoMessage>(MessagingService.Verb.ECHO, EchoMessage.instance, EchoMessage.serializer);
    logger.trace("Sending a EchoMessage to {}", addr);
    IAsyncCallback echoHandler = new IAsyncCallback() {

        public boolean isLatencyForSnitch() {
            return false;
        }

        public void response(MessageIn msg) {
            realMarkAlive(addr, localState);
        }
    };
    MessagingService.instance().sendRR(echoMessage, addr, echoHandler);
}
Also used : MessageIn(org.apache.cassandra.net.MessageIn) MessageOut(org.apache.cassandra.net.MessageOut) IAsyncCallback(org.apache.cassandra.net.IAsyncCallback)

Example 17 with MessageOut

use of org.apache.cassandra.net.MessageOut in project cassandra by apache.

the class RepairMessageVerbHandler method logErrorAndSendFailureResponse.

private void logErrorAndSendFailureResponse(String errorMessage, InetAddress to, int id) {
    logger.error(errorMessage);
    MessageOut reply = new MessageOut(MessagingService.Verb.INTERNAL_RESPONSE).withParameter(MessagingService.FAILURE_RESPONSE_PARAM, MessagingService.ONE_BYTE);
    MessagingService.instance().sendReply(reply, id, to);
}
Also used : MessageOut(org.apache.cassandra.net.MessageOut)

Aggregations

MessageOut (org.apache.cassandra.net.MessageOut)17 InetAddress (java.net.InetAddress)9 MessageIn (org.apache.cassandra.net.MessageIn)4 ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)3 Range (org.apache.cassandra.dht.Range)3 Token (org.apache.cassandra.dht.Token)3 RepairMessage (org.apache.cassandra.repair.messages.RepairMessage)3 CompactionsTest (org.apache.cassandra.db.compaction.CompactionsTest)2 ConfigurationException (org.apache.cassandra.exceptions.ConfigurationException)2 SSTableReader (org.apache.cassandra.io.sstable.format.SSTableReader)2 IAsyncCallback (org.apache.cassandra.net.IAsyncCallback)2 IMessageSink (org.apache.cassandra.net.IMessageSink)2 MerkleTrees (org.apache.cassandra.utils.MerkleTrees)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 UUID (java.util.UUID)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 CountDownLatch (java.util.concurrent.CountDownLatch)1