Search in sources :

Example 1 with CompLongIntRowUpdateSplit

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

the class CompLongIntVectorSplitter method split.

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

Aggregations

PartitionKey (com.tencent.angel.PartitionKey)1 CompLongIntVector (com.tencent.angel.ml.math2.vector.CompLongIntVector)1 LongIntVector (com.tencent.angel.ml.math2.vector.LongIntVector)1 CompLongIntRowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.CompLongIntRowUpdateSplit)1 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)1 HashMap (java.util.HashMap)1