Search in sources :

Example 1 with GetSaveResultsResponse

use of com.tencent.angel.protobuf.generated.PSMasterServiceProtos.GetSaveResultsResponse in project angel by Tencent.

the class MasterService method getSaveResults.

/**
 * Get model save results
 */
@Override
public GetSaveResultsResponse getSaveResults(RpcController controller, GetSaveResultsRequest request) throws ServiceException {
    LOG.info("Get save result request=" + request);
    List<SaveResult> results = context.getModelSaver().getSaveResults(request.getMatrixId());
    if (results == null || results.isEmpty()) {
        return GetSaveResultsResponse.getDefaultInstance();
    }
    GetSaveResultsResponse.Builder builder = GetSaveResultsResponse.newBuilder();
    for (SaveResult result : results) {
        builder.addSaveResults(ProtobufUtil.convert(result));
    }
    return builder.build();
}
Also used : SaveResult(com.tencent.angel.master.matrix.committer.SaveResult) PSMatricesSaveResult(com.tencent.angel.model.PSMatricesSaveResult) ModelSaveResult(com.tencent.angel.model.ModelSaveResult) GetSaveResultsResponse(com.tencent.angel.protobuf.generated.PSMasterServiceProtos.GetSaveResultsResponse)

Aggregations

SaveResult (com.tencent.angel.master.matrix.committer.SaveResult)1 ModelSaveResult (com.tencent.angel.model.ModelSaveResult)1 PSMatricesSaveResult (com.tencent.angel.model.PSMatricesSaveResult)1 GetSaveResultsResponse (com.tencent.angel.protobuf.generated.PSMasterServiceProtos.GetSaveResultsResponse)1