use of com.tencent.angel.psagent.matrix.transport.router.KeyValuePart in project angel by Tencent.
the class GetNeighborWithCountParam method split.
@Override
public List<PartitionGetParam> split() {
// Get matrix meta
MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
PartitionKey[] parts = meta.getPartitionKeys();
// Split
KeyValuePart[] nodeIdsParts = RouterUtils.split(meta, 0, nodeIds, count, false);
// Generate Part psf get param
List<PartitionGetParam> partParams = new ArrayList<>(parts.length);
assert parts.length == nodeIdsParts.length;
for (int i = 0; i < parts.length; i++) {
if (nodeIdsParts[i] != null && nodeIdsParts[i].size() > 0) {
partParams.add(new PartGetNeighborWithCountParam(matrixId, parts[i], nodeIdsParts[i]));
}
}
return partParams;
}
use of com.tencent.angel.psagent.matrix.transport.router.KeyValuePart in project angel by Tencent.
the class UpdateHyperLogLogParam method split.
@Override
public List<PartitionUpdateParam> split() {
MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
PartitionKey[] parts = meta.getPartitionKeys();
KeyValuePart[] splits = splitHLLMap(meta, updates);
assert parts.length == splits.length;
List<PartitionUpdateParam> partParams = new ArrayList<>(parts.length);
for (int i = 0; i < parts.length; i++) {
if (splits[i] != null && splits[i].size() > 0) {
partParams.add(new UpdateHyperLogLogPartParam(matrixId, parts[i], splits[i], p, sp, seed));
}
}
return partParams;
}
Aggregations