Search in sources :

Example 6 with RequestHeader

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;
}
Also used : UserRequest(com.tencent.angel.psagent.matrix.transport.adapter.UserRequest) Request(com.tencent.angel.ps.server.data.request.Request) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest) GetUDFRequest(com.tencent.angel.ps.server.data.request.GetUDFRequest) RequestHeader(com.tencent.angel.ps.server.data.request.RequestHeader) GetUDFRequest(com.tencent.angel.ps.server.data.request.GetUDFRequest) PartitionGetResult(com.tencent.angel.ml.matrix.psf.get.base.PartitionGetResult)

Example 7 with RequestHeader

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);
}
Also used : GetRowsSplitRequest(com.tencent.angel.ps.server.data.request.GetRowsSplitRequest) 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 8 with RequestHeader

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);
}
Also used : GetRowSplitRequest(com.tencent.angel.ps.server.data.request.GetRowSplitRequest) 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 9 with RequestHeader

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;
}
Also used : VoidResult(com.tencent.angel.ml.matrix.psf.update.base.VoidResult) UserRequest(com.tencent.angel.psagent.matrix.transport.adapter.UserRequest) Request(com.tencent.angel.ps.server.data.request.Request) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest) GetUDFRequest(com.tencent.angel.ps.server.data.request.GetUDFRequest) RequestHeader(com.tencent.angel.ps.server.data.request.RequestHeader) UpdateUDFRequest(com.tencent.angel.ps.server.data.request.UpdateUDFRequest)

Example 10 with RequestHeader

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);
}
Also used : UpdateRequest(com.tencent.angel.ps.server.data.request.UpdateRequest) 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)

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