Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TimeoutException when there is a firewall issue.
patch by Vijay; reviewed by jbellis for CASSANDRA-3533
- Loading branch information
Showing
6 changed files
with
86 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,29 @@ | |||
package org.apache.cassandra.gms; | |||
|
|||
import java.io.DataInput; | |||
import java.io.DataOutput; | |||
import java.io.IOException; | |||
|
|||
import org.apache.cassandra.io.IVersionedSerializer; | |||
|
|||
public class EchoMessage | |||
{ | |||
public static IVersionedSerializer<EchoMessage> serializer = new EchoMessageSerializer(); | |||
|
|||
public static class EchoMessageSerializer implements IVersionedSerializer<EchoMessage> | |||
{ | |||
public void serialize(EchoMessage t, DataOutput out, int version) throws IOException | |||
{ | |||
} | |||
|
|||
public EchoMessage deserialize(DataInput in, int version) throws IOException | |||
{ | |||
return new EchoMessage(); | |||
} | |||
|
|||
public long serializedSize(EchoMessage t, int version) | |||
{ | |||
return 0; | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/java/org/apache/cassandra/service/EchoVerbHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
package org.apache.cassandra.service; | |||
|
|||
import org.apache.cassandra.gms.EchoMessage; | |||
import org.apache.cassandra.net.IVerbHandler; | |||
import org.apache.cassandra.net.MessageIn; | |||
import org.apache.cassandra.net.MessageOut; | |||
import org.apache.cassandra.net.MessagingService; | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
|
|||
public class EchoVerbHandler implements IVerbHandler<EchoMessage> | |||
{ | |||
private static final Logger logger = LoggerFactory.getLogger(EchoVerbHandler.class); | |||
|
|||
public void doVerb(MessageIn<EchoMessage> message, int id) | |||
{ | |||
MessageOut<EchoMessage> echoMessage = new MessageOut<EchoMessage>(MessagingService.Verb.REQUEST_RESPONSE, new EchoMessage(), EchoMessage.serializer); | |||
logger.trace("Sending a EchoMessage reply {}", message.from); | |||
MessagingService.instance().sendReply(echoMessage, id, message.from); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters