use of com.tencent.angel.psagent.matrix.transport.adapter.GetPSFRequest in project angel by Tencent.
the class GetUDFHandler method handle.
@Override
public void handle(FutureResult finalResult, UserRequest userRequest, ResponseCache responseCache) {
GetPSFRequest getPSFRequest = (GetPSFRequest) userRequest;
MapResponseCache cache = (MapResponseCache) responseCache;
// Adaptor to Get PSF merge
ConcurrentHashMap<Request, Response> responses = cache.getResponses();
int responseNum = responses.size();
List<PartitionGetResult> partGetResults = new ArrayList<>(responseNum);
for (Response response : responses.values()) {
partGetResults.add(((GetUDFResponse) response.getData()).getPartResult());
}
// Merge the sub-results
try {
finalResult.set(getPSFRequest.getGetFunc().merge(partGetResults));
} catch (Exception x) {
LOG.error("merge row failed ", x);
finalResult.setExecuteException(new ExecutionException(x));
}
}
Aggregations