@Override public void sendResponse(Operation op, Object response) { if (!RESPONSE_RECEIVED.compareAndSet(this, FALSE, TRUE)) { throw new ResponseAlreadySentException("NormalResponse already responseReceived for callback: " + this + ", current-response: " + response); } if (response instanceof CallTimeoutResponse) { notifyCallTimeout(); } else if (response instanceof ErrorResponse || response instanceof Throwable) { notifyError(response); } else if (response instanceof NormalResponse) { NormalResponse normalResponse = (NormalResponse) response; notifyNormalResponse(normalResponse.getValue(), normalResponse.getBackupAcks()); } else { // there are no backups or the number of expected backups has returned; so signal the future that the result is ready complete(response); } }
void notifyCallTimeout(long callId, Address sender) { responsesTimeout.inc(); Invocation invocation = invocationRegistry.get(callId); if (invocation == null) { responsesMissing.inc(); if (nodeEngine.isRunning()) { logger.warning("No Invocation found for call timeout response with callId=" + callId + " sent from " + sender); } return; } invocation.notifyCallTimeout(); } }
void notifyCallTimeout(long callId, Address sender) { responsesTimeout.inc(); Invocation invocation = invocationRegistry.get(callId); if (invocation == null) { responsesMissing.inc(); if (nodeEngine.isRunning()) { logger.warning("No Invocation found for call timeout response with callId=" + callId + " sent from " + sender); } return; } invocation.notifyCallTimeout(); } }
@Override public void sendResponse(Operation op, Object response) { if (!RESPONSE_RECEIVED.compareAndSet(this, FALSE, TRUE)) { throw new ResponseAlreadySentException("NormalResponse already responseReceived for callback: " + this + ", current-response: " + response); } if (response instanceof CallTimeoutResponse) { notifyCallTimeout(); } else if (response instanceof ErrorResponse || response instanceof Throwable) { notifyError(response); } else if (response instanceof NormalResponse) { NormalResponse normalResponse = (NormalResponse) response; notifyNormalResponse(normalResponse.getValue(), normalResponse.getBackupAcks()); } else { // there are no backups or the number of expected backups has returned; so signal the future that the result is ready complete(response); } }