Search in sources :

Example 11 with KeyValuePart

use of com.tencent.angel.psagent.matrix.transport.router.KeyValuePart in project angel by Tencent.

the class GetNeighborWithCountParam method split.

@Override
public List<PartitionGetParam> split() {
    // Get matrix meta
    MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
    PartitionKey[] parts = meta.getPartitionKeys();
    // Split
    KeyValuePart[] nodeIdsParts = RouterUtils.split(meta, 0, nodeIds, count, false);
    // Generate Part psf get param
    List<PartitionGetParam> partParams = new ArrayList<>(parts.length);
    assert parts.length == nodeIdsParts.length;
    for (int i = 0; i < parts.length; i++) {
        if (nodeIdsParts[i] != null && nodeIdsParts[i].size() > 0) {
            partParams.add(new PartGetNeighborWithCountParam(matrixId, parts[i], nodeIdsParts[i]));
        }
    }
    return partParams;
}
Also used : MatrixMeta(com.tencent.angel.ml.matrix.MatrixMeta) ArrayList(java.util.ArrayList) PartitionKey(com.tencent.angel.PartitionKey) PartitionGetParam(com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam) KeyValuePart(com.tencent.angel.psagent.matrix.transport.router.KeyValuePart)

Example 12 with KeyValuePart

use of com.tencent.angel.psagent.matrix.transport.router.KeyValuePart in project angel by Tencent.

the class UpdateHyperLogLogParam method split.

@Override
public List<PartitionUpdateParam> split() {
    MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(matrixId);
    PartitionKey[] parts = meta.getPartitionKeys();
    KeyValuePart[] splits = splitHLLMap(meta, updates);
    assert parts.length == splits.length;
    List<PartitionUpdateParam> partParams = new ArrayList<>(parts.length);
    for (int i = 0; i < parts.length; i++) {
        if (splits[i] != null && splits[i].size() > 0) {
            partParams.add(new UpdateHyperLogLogPartParam(matrixId, parts[i], splits[i], p, sp, seed));
        }
    }
    return partParams;
}
Also used : MatrixMeta(com.tencent.angel.ml.matrix.MatrixMeta) PartitionUpdateParam(com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam) ArrayList(java.util.ArrayList) PartitionKey(com.tencent.angel.PartitionKey) KeyValuePart(com.tencent.angel.psagent.matrix.transport.router.KeyValuePart)

Aggregations

KeyValuePart (com.tencent.angel.psagent.matrix.transport.router.KeyValuePart)12 PartitionKey (com.tencent.angel.PartitionKey)9 MatrixMeta (com.tencent.angel.ml.matrix.MatrixMeta)7 ArrayList (java.util.ArrayList)7 PartitionUpdateParam (com.tencent.angel.ml.matrix.psf.update.base.PartitionUpdateParam)5 GeneralPartUpdateParam (com.tencent.angel.ml.matrix.psf.update.base.GeneralPartUpdateParam)4 CompStreamKeyValuePart (com.tencent.angel.psagent.matrix.transport.router.CompStreamKeyValuePart)4 PartitionGetParam (com.tencent.angel.ml.matrix.psf.get.base.PartitionGetParam)2 IntDoubleVector (com.tencent.angel.ml.math2.vector.IntDoubleVector)1 IntFloatVector (com.tencent.angel.ml.math2.vector.IntFloatVector)1 IntIntVector (com.tencent.angel.ml.math2.vector.IntIntVector)1 IntLongVector (com.tencent.angel.ml.math2.vector.IntLongVector)1 LongDoubleVector (com.tencent.angel.ml.math2.vector.LongDoubleVector)1 LongFloatVector (com.tencent.angel.ml.math2.vector.LongFloatVector)1 LongIntVector (com.tencent.angel.ml.math2.vector.LongIntVector)1 LongLongVector (com.tencent.angel.ml.math2.vector.LongLongVector)1 RowType (com.tencent.angel.ml.matrix.RowType)1 ServerLongAnyRow (com.tencent.angel.ps.storage.vector.ServerLongAnyRow)1 KeyHash (com.tencent.angel.psagent.matrix.transport.router.KeyHash)1 RouterType (com.tencent.angel.psagent.matrix.transport.router.RouterType)1