use of org.apache.cassandra.repair.NodePair in project cassandra by apache.
the class SerializationsTest method testSyncCompleteRead.
@Test
public void testSyncCompleteRead() throws IOException {
if (EXECUTE_WRITES)
testSyncCompleteWrite();
InetAddress src = InetAddress.getByAddress(new byte[] { 127, 0, 0, 2 });
InetAddress dest = InetAddress.getByAddress(new byte[] { 127, 0, 0, 3 });
NodePair nodes = new NodePair(src, dest);
try (DataInputStreamPlus in = getInput("service.SyncComplete.bin")) {
// success
RepairMessage message = RepairMessage.serializer.deserialize(in, getVersion());
assert message.messageType == RepairMessage.Type.SYNC_COMPLETE;
assert DESC.equals(message.desc);
assert nodes.equals(((SyncComplete) message).nodes);
assert ((SyncComplete) message).success;
// fail
message = RepairMessage.serializer.deserialize(in, getVersion());
assert message.messageType == RepairMessage.Type.SYNC_COMPLETE;
assert DESC.equals(message.desc);
assert nodes.equals(((SyncComplete) message).nodes);
assert !((SyncComplete) message).success;
// MessageOuts
for (int i = 0; i < 2; i++) assert MessageIn.read(in, getVersion(), -1) != null;
}
}
use of org.apache.cassandra.repair.NodePair in project cassandra by apache.
the class RepairMessageSerializationsTest method syncCompleteMessage.
@Test
public void syncCompleteMessage() throws IOException {
InetAddress src = InetAddress.getByName("127.0.0.2");
InetAddress dst = InetAddress.getByName("127.0.0.3");
SyncComplete msg = new SyncComplete(buildRepairJobDesc(), new NodePair(src, dst), true);
serializeRoundTrip(msg, SyncComplete.serializer);
}
Aggregations