use of com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam in project angel by Tencent.
the class UserRequestAdapter method get.
/**
* Get a row from ps use a udf.
*
* @param func get row udf
* @return GetResult the result of the udf
* @throws ExecutionException exception thrown when attempting to retrieve the result of a task
* that aborted by throwing an exception
* @throws InterruptedException interrupted while wait the result
*/
public FutureResult<GetResult> get(GetFunc func) throws InterruptedException, ExecutionException {
MatrixTransportClient matrixClient = PSAgentContext.get().getMatrixTransportClient();
GetParam param = func.getParam();
// Split param use matrix partitons
List<PartitionGetParam> partParams = param.split();
int size = partParams.size();
GetPSFRequest request = new GetPSFRequest(func);
int requestId = request.getRequestId();
FutureResult<GetResult> result = new FutureResult<>();
ResponseCache cache = new MapResponseCache(size);
requests.put(requestId, request);
requestIdToResponseCache.put(requestId, cache);
requestIdToResultMap.put(requestId, result);
for (int i = 0; i < size; i++) {
sendGetUDFRequest(matrixClient, requestId, partParams.get(i).getMatrixId(), partParams.get(i).getPartKey().getPartitionId(), func, partParams.get(i));
}
return result;
}
use of com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam in project angel by Tencent.
the class BinaryAggrParam method split.
@Override
public List<PartitionGetParam> split() {
List<PartitionKey> parts = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
int size = parts.size();
List<PartitionGetParam> partParams = new ArrayList<PartitionGetParam>(size);
for (PartitionKey part : parts) {
partParams.add(new BinaryPartitionAggrParam(matrixId, part, rowId1, rowId2));
}
return partParams;
}
use of com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam in project angel by Tencent.
the class GetColumnParam method split.
@Override
public List<PartitionGetParam> split() {
List<PartitionKey> pkeys = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
List<PartitionGetParam> partParams = new ArrayList<PartitionGetParam>(pkeys.size());
for (PartitionKey entry : pkeys) {
partParams.add(new PartitionGetRowsParam(matrixId, entry, columns));
}
return partParams;
}
use of com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam in project angel by Tencent.
the class LikelihoodParam method split.
@Override
public List<PartitionGetParam> split() {
List<PartitionGetParam> params = new ArrayList<>();
List<PartitionKey> pkeys = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
for (PartitionKey pkey : pkeys) {
params.add(new LikelihoodPartParam(matrixId, pkey, beta));
}
return params;
}
use of com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam in project angel by Tencent.
the class HistAggrParam method split.
@Override
public List<PartitionGetParam> split() {
List<PartitionKey> parts = PSAgentContext.get().getMatrixMetaManager().getPartitions(matrixId);
int size = parts.size();
List<PartitionGetParam> partParams = new ArrayList<PartitionGetParam>(size);
for (PartitionKey part : parts) {
partParams.add(new HistPartitionAggrParam(matrixId, part, rowId, splitNum, minChildWeight, regAlpha, regLambda));
}
return partParams;
}
Aggregations