use of org.apache.cassandra.repair.messages.SyncResponse in project cassandra by apache.
the class ActiveRepairService method handleMessage.
public void handleMessage(Message<? extends RepairMessage> message) {
RepairMessage payload = message.payload;
RepairJobDesc desc = payload.desc;
RepairSession session = sessions.get(desc.sessionId);
if (session == null) {
if (payload instanceof ValidationResponse) {
// The trees may be off-heap, and will therefore need to be released.
ValidationResponse validation = (ValidationResponse) payload;
MerkleTrees trees = validation.trees;
// The response from a failed validation won't have any trees.
if (trees != null)
trees.release();
}
return;
}
switch(message.verb()) {
case VALIDATION_RSP:
ValidationResponse validation = (ValidationResponse) payload;
session.validationComplete(desc, message.from(), validation.trees);
break;
case SYNC_RSP:
// one of replica is synced.
SyncResponse sync = (SyncResponse) payload;
session.syncComplete(desc, sync.nodes, sync.success, sync.summaries);
break;
default:
break;
}
}
Aggregations