mirror of https://github.com/apache/cassandra
jvm-dtest upgrade failures due to 3.x Ping not allowing serialize
patch by David Capwell; reviewed by Jon Meredith for CASSANDRA-17660
This commit is contained in:
parent
ffc4c89c3d
commit
fb8bf30c6d
|
|
@ -38,20 +38,28 @@ public class PingMessage
|
|||
{
|
||||
public static IVersionedSerializer<PingMessage> serializer = new PingMessageSerializer();
|
||||
|
||||
private final int connectionType;
|
||||
|
||||
public PingMessage(int connectionType)
|
||||
{
|
||||
this.connectionType = connectionType;
|
||||
}
|
||||
|
||||
public static class PingMessageSerializer implements IVersionedSerializer<PingMessage>
|
||||
{
|
||||
public void serialize(PingMessage t, DataOutputPlus out, int version)
|
||||
@Override
|
||||
public void serialize(PingMessage t, DataOutputPlus out, int version) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
out.writeByte(t.connectionType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PingMessage deserialize(DataInputPlus in, int version) throws IOException
|
||||
{
|
||||
// throw away the one byte of the payload
|
||||
in.readByte();
|
||||
return new PingMessage();
|
||||
return new PingMessage(in.readByte());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long serializedSize(PingMessage t, int version)
|
||||
{
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue