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);
}
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);
}
}
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);
}
}
}
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);
}
}
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);
}
}
Aggregations