Search in sources :

Example 11 with RequestHeader

use of com.tencent.angel.ps.server.data.request.RequestHeader 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);
}
Also used : GetRowSplitRequest(com.tencent.angel.ps.server.data.request.GetRowSplitRequest) UpdateRequest(com.tencent.angel.ps.server.data.request.UpdateRequest) Request(com.tencent.angel.ps.server.data.request.Request) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest) GetRowsSplitRequest(com.tencent.angel.ps.server.data.request.GetRowsSplitRequest) IndexPartGetRowRequest(com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest) GetUDFRequest(com.tencent.angel.ps.server.data.request.GetUDFRequest) IndexPartGetRowsRequest(com.tencent.angel.ps.server.data.request.IndexPartGetRowsRequest) RequestHeader(com.tencent.angel.ps.server.data.request.RequestHeader) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest)

Example 12 with RequestHeader

use of com.tencent.angel.ps.server.data.request.RequestHeader 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);
}
Also used : IndexPartGetRowRequest(com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest) GetRowSplitRequest(com.tencent.angel.ps.server.data.request.GetRowSplitRequest) UpdateRequest(com.tencent.angel.ps.server.data.request.UpdateRequest) Request(com.tencent.angel.ps.server.data.request.Request) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest) GetRowsSplitRequest(com.tencent.angel.ps.server.data.request.GetRowsSplitRequest) IndexPartGetRowRequest(com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest) GetUDFRequest(com.tencent.angel.ps.server.data.request.GetUDFRequest) IndexPartGetRowsRequest(com.tencent.angel.ps.server.data.request.IndexPartGetRowsRequest) RequestHeader(com.tencent.angel.ps.server.data.request.RequestHeader)

Example 13 with RequestHeader

use of com.tencent.angel.ps.server.data.request.RequestHeader in project angel by Tencent.

the class MatrixTransportClient method createRequestHeader.

private RequestHeader createRequestHeader(int requestId, TransportMethod method, int matrixId, int partId) {
    RequestHeader header = new RequestHeader();
    header.setUserRequestId(requestId);
    header.setMethodId(method.getMethodId());
    header.setMethodId(matrixId);
    header.setPartId(partId);
    return header;
}
Also used : RequestHeader(com.tencent.angel.ps.server.data.request.RequestHeader)

Aggregations

RequestHeader (com.tencent.angel.ps.server.data.request.RequestHeader)13 GetUDFRequest (com.tencent.angel.ps.server.data.request.GetUDFRequest)9 Request (com.tencent.angel.ps.server.data.request.Request)9 UpdateUDFRequest (com.tencent.angel.ps.server.data.request.UpdateUDFRequest)9 GetRowSplitRequest (com.tencent.angel.ps.server.data.request.GetRowSplitRequest)7 GetRowsSplitRequest (com.tencent.angel.ps.server.data.request.GetRowsSplitRequest)7 IndexPartGetRowRequest (com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest)7 IndexPartGetRowsRequest (com.tencent.angel.ps.server.data.request.IndexPartGetRowsRequest)7 UpdateRequest (com.tencent.angel.ps.server.data.request.UpdateRequest)7 UserRequest (com.tencent.angel.psagent.matrix.transport.adapter.UserRequest)2 AngelException (com.tencent.angel.exception.AngelException)1 PartitionGetResult (com.tencent.angel.ml.matrix.psf.get.base.PartitionGetResult)1 VoidResult (com.tencent.angel.ml.matrix.psf.update.base.VoidResult)1 ByteBuf (io.netty.buffer.ByteBuf)1