use of com.tencent.angel.psagent.matrix.transport.adapter.GetRowRequest in project angel by Tencent.
the class GetRowHandler method handle.
@Override
public void handle(FutureResult finalResult, UserRequest userRequest, ResponseCache responseCache) {
GetRowRequest getRowRequest = (GetRowRequest) userRequest;
MapResponseCache cache = (MapResponseCache) responseCache;
// Merge the sub-response
List<ServerRow> serverRows = new ArrayList<>(cache.expectedResponseNum);
for (Response response : cache.getResponses().values()) {
serverRows.add(((GetRowSplitResponse) (response.getData())).getRowSplit());
}
Vector vector = MergeUtils.combineServerRowSplits(serverRows, getRowRequest.getMatrixId(), getRowRequest.getRowId());
// Set matrix/row information
vector.setMatrixId(getRowRequest.getMatrixId());
vector.setRowId(getRowRequest.getRowId());
// Set result
finalResult.set(vector);
}
Aggregations