use of com.hazelcast.spi.impl.operationservice.impl.responses.BackupAckResponse in project hazelcast by hazelcast.
the class InboundResponseHandler method handle.
@Override
public void handle(Packet packet) throws Exception {
Response response = serializationService.toObject(packet);
Address sender = packet.getConn().getEndPoint();
try {
if (response instanceof NormalResponse) {
NormalResponse normalResponse = (NormalResponse) response;
notifyNormalResponse(normalResponse.getCallId(), normalResponse.getValue(), normalResponse.getBackupAcks(), sender);
} else if (response instanceof BackupAckResponse) {
notifyBackupComplete(response.getCallId());
} else if (response instanceof CallTimeoutResponse) {
notifyCallTimeout(response.getCallId(), sender);
} else if (response instanceof ErrorResponse) {
ErrorResponse errorResponse = (ErrorResponse) response;
notifyErrorResponse(errorResponse.getCallId(), errorResponse.getCause(), sender);
} else {
logger.severe("Unrecognized response: " + response);
}
} catch (Throwable e) {
logger.severe("While processing response...", e);
}
}
use of com.hazelcast.spi.impl.operationservice.impl.responses.BackupAckResponse in project hazelcast by hazelcast.
the class Backup method afterRun.
@Override
public void afterRun() throws Exception {
if (!valid || !sync || getCallId() == 0 || originalCaller == null) {
return;
}
NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
long callId = getCallId();
OperationServiceImpl operationService = (OperationServiceImpl) nodeEngine.getOperationService();
if (nodeEngine.getThisAddress().equals(originalCaller)) {
operationService.getInboundResponseHandler().notifyBackupComplete(callId);
} else {
BackupAckResponse backupAckResponse = new BackupAckResponse(callId, backupOp.isUrgent());
operationService.getOutboundResponseHandler().send(backupAckResponse, originalCaller);
}
}
Aggregations