use of com.tencent.angel.ps.server.data.request.RequestHeader in project angel by Tencent.
the class MatrixTransportClient method get.
@Override
public FutureResult<PartitionGetResult> get(GetFunc func, PartitionGetParam param) {
// Request header
RequestHeader header = createRequestHeader(-1, TransportMethod.GET_PSF, param.getMatrixId(), param.getPartKey().getPartitionId());
// Request body
GetUDFRequest requestData = new GetUDFRequest(func.getClass().getName(), param);
// Request
Request request = new Request(header, requestData);
FutureResult<PartitionGetResult> resultFuture = new FutureResult<>();
requestToResultMap.put(request, resultFuture);
// Send the request
sendGetRequest(request);
return resultFuture;
}
use of com.tencent.angel.ps.server.data.request.RequestHeader in project angel by Tencent.
the class UserRequestAdapter method sendGetRowsRequest.
private void sendGetRowsRequest(MatrixTransportClient matrixClient, int userRequestId, int matrixId, int[] rowIds, int partId) {
// Request header
RequestHeader header = createRequestHeader(userRequestId, TransportMethod.GET_ROWSSPLIT, matrixId, partId);
// Request body
GetRowsSplitRequest requestData = new GetRowsSplitRequest(rowIds);
// Request
Request request = new Request(header, requestData);
// Send the request
matrixClient.sendGetRequest(request);
}
use of com.tencent.angel.ps.server.data.request.RequestHeader in project angel by Tencent.
the class UserRequestAdapter method sendGetRowRequest.
private void sendGetRowRequest(MatrixTransportClient matrixClient, int userRequestId, int matrixId, int rowId, int partId) {
// Request header
RequestHeader header = createRequestHeader(userRequestId, TransportMethod.GET_ROWSPLIT, matrixId, partId);
// Request body
GetRowSplitRequest requestData = new GetRowSplitRequest(rowId);
// Request
Request request = new Request(header, requestData);
// Send the request
matrixClient.sendGetRequest(request);
}
use of com.tencent.angel.ps.server.data.request.RequestHeader in project angel by Tencent.
the class MatrixTransportClient method update.
@Override
public FutureResult<VoidResult> update(UpdateFunc func, PartitionUpdateParam param) {
// Request header
RequestHeader header = createRequestHeader(-1, TransportMethod.UPDATE_PSF, param.getMatrixId(), param.getPartKey().getPartitionId());
// Request body
UpdateUDFRequest requestData = new UpdateUDFRequest(func.getClass().getName(), param);
// Request
Request request = new Request(header, requestData);
FutureResult<VoidResult> resultFuture = new FutureResult<>();
requestToResultMap.put(request, resultFuture);
// Send the request
sendUpdateRequest(request);
return resultFuture;
}
use of com.tencent.angel.ps.server.data.request.RequestHeader in project angel by Tencent.
the class UserRequestAdapter method sendUpdateRequest.
private void sendUpdateRequest(MatrixTransportClient matrixClient, int userRequestId, int matrixId, int partId, CompStreamKeyValuePart split, UpdateOp op) {
// Request header
RequestHeader header = createRequestHeader(userRequestId, TransportMethod.UPDATE, matrixId, partId);
// Request body
UpdateRequest requestData = new UpdateRequest(split, op);
// Request
Request request = new Request(header, requestData);
// Send the request
matrixClient.sendUpdateRequest(request);
}
Aggregations