use of com.tencent.angel.graph.common.psf.result.GetElementResult in project angel by Tencent.
the class GeneralGet method merge.
@Override
public GetResult merge(List<PartitionGetResult> partResults) {
int resultSize = 0;
for (PartitionGetResult result : partResults) {
resultSize += ((PartGeneralGetResult) result).getNodeIds().length;
}
Long2ObjectOpenHashMap nodeIdToNeighbors = new Long2ObjectOpenHashMap<>(resultSize);
for (PartitionGetResult result : partResults) {
PartGeneralGetResult getResult = (PartGeneralGetResult) result;
long[] nodeIds = getResult.getNodeIds();
IElement[] objs = getResult.getData();
for (int i = 0; i < nodeIds.length; i++) {
nodeIdToNeighbors.put(nodeIds[i], objs[i]);
}
}
return new GetElementResult(nodeIdToNeighbors);
}
Aggregations