Search in sources :

Example 1 with UpdateRequest

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

the class BasicStreamUpdateHandler method handle.

@Override
public ResponseData handle(RequestHeader header, RequestData data) throws Exception {
    UpdateRequest request = (UpdateRequest) data;
    ServerPartition part = MatrixUtils.getPart(context.getMatrixStorageManager(), header.matrixId, header.partId);
    ByteBuf in = request.getInputBuffer();
    // Filter comp key value
    ByteBufSerdeUtils.deserializeBoolean(in);
    part.update(in, request.getOp());
    return new UpdateResponse();
}
Also used : UpdateResponse(com.tencent.angel.ps.server.data.response.UpdateResponse) UpdateRequest(com.tencent.angel.ps.server.data.request.UpdateRequest) ByteBuf(io.netty.buffer.ByteBuf) ServerPartition(com.tencent.angel.ps.storage.partition.ServerPartition)

Example 2 with UpdateRequest

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

the class BasicStreamUpdateHandler method parseRequest.

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

Example 3 with UpdateRequest

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

UpdateRequest (com.tencent.angel.ps.server.data.request.UpdateRequest)3 GetRowSplitRequest (com.tencent.angel.ps.server.data.request.GetRowSplitRequest)1 GetRowsSplitRequest (com.tencent.angel.ps.server.data.request.GetRowsSplitRequest)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 UpdateUDFRequest (com.tencent.angel.ps.server.data.request.UpdateUDFRequest)1 UpdateResponse (com.tencent.angel.ps.server.data.response.UpdateResponse)1 ServerPartition (com.tencent.angel.ps.storage.partition.ServerPartition)1 ByteBuf (io.netty.buffer.ByteBuf)1