Search in sources :

Example 1 with CompIntIntRowUpdateSplit

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

the class CompIntIntVectorSplitter method split.

@Override
public Map<PartitionKey, RowUpdateSplit> split(Vector vector, List<PartitionKey> parts) {
    IntIntVector[] vecParts = ((CompIntIntVector) 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 CompIntIntRowUpdateSplit(vector.getRowId(), vecParts[i], (int) (parts.get(i).getEndCol() - parts.get(i).getStartCol())));
    }
    return updateSplitMap;
}
Also used : CompIntIntRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntIntRowUpdateSplit) HashMap(java.util.HashMap) IntIntVector(com.tencent.angel.ml.math2.vector.IntIntVector) CompIntIntVector(com.tencent.angel.ml.math2.vector.CompIntIntVector) PartitionKey(com.tencent.angel.PartitionKey) RowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit) CompIntIntRowUpdateSplit(com.tencent.angel.psagent.matrix.oplog.cache.CompIntIntRowUpdateSplit) CompIntIntVector(com.tencent.angel.ml.math2.vector.CompIntIntVector)

Aggregations

PartitionKey (com.tencent.angel.PartitionKey)1 CompIntIntVector (com.tencent.angel.ml.math2.vector.CompIntIntVector)1 IntIntVector (com.tencent.angel.ml.math2.vector.IntIntVector)1 CompIntIntRowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.CompIntIntRowUpdateSplit)1 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)1 HashMap (java.util.HashMap)1