use of com.yahoo.messagebus.jdisc.MbusResponse in project vespa by vespa-engine.
the class ResponseMerger method handleResponse.
@Override
public ContentChannel handleResponse(Response response) {
synchronized (this) {
if (response instanceof MbusResponse) {
Reply reply = ((MbusResponse) response).getReply();
requestTrace.addChild(reply.getTrace().getRoot());
replies.add(reply);
}
if (--numPending != 0) {
return null;
}
}
requestMsg.getTrace().getRoot().addChild(requestTrace);
Reply reply = DocumentProtocol.merge(replies);
Response mbusResponse = new MbusResponse(StatusCodes.fromMbusReply(reply), reply);
ResponseDispatch.newInstance(mbusResponse).dispatch(responseHandler);
return null;
}
use of com.yahoo.messagebus.jdisc.MbusResponse in project vespa by vespa-engine.
the class MbusRequestContext method processingFailed.
@Override
public void processingFailed(ErrorCode errorCode, String errorMsg) {
MbusResponse response = new MbusResponse(errorCode.getDiscStatus(), requestMsg.createReply());
response.getReply().addError(new com.yahoo.messagebus.Error(errorCode.getDocumentProtocolStatus(), errorMsg));
ResponseDispatch.newInstance(response).dispatch(this);
}
use of com.yahoo.messagebus.jdisc.MbusResponse in project vespa by vespa-engine.
the class MbusRequestContext method handleResponse.
@Override
public ContentChannel handleResponse(Response response) {
if (responded.getAndSet(true)) {
return null;
}
Reply reply = ((MbusResponse) response).getReply();
reply.swapState(requestMsg);
return responseHandler.handleResponse(response);
}
Aggregations