use of com.tencent.angel.ps.storage.vector.ServerLongDoubleRow in project angel by Tencent.
the class RowSplitCombineUtils method combineServerLongDoubleRowSplits.
private static Vector combineServerLongDoubleRowSplits(List<ServerRow> rowSplits, MatrixMeta matrixMeta, int rowIndex) {
long colNum = matrixMeta.getColNum();
int elemNum = 0;
int size = rowSplits.size();
for (int i = 0; i < size; i++) {
elemNum += rowSplits.get(i).size();
}
LongDoubleVector row = VFactory.sparseLongKeyDoubleVector(colNum, elemNum);
row.setMatrixId(matrixMeta.getId());
row.setRowId(rowIndex);
Collections.sort(rowSplits, serverRowComp);
int clock = Integer.MAX_VALUE;
for (int i = 0; i < size; i++) {
if (rowSplits.get(i) == null) {
continue;
}
if (rowSplits.get(i).getClock() < clock) {
clock = rowSplits.get(i).getClock();
}
((ServerLongDoubleRow) rowSplits.get(i)).mergeTo(row);
}
row.setClock(clock);
return row;
}
use of com.tencent.angel.ps.storage.vector.ServerLongDoubleRow in project angel by Tencent.
the class MergeUtils method combineServerLongDoubleRowSplits.
private static Vector combineServerLongDoubleRowSplits(List<ServerRow> rowSplits, MatrixMeta matrixMeta, int rowIndex) {
long colNum = matrixMeta.getColNum();
int elemNum = 0;
int size = rowSplits.size();
for (int i = 0; i < size; i++) {
elemNum += rowSplits.get(i).size();
}
LongDoubleVector row = VFactory.sparseLongKeyDoubleVector(colNum, elemNum);
row.setMatrixId(matrixMeta.getId());
row.setRowId(rowIndex);
Collections.sort(rowSplits, serverRowComp);
for (int i = 0; i < size; i++) {
if (rowSplits.get(i) == null) {
continue;
}
((ServerLongDoubleRow) rowSplits.get(i)).mergeTo(row);
}
return row;
}
Aggregations