use of com.tencent.angel.protobuf.generated.PSAgentMasterServiceProtos.GetMatricesResponse in project angel by Tencent.
the class MasterService method getMatrices.
/**
* Get matrices metadata
*/
@Override
public GetMatricesResponse getMatrices(RpcController controller, GetMatricesRequest request) throws ServiceException {
GetMatricesResponse.Builder builder = GetMatricesResponse.newBuilder();
AMMatrixMetaManager matrixMetaManager = context.getMatrixMetaManager();
List<String> matrixNames = request.getMatrixNamesList();
int size = matrixNames.size();
for (int i = 0; i < size; i++) {
MatrixMeta matrixMeta = matrixMetaManager.getMatrix(matrixNames.get(i));
if (matrixMeta == null) {
throw new ServiceException("Can not find matrix " + matrixNames.get(i));
}
builder.addMatrixMetas(ProtobufUtil.convertToMatrixMetaProto(matrixMeta));
}
return builder.build();
}
Aggregations