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:
David Capwell 2022-05-25 11:39:41 -07:00
parent ffc4c89c3d
commit fb8bf30c6d
1 changed files with 13 additions and 5 deletions

View File

@ -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;