Search in sources :

Example 1 with CompIntLongRowUpdateSplit

use of com.tencent.angel.psagent.matrix.oplog.cache.CompIntLongRowUpdateSplit in project angel by Tencent.

the class CompIntLongVectorSplitter method split.

@Override
public Map<PartitionKey, RowUpdateSplit> split(Vector vector, List<PartitionKey> parts) {
    IntLongVector[] vecParts = ((CompIntLongVector) vector).getPartitions();
    assert vecParts.length == parts.size();
    Map<PartitionKey, RowUpdateSplit> updateSplitMap = new HashMap<>(parts.size());
    for (int i = 0; i < vecParts.length; i++) {
        updateSplitMap.put(parts.get(i), new CompIntLongRowUpdateSplit(vector.getRowId(), vecParts[i], (int) (parts.get(i).getEndCol() - parts.get(i).getStartCol())));
    }
    return updateSplitMap;
}
Also used : CompIntLongVector(com.tencent.angel.ml.math2.vector.CompIntLongVector) IntLongVector(com.tencent.angel.ml.math2.vector.IntLongVector) CompIntLongRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntLongRowUpdateSplit) HashMap(java.util.HashMap) CompIntLongVector(com.tencent.angel.ml.math2.vector.CompIntLongVector) PartitionKey(com.tencent.angel.PartitionKey) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) CompIntLongRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntLongRowUpdateSplit)

Aggregations

PartitionKey (com.tencent.angel.PartitionKey)1 CompIntLongVector (com.tencent.angel.ml.math2.vector.CompIntLongVector)1 IntLongVector (com.tencent.angel.ml.math2.vector.IntLongVector)1 CompIntLongRowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.CompIntLongRowUpdateSplit)1 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)1 HashMap (java.util.HashMap)1