Search in sources :

Example 1 with IndexGetRowRequest

use of com.tencent.angel.psagent.matrix.transport.adapter.IndexGetRowRequest in project angel by Tencent.

the class IndexGetRowHandler method handle.

@Override
public void handle(FutureResult finalResult, UserRequest userRequest, ResponseCache responseCache) {
    IndexGetRowRequest indexGetRowRequest = (IndexGetRowRequest) userRequest;
    MapResponseCache cache = (MapResponseCache) responseCache;
    ConcurrentHashMap<Request, Response> responses = cache.getResponses();
    // Merge
    Vector result = merge(indexGetRowRequest, responses);
    // Set matrix/row meta
    result.setMatrixId(indexGetRowRequest.getMatrixId());
    result.setRowId(indexGetRowRequest.getRowId());
    // Set final result
    finalResult.set(result);
}
Also used : Response(com.tencent.angel.ps.server.data.response.Response) StreamIndexPartGetRowResponse(com.tencent.angel.ps.server.data.response.StreamIndexPartGetRowResponse) IndexGetRowRequest(com.tencent.angel.psagent.matrix.transport.adapter.IndexGetRowRequest) Request(com.tencent.angel.ps.server.data.request.Request) IndexGetRowRequest(com.tencent.angel.psagent.matrix.transport.adapter.IndexGetRowRequest) IndexPartGetRowRequest(com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest) UserRequest(com.tencent.angel.psagent.matrix.transport.adapter.UserRequest) Vector(com.tencent.angel.ml.math2.vector.Vector)

Aggregations

Vector (com.tencent.angel.ml.math2.vector.Vector)1 IndexPartGetRowRequest (com.tencent.angel.ps.server.data.request.IndexPartGetRowRequest)1 Request (com.tencent.angel.ps.server.data.request.Request)1 Response (com.tencent.angel.ps.server.data.response.Response)1 StreamIndexPartGetRowResponse (com.tencent.angel.ps.server.data.response.StreamIndexPartGetRowResponse)1 IndexGetRowRequest (com.tencent.angel.psagent.matrix.transport.adapter.IndexGetRowRequest)1 UserRequest (com.tencent.angel.psagent.matrix.transport.adapter.UserRequest)1