use of com.tencent.angel.ps.server.data.exception.ObjectNotFoundException in project angel by Tencent.
the class MatrixUtils method getPart.
public static ServerPartition getPart(MatrixStorageManager storageManager, int matrixId, int partId) {
ServerMatrix matrix = storageManager.getMatrix(matrixId);
if (matrix == null) {
throw new ObjectNotFoundException("Can not find matrix " + matrixId);
}
ServerPartition part = matrix.getPartition(partId);
if (part == null) {
throw new ObjectNotFoundException("Can not find partition " + partId + " of matrix " + matrixId);
}
return part;
}
use of com.tencent.angel.ps.server.data.exception.ObjectNotFoundException in project angel by Tencent.
the class MatrixUtils method getRow.
public static ServerRow getRow(MatrixStorageManager storageManager, int matrixId, int partId, int rowId) {
ServerMatrix matrix = storageManager.getMatrix(matrixId);
if (matrix == null) {
throw new ObjectNotFoundException("Can not find matrix " + matrixId);
}
ServerPartition part = matrix.getPartition(partId);
if (part == null) {
throw new ObjectNotFoundException("Can not find partition " + partId + " of matrix " + matrixId);
}
if (!(part instanceof RowBasedPartition)) {
throw new UnsupportedOperationException("Get row only support for RowBasedPartition");
}
ServerRow row = ((RowBasedPartition) part).getRow(rowId);
if (row == null) {
throw new ObjectNotFoundException("Can not find row " + rowId + " of matrix " + matrixId + " in partition " + partId);
}
return row;
}
Aggregations