use of com.tencent.angel.psagent.matrix.transport.router.operator.ILongKeyPartOp in project angel by Tencent.
the class GetHyperLogLog method partitionGet.
@Override
public PartitionGetResult partitionGet(PartitionGetParam partParam) {
GetHyperLogLogPartParam param = (GetHyperLogLogPartParam) partParam;
ServerLongAnyRow row = GraphMatrixUtils.getPSLongKeyRow(psContext, param);
ILongKeyPartOp keyPart = (ILongKeyPartOp) param.getNodes();
long[] nodes = keyPart.getKeys();
Long2ObjectOpenHashMap<HyperLogLogPlus> logs = new Long2ObjectOpenHashMap<>(nodes.length);
row.startRead(20000);
try {
for (int i = 0; i < nodes.length; i++) {
HyperLogLogPlusElement hllElem = (HyperLogLogPlusElement) row.get(nodes[i]);
if (hllElem.isActive()) {
logs.put(nodes[i], hllElem.getHyperLogLogPlus());
}
}
} finally {
row.endRead();
}
return new GetHyperLogLogPartResult(logs);
}
Aggregations