use of org.apache.cassandra.streaming.SessionSummary in project cassandra by apache.
the class SerializationsTest method testSyncCompleteWrite.
private void testSyncCompleteWrite() throws IOException {
InetAddressAndPort src = InetAddressAndPort.getByNameOverrideDefaults("127.0.0.2", PORT);
InetAddressAndPort dest = InetAddressAndPort.getByNameOverrideDefaults("127.0.0.3", PORT);
// sync success
List<SessionSummary> summaries = new ArrayList<>();
summaries.add(new SessionSummary(src, dest, Lists.newArrayList(new StreamSummary(TableId.fromUUID(UUIDGen.getTimeUUID()), 5, 100)), Lists.newArrayList(new StreamSummary(TableId.fromUUID(UUIDGen.getTimeUUID()), 500, 10))));
SyncResponse success = new SyncResponse(DESC, src, dest, true, summaries);
// sync fail
SyncResponse fail = new SyncResponse(DESC, src, dest, false, Collections.emptyList());
testRepairMessageWrite("service.SyncComplete.bin", SyncResponse.serializer, success, fail);
}
use of org.apache.cassandra.streaming.SessionSummary in project cassandra by apache.
the class RepairMessageSerializationsTest method syncCompleteMessage.
@Test
public void syncCompleteMessage() throws IOException {
InetAddressAndPort src = InetAddressAndPort.getByName("127.0.0.2");
InetAddressAndPort dst = InetAddressAndPort.getByName("127.0.0.3");
List<SessionSummary> summaries = new ArrayList<>();
summaries.add(new SessionSummary(src, dst, Lists.newArrayList(new StreamSummary(TableId.fromUUID(UUIDGen.getTimeUUID()), 5, 100)), Lists.newArrayList(new StreamSummary(TableId.fromUUID(UUIDGen.getTimeUUID()), 500, 10))));
SyncResponse msg = new SyncResponse(buildRepairJobDesc(), new SyncNodePair(src, dst), true, summaries);
serializeRoundTrip(msg, SyncResponse.serializer);
}
Aggregations