use of com.tencent.angel.protobuf.generated.MLProtos.PartitionMetaProto in project angel by Tencent.
the class ProtobufUtil method convertToMatrixMeta.
public static MatrixMeta convertToMatrixMeta(MatrixMetaProto matrixMetaProto) throws ClassNotFoundException {
MatrixContext matrixContext = convertToMatrixContext(matrixMetaProto.getMatrixContext());
List<PartitionMetaProto> partMetaProtos = matrixMetaProto.getPartMetasList();
int size = partMetaProtos.size();
Map<Integer, PartitionMeta> partitionMetas = new HashMap<>(size);
for (int i = 0; i < size; i++) {
partitionMetas.put(partMetaProtos.get(i).getPartitionId(), convertToParitionMeta(matrixContext.getMatrixId(), partMetaProtos.get(i)));
}
return new MatrixMeta(matrixMetaProto.getTotalPartNum(), matrixContext, partitionMetas);
}
Aggregations