use of com.tencent.angel.ps.server.data.request.Request in project angel by Tencent.
the class UserRequestAdapter method sendUpdateUDFRequest.
private void sendUpdateUDFRequest(MatrixTransportClient matrixClient, int userRequestId, int matrixId, int partId, UpdateFunc updateFunc, PartitionUpdateParam partParam) {
// Request header
RequestHeader header = createRequestHeader(userRequestId, TransportMethod.UPDATE_PSF, matrixId, partId);
// Request body
UpdateUDFRequest requestData = new UpdateUDFRequest(updateFunc.getClass().getName(), partParam);
// Request
Request request = new Request(header, requestData);
// Send the request
matrixClient.sendUpdateRequest(request);
}
use of com.tencent.angel.ps.server.data.request.Request in project angel by Tencent.
the class UserRequestAdapter method sendIndexGetRowRequest.
private void sendIndexGetRowRequest(MatrixTransportClient matrixClient, int userRequestId, int matrixId, int rowId, int partId, KeyPart keyPart, InitFunc func) {
// Request header
RequestHeader header = createRequestHeader(userRequestId, TransportMethod.INDEX_GET_ROW, matrixId, partId);
// Request body
IndexPartGetRowRequest requestData = new IndexPartGetRowRequest(rowId, keyPart, func);
// Request
Request request = new Request(header, requestData);
// Send the request
matrixClient.sendGetRequest(request);
}
use of com.tencent.angel.ps.server.data.request.Request in project angel by Tencent.
the class MatrixTransportClient method requestFailed.
private void requestFailed(int seqId, ResponseType failedType, String errorLog) {
Request request = seqIdToRequestMap.remove(seqId);
if (request == null) {
return;
}
// Check need retry or not
if (isOverTryLimit(request, failedType, errorLog)) {
LOG.error("request " + request + " failed over " + maxTryNum + ", notify to caller");
FutureResult response = requestToResultMap.remove(request);
if (response != null) {
response.setExecuteError(errorLog);
} else {
LOG.warn("can not find response for request " + request);
}
// Clear the cache for this request
PSAgentContext.get().getUserRequestAdapter().clear(request.getUserRequestId());
return;
}
rpcContext.after(request.getContext().getServerId());
seqIdToSendCFMap.remove(seqId);
// LOG.debug("request failed " + request + ", failedType=" + failedType + ", errorLog=" + errorLog);
returnChannel(request);
returnBuffer(request);
resetContext(request);
switch(request.getType()) {
case GET_PART:
case GET_ROWSPLIT:
case GET_ROWSSPLIT:
case GET_PSF:
case INDEX_GET_ROW:
case INDEX_GET_ROWS:
getRequestFailed(request, failedType, errorLog);
break;
case PUT_PART:
case UPDATE:
case UPDATE_PSF:
case CHECKPOINT:
putRequestFailed(request, failedType, errorLog);
break;
default:
LOG.error("unvalid request " + request);
break;
}
}
Aggregations