use of com.tencent.angel.common.collections.DynamicLongArray in project angel by Tencent.
the class ReadTag method merge.
@Override
public GetResult merge(List<PartitionGetResult> partResults) {
DynamicLongArray re = new DynamicLongArray(0);
for (PartitionGetResult result : partResults) {
PartReadTagResult partResult = (PartReadTagResult) result;
long[] nodeIds = partResult.getNodes();
for (long id : nodeIds) {
re.add(id);
}
}
return new ReadTagResult(re.getData());
}
use of com.tencent.angel.common.collections.DynamicLongArray in project angel by Tencent.
the class ReadTag method partitionGet.
@Override
public PartitionGetResult partitionGet(PartitionGetParam partParam) {
GeneralPartGetParam param = (GeneralPartGetParam) partParam;
KeyPart keyPart = param.getIndicesPart();
long[] nodeIds = ((ILongKeyPartOp) keyPart).getKeys();
ServerLongIntRow row = GraphMatrixUtils.getPSLongKeyIntRow(psContext, param, param.getRowId());
DynamicLongArray nodes = new DynamicLongArray(nodeIds.length);
for (int i = 0; i < nodeIds.length; i++) {
long nodeId = nodeIds[i];
if (row.get(nodeId) > 0) {
nodes.add(nodeId);
}
}
return new PartReadTagResult(nodes.getData());
}
Aggregations