use of com.tencent.angel.ps.server.data.request.GetUDFRequest in project angel by Tencent.
the class PSFGetHandler method handle.
@Override
public ResponseData handle(RequestHeader header, RequestData data) throws Exception {
GetUDFRequest request = (GetUDFRequest) data;
Class<? extends GetFunc> funcClass = (Class<? extends GetFunc>) Class.forName(request.getGetFuncClass());
Constructor<? extends GetFunc> constructor = funcClass.getConstructor();
constructor.setAccessible(true);
GetFunc func = constructor.newInstance();
// LOG.info("Get PSF func = " + func.getClass().getName());
func.setPsContext(context);
PartitionGetResult partResult = func.partitionGet(request.getPartParam());
return new GetUDFResponse(partResult);
}
use of com.tencent.angel.ps.server.data.request.GetUDFRequest in project angel by Tencent.
the class UserRequestAdapter method sendGetUDFRequest.
private void sendGetUDFRequest(MatrixTransportClient matrixClient, int userRequestId, int matrixId, int partId, GetFunc func, PartitionGetParam partGetParam) {
// Request header
RequestHeader header = createRequestHeader(userRequestId, TransportMethod.GET_PSF, matrixId, partId);
// Request body
GetUDFRequest requestData = new GetUDFRequest(func.getClass().getName(), partGetParam);
// Request
Request request = new Request(header, requestData);
// Send the request
matrixClient.sendGetRequest(request);
}
use of com.tencent.angel.ps.server.data.request.GetUDFRequest 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.GetUDFRequest in project angel by Tencent.
the class PSFGetHandler method parseRequest.
@Override
public RequestData parseRequest(ByteBuf in) {
GetUDFRequest request = new GetUDFRequest();
request.deserialize(in);
return request;
}
Aggregations