Search in sources :

Example 1 with PartitionGetRowsParam

use of com.tencent.angel.ml.matrix.psf.get.multi.PartitionGetRowsParam in project angel by Tencent.

the class GetPartFunc method partitionGet.

@Override
public PartitionGetResult partitionGet(PartitionGetParam partParam) {
    PartitionGetRowsParam param = (PartitionGetRowsParam) partParam;
    PartitionKey pkey = param.getPartKey();
    pkey = psContext.getMatrixMetaManager().getMatrixMeta(pkey.getMatrixId()).getPartitionMeta(pkey.getPartitionId()).getPartitionKey();
    int ws = pkey.getStartRow();
    int es = pkey.getEndRow();
    List<Integer> reqRows = param.getRowIndexes();
    MatrixStorageManager manager = psContext.getMatrixStorageManager();
    List<ServerRow> rows = new ArrayList<>();
    for (int w : reqRows) rows.add(manager.getRow(pkey, w));
    PartCSRResult csr = new PartCSRResult(rows);
    return csr;
}
Also used : PartitionGetRowsParam(com.tencent.angel.ml.matrix.psf.get.multi.PartitionGetRowsParam) MatrixStorageManager(com.tencent.angel.ps.impl.MatrixStorageManager) ArrayList(java.util.ArrayList) PartitionKey(com.tencent.angel.PartitionKey) ServerRow(com.tencent.angel.ps.impl.matrix.ServerRow)

Aggregations

PartitionKey (com.tencent.angel.PartitionKey)1 PartitionGetRowsParam (com.tencent.angel.ml.matrix.psf.get.multi.PartitionGetRowsParam)1 MatrixStorageManager (com.tencent.angel.ps.impl.MatrixStorageManager)1 ServerRow (com.tencent.angel.ps.impl.matrix.ServerRow)1 ArrayList (java.util.ArrayList)1