Source:
void handleResponse(ResponseInfo responseInfo, DeleteResponse deleteResponse) { DeleteRequest deleteRequest = (DeleteRequest) responseInfo.getRequestInfo().getRequest(); DeleteRequestInfo deleteRequestInfo = deleteRequestInfos.remove(deleteRequest.getCorrelationId()); if (deleteRequestInfo == null) { return; } ReplicaId replica = deleteRequestInfo.replica; long requestLatencyMs = time.milliseconds() - deleteRequestInfo.startTimeMs; routerMetrics.routerRequestLatencyMs.update(requestLatencyMs); routerMetrics.getDataNodeBasedMetrics(replica.getDataNodeId()).deleteRequestLatencyMs.update(requestLatencyMs); if (responseInfo.getError() != null) { logger.trace("DeleteRequest with correlationId timed out for replica ", deleteRequest.getCorrelationId(), replica.getDataNodeId()); updateOperationState(replica, RouterErrorCode.OperationTimedOut); } else { if (deleteResponse == null) { logger.trace( "DeleteRequest with correlationId received UnexpectedInternalError on response deserialization for replica ", deleteRequest.getCorrelationId(), replica.getDataNodeId()); updateOperationState(replica, RouterErrorCode.UnexpectedInternalError); } else { if (deleteResponse.getCorrelationId() != deleteRequest.getCorrelationId()) { logger.error("The correlation id in the DeleteResponse " + deleteResponse.getCorrelationId() + " is not the same as the correlation id in the associated DeleteRequest: " + deleteRequest.getCorrelationId()); routerMetrics.unknownReplicaResponseError.inc(); setOperationException( new RouterException("Received wrong response that is not for the corresponding request.", RouterErrorCode.UnexpectedInternalError)); updateOperationState(replica, RouterErrorCode.UnexpectedInternalError); } else { processServerError(replica, deleteResponse.getError(), deleteResponse.getCorrelationId()); } } } checkAndMaybeComplete(); }

Target:
void handleResponse(ResponseInfo responseInfo, DeleteResponse deleteResponse) { DeleteRequest deleteRequest = (DeleteRequest) responseInfo.getRequestInfo().getRequest(); DeleteRequestInfo deleteRequestInfo = deleteRequestInfos.remove(deleteRequest.getCorrelationId()); if (deleteRequestInfo == null) { return; } ReplicaId replica = deleteRequestInfo.replica; long requestLatencyMs = time.milliseconds() - deleteRequestInfo.startTimeMs; routerMetrics.routerRequestLatencyMs.update(requestLatencyMs); routerMetrics.getDataNodeBasedMetrics(replica.getDataNodeId()).deleteRequestLatencyMs.update(requestLatencyMs); if (responseInfo.getError() != null) { logger.trace("DeleteRequest with response correlationId timed out for replica ", deleteRequest.getCorrelationId(), replica.getDataNodeId()); updateOperationState(replica, RouterErrorCode.OperationTimedOut); } else { if (deleteResponse == null) { logger.trace( "DeleteRequest with response correlationId received UnexpectedInternalError on response deserialization for replica ", deleteRequest.getCorrelationId(), replica.getDataNodeId()); updateOperationState(replica, RouterErrorCode.UnexpectedInternalError); } else { if (deleteResponse.getCorrelationId() != deleteRequest.getCorrelationId()) { logger.error("The correlation id in the DeleteResponse " + deleteResponse.getCorrelationId() + " is not the same as the correlation id in the associated DeleteRequest: " + deleteRequest.getCorrelationId()); routerMetrics.unknownReplicaResponseError.inc(); setOperationException( new RouterException("Received wrong response that is not for the corresponding request.", RouterErrorCode.UnexpectedInternalError)); updateOperationState(replica, RouterErrorCode.UnexpectedInternalError); } else { processServerError(replica, deleteResponse.getError(), deleteResponse.getCorrelationId()); } } } checkAndMaybeComplete(); }