use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.
the class ComplexRowFormat method save.
private void save(ServerLongAnyRow row, PSMatrixSaveContext saveContext, MatrixPartitionMeta partMeta, DataOutputStream output) throws IOException {
LongElementStorage storage = row.getStorage();
ObjectIterator<Long2ObjectMap.Entry<IElement>> iter = storage.iterator();
long startPos = partMeta.getStartCol();
while (iter.hasNext()) {
Long2ObjectMap.Entry<IElement> entry = iter.next();
save(entry.getLongKey() + startPos, entry.getValue(), output);
}
}
use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.
the class NnzFeature method processRow.
@Override
public double processRow(ServerRow row) {
LongElementStorage storage = ((ServerLongAnyRow) row).getStorage();
ObjectIterator<Long2ObjectMap.Entry<IElement>> it = storage.iterator();
long size = 0;
while (it.hasNext()) {
Node node = (Node) (it.next().getValue());
if (node.getFeats() != null) {
size++;
}
}
return size;
}
use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.
the class NnzFeature method processRow.
@Override
public double processRow(ServerRow row) {
LongElementStorage storage = ((ServerLongAnyRow) row).getStorage();
ObjectIterator<Long2ObjectMap.Entry<IElement>> it = storage.iterator();
long size = 0;
while (it.hasNext()) {
GraphNode node = (GraphNode) (it.next().getValue());
if (node.getFeats() != null) {
size++;
}
}
return size;
}
use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.
the class NnzEdge method processRow.
@Override
public double processRow(ServerRow row) {
LongElementStorage storage = ((ServerLongAnyRow) row).getStorage();
ObjectIterator<Long2ObjectMap.Entry<IElement>> it = storage.iterator();
long size = 0;
while (it.hasNext()) {
GraphNode node = (GraphNode) (it.next().getValue());
if (node.getNeighbors() != null) {
size += node.getNeighbors().length;
}
}
return size;
}
use of com.tencent.angel.ps.storage.vector.storage.LongElementStorage in project angel by Tencent.
the class NnzNeighbor method processRow.
@Override
public double processRow(ServerRow row) {
LongElementStorage storage = ((ServerLongAnyRow) row).getStorage();
ObjectIterator<Long2ObjectMap.Entry<IElement>> it = storage.iterator();
int size = 0;
while (it.hasNext()) {
GraphNode node = (GraphNode) (it.next().getValue());
if (node.getNeighbors() != null) {
size++;
}
}
return size;
}
Aggregations