Search in sources :

Example 1 with RequestContext

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

the class MatrixTransportClient method addToGetQueueForServer.

private void addToGetQueueForServer(ParameterServerId serverId, Request request) {
    request.setContext(new RequestContext());
    request.getContext().setServerId(serverId);
    LinkedBlockingQueue<Request> queue = getItemQueues.get(serverId);
    if (queue == null) {
        queue = new LinkedBlockingQueue<>();
        getItemQueues.putIfAbsent(serverId, queue);
        queue = getItemQueues.get(serverId);
    }
    queue.add(request);
}
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) RequestContext(com.tencent.angel.ps.server.data.request.RequestContext)

Example 2 with RequestContext

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

the class MatrixTransportClient method addToPutQueueForServer.

private void addToPutQueueForServer(ParameterServerId serverId, Request request) {
    request.setContext(new RequestContext());
    request.getContext().setServerId(serverId);
    LinkedBlockingQueue<Request> queue = putItemQueues.get(serverId);
    if (queue == null) {
        queue = new LinkedBlockingQueue<>();
        putItemQueues.putIfAbsent(serverId, queue);
        queue = putItemQueues.get(serverId);
    }
    queue.add(request);
}
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) RequestContext(com.tencent.angel.ps.server.data.request.RequestContext)

Aggregations

GetUDFRequest (com.tencent.angel.ps.server.data.request.GetUDFRequest)2 Request (com.tencent.angel.ps.server.data.request.Request)2 RequestContext (com.tencent.angel.ps.server.data.request.RequestContext)2 UpdateUDFRequest (com.tencent.angel.ps.server.data.request.UpdateUDFRequest)2 UserRequest (com.tencent.angel.psagent.matrix.transport.adapter.UserRequest)2