use of it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap in project angel by Tencent.
the class PushPathTail method partitionUpdate.
@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
PushPathTailPartitionParam pparam = (PushPathTailPartitionParam) partParam;
PartitionKey partKey = pparam.getPartKey();
ServerLongAnyRow row = (ServerLongAnyRow) psContext.getMatrixStorageManager().getRow(pparam.getPartKey(), 0);
Long2LongOpenHashMap pathTail = pparam.getPathTail();
PathQueue.pushBatch(partKey.getPartitionId(), row, pathTail);
// int completeCount = 0;
// ArrayList<WalkPath> paths = new ArrayList<>(pathTail.size());
//
// row.startWrite();
// try {
// ObjectIterator<Map.Entry<Long, Long>> iter = pathTail.entrySet().iterator();
// while (iter.hasNext()) {
// Map.Entry<Long, Long> entry = iter.next();
// long key = entry.getKey();
// long tail = entry.getValue();
//
// WalkPath wPath = (WalkPath) row.get(key);
// wPath.add2Path(tail);
//
// if (wPath.isComplete()) {
// completeCount += 1;
// } else {
// paths.add(wPath);
// }
// }
// } finally {
// row.endWrite();
// }
//
// if (completeCount != 0) {
// PathQueue.progress(partKey.getPartitionId(), completeCount);
// }
//
// if (!paths.isEmpty()) {
// PathQueue.pushBatch(partKey.getPartitionId(), paths);
// }
}
use of it.unimi.dsi.fastutil.longs.Long2LongOpenHashMap in project angel by Tencent.
the class PushPathTailPartitionParam method deserialize.
@Override
public void deserialize(ByteBuf buf) {
super.deserialize(buf);
this.startIdx = 0;
this.endIdx = buf.readInt();
int size = endIdx - startIdx;
// System.out.println(Thread.currentThread().getId() + "\t deserialize -> " + size);
pathTail = new Long2LongOpenHashMap(size);
for (int i = 0; i < size; i++) {
long key = buf.readLong();
long value = buf.readLong();
pathTail.put(key, value);
}
}
Aggregations