Search in sources :

Example 1 with GetRowsSplitRequest

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

the class GetRowsHandler method parseRequest.

@Override
public RequestData parseRequest(ByteBuf in) {
    GetRowsSplitRequest request = new GetRowsSplitRequest();
    request.deserialize(in);
    return request;
}
Also used : GetRowsSplitRequest(com.tencent.angel.ps.server.data.request.GetRowsSplitRequest)

Example 2 with GetRowsSplitRequest

use of com.tencent.angel.ps.server.data.request.GetRowsSplitRequest 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 3 with GetRowsSplitRequest

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

the class GetRowsHandler method handle.

@Override
public ResponseData handle(RequestHeader header, RequestData data) throws Exception {
    GetRowsSplitRequest request = (GetRowsSplitRequest) data;
    int[] rowIds = request.getRowIds();
    ServerRow[] rows = new ServerRow[rowIds.length];
    for (int i = 0; i < rowIds.length; i++) {
        rows[i] = MatrixUtils.getRow(context.getMatrixStorageManager(), header.matrixId, header.partId, rowIds[i]);
    }
    return new GetRowsSplitResponse(rows);
}
Also used : GetRowsSplitResponse(com.tencent.angel.ps.server.data.response.GetRowsSplitResponse) GetRowsSplitRequest(com.tencent.angel.ps.server.data.request.GetRowsSplitRequest) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow)

Aggregations

GetRowsSplitRequest (com.tencent.angel.ps.server.data.request.GetRowsSplitRequest)3 GetRowSplitRequest (com.tencent.angel.ps.server.data.request.GetRowSplitRequest)1 GetUDFRequest (com.tencent.angel.ps.server.data.request.GetUDFRequest)1 IndexPartGetRowRequest (com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest)1 IndexPartGetRowsRequest (com.tencent.angel.ps.server.data.request.IndexPartGetRowsRequest)1 Request (com.tencent.angel.ps.server.data.request.Request)1 RequestHeader (com.tencent.angel.ps.server.data.request.RequestHeader)1 UpdateRequest (com.tencent.angel.ps.server.data.request.UpdateRequest)1 UpdateUDFRequest (com.tencent.angel.ps.server.data.request.UpdateUDFRequest)1 GetRowsSplitResponse (com.tencent.angel.ps.server.data.response.GetRowsSplitResponse)1 ServerRow (com.tencent.angel.ps.storage.vector.ServerRow)1