Search in sources :

Example 1 with ServerRow

use of com.tencent.angel.ps.storage.vector.ServerRow in project angel by Tencent.

the class GetRowHandler method handle.

@Override
public ResponseData handle(RequestHeader header, RequestData data) throws Exception {
    GetRowSplitRequest request = (GetRowSplitRequest) data;
    ServerRow row = MatrixUtils.getRow(context.getMatrixStorageManager(), header.matrixId, header.partId, request.getRowId());
    return new GetRowSplitResponse(row);
}
Also used : GetRowSplitRequest(com.tencent.angel.ps.server.data.request.GetRowSplitRequest) GetRowSplitResponse(com.tencent.angel.ps.server.data.response.GetRowSplitResponse) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow)

Example 2 with ServerRow

use of com.tencent.angel.ps.storage.vector.ServerRow in project angel by Tencent.

the class ServerRowsStorage method update.

@Override
public void update(ByteBuf buf, UpdateOp op) {
    int rowNum = ByteBufSerdeUtils.deserializeInt(buf);
    int rowId;
    RowType rowType;
    for (int i = 0; i < rowNum; i++) {
        // Filter head
        ByteBufSerdeUtils.deserializeBoolean(buf);
        ByteBufSerdeUtils.deserializeInt(buf);
        rowType = RowType.valueOf(ByteBufSerdeUtils.deserializeInt(buf));
        rowId = ByteBufSerdeUtils.deserializeInt(buf);
        ServerRow row = getRow(rowId);
        row.update(rowType, buf, op);
    }
}
Also used : RowType(com.tencent.angel.ml.matrix.RowType) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow)

Example 3 with ServerRow

use of com.tencent.angel.ps.storage.vector.ServerRow in project angel by Tencent.

the class Zero method partitionUpdate.

@Override
public void partitionUpdate(PartitionUpdateParam partParam) {
    RowBasedPartition part = (RowBasedPartition) psContext.getMatrixStorageManager().getPart(partParam.getMatrixId(), partParam.getPartKey().getPartitionId());
    if (part != null) {
        int startRow = part.getPartitionKey().getStartRow();
        int endRow = part.getPartitionKey().getEndRow();
        for (int i = startRow; i < endRow; i++) {
            ServerRow row = part.getRow(i);
            if (row == null) {
                continue;
            }
            zero(row);
        }
    }
}
Also used : ServerRow(com.tencent.angel.ps.storage.vector.ServerRow) RowBasedPartition(com.tencent.angel.ps.storage.partition.RowBasedPartition)

Example 4 with ServerRow

use of com.tencent.angel.ps.storage.vector.ServerRow in project angel by Tencent.

the class SnapshotFormat method load.

/**
 * Load a matrix partition
 *
 * @param part matrix partition
 * @param partMeta matrix partition data meta
 * @param loadContext load context
 * @param input input stream
 */
public void load(RowBasedPartition part, MatrixPartitionMeta partMeta, PSMatrixLoadContext loadContext, DataInputStream input) throws IOException {
    ServerRowsStorage rows = part.getRowsStorage();
    try {
        Map<Integer, RowPartitionMeta> rowMetas = partMeta.getRowMetas();
        for (RowPartitionMeta rowMeta : rowMetas.values()) {
            ServerRow row = rows.getRow(rowMeta.getRowId());
            load(row, partMeta, loadContext, input);
        }
    } finally {
        part.setState(PartitionState.READ_AND_WRITE);
    }
}
Also used : ServerRowsStorage(com.tencent.angel.ps.storage.partition.storage.ServerRowsStorage) ServerRow(com.tencent.angel.ps.storage.vector.ServerRow)

Example 5 with ServerRow

use of com.tencent.angel.ps.storage.vector.ServerRow in project angel by Tencent.

the class ComplexRowFormat method load.

@Override
public void load(RowBasedPartition part, MatrixPartitionMeta partMeta, PSMatrixLoadContext loadContext, DataInputStream input) throws IOException {
    try {
        Map<Integer, RowPartitionMeta> rowMetas = partMeta.getRowMetas();
        for (RowPartitionMeta rowMeta : rowMetas.values()) {
            ServerRow row = part.getRow(rowMeta.getRowId());
            load(row, partMeta, loadContext, input);
        }
    } finally {
        part.setState(PartitionState.READ_AND_WRITE);
    }
}
Also used : ServerRow(com.tencent.angel.ps.storage.vector.ServerRow)

Aggregations

ServerRow (com.tencent.angel.ps.storage.vector.ServerRow)42 Vector (com.tencent.angel.ml.math2.vector.Vector)13 RowBasedPartition (com.tencent.angel.ps.storage.partition.RowBasedPartition)6 PartIncrementRowsParam (com.tencent.angel.ml.matrix.psf.update.update.PartIncrementRowsParam)5 RowUpdateSplit (com.tencent.angel.psagent.matrix.oplog.cache.RowUpdateSplit)5 ArrayList (java.util.ArrayList)5 PartitionKey (com.tencent.angel.PartitionKey)4 ServerIntIntRow (com.tencent.angel.ps.storage.vector.ServerIntIntRow)4 AngelException (com.tencent.angel.exception.AngelException)2 FloatVector (com.tencent.angel.ml.math2.vector.FloatVector)2 RowType (com.tencent.angel.ml.matrix.RowType)2 PartitionGetRowsParam (com.tencent.angel.ml.matrix.psf.get.getrows.PartitionGetRowsParam)2 GetRowSplitResponse (com.tencent.angel.ps.server.data.response.GetRowSplitResponse)2 GetRowsSplitResponse (com.tencent.angel.ps.server.data.response.GetRowsSplitResponse)2 Response (com.tencent.angel.ps.server.data.response.Response)2 MatrixStorageManager (com.tencent.angel.ps.storage.MatrixStorageManager)2 ServerMatrix (com.tencent.angel.ps.storage.matrix.ServerMatrix)2 ServerPartition (com.tencent.angel.ps.storage.partition.ServerPartition)2 ServerRowsStorage (com.tencent.angel.ps.storage.partition.storage.ServerRowsStorage)2 KeyPart (com.tencent.angel.psagent.matrix.transport.router.KeyPart)2