use of com.github.ambry.protocol.GetResponse in project ambry by linkedin.
the class GetBlobResultInternal method handleResponse.
/**
* Hands over the response to the associated GetOperation that issued the request.
* @param responseInfo the {@link ResponseInfo} containing the response.
*/
void handleResponse(ResponseInfo responseInfo) {
long startTime = time.milliseconds();
GetResponse getResponse = extractGetResponseAndNotifyResponseHandler(responseInfo);
RouterRequestInfo routerRequestInfo = (RouterRequestInfo) responseInfo.getRequestInfo();
GetRequest getRequest = (GetRequest) routerRequestInfo.getRequest();
GetOperation getOperation = correlationIdToGetOperation.remove(getRequest.getCorrelationId());
if (getOperations.contains(getOperation)) {
try {
getOperation.handleResponse(responseInfo, getResponse);
if (getOperation.isOperationComplete()) {
remove(getOperation);
}
} catch (Exception e) {
removeAndAbort(getOperation, new RouterException("Get handleResponse encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError));
}
routerMetrics.getManagerHandleResponseTimeMs.update(time.milliseconds() - startTime);
} else {
routerMetrics.ignoredResponseCount.inc();
}
}
Aggregations