use of com.tencent.angel.ml.matrix.psf.update.enhance.UpdateParam in project angel by Tencent.
the class MatrixClientAdapter method update.
/**
* Update matrix use a udf.
*
* @param updateFunc update udf function
* @return Future<VoidResult> update future result
*/
public Future<VoidResult> update(UpdateFunc updateFunc) {
MatrixTransportClient matrixClient = PSAgentContext.get().getMatrixTransportClient();
UpdateParam param = updateFunc.getParam();
List<PartitionUpdateParam> partParams = param.split();
int size = partParams.size();
UpdaterRequest request = new UpdaterRequest(param);
UpdaterResponseCache cache = new UpdaterResponseCache(size);
for (int i = 0; i < size; i++) {
cache.addResult(matrixClient.update(updateFunc, partParams.get(i)));
}
requestToResponseMap.put(request, cache);
return cache.getMergedResult();
}
Aggregations