Search in sources :

Example 1 with PSFailedReportProto

use of com.tencent.angel.protobuf.generated.MLProtos.PSFailedReportProto in project angel by Tencent.

the class ProtobufUtil method convert.

public static HashMap<PSLocation, Integer> convert(PSFailedReportsProto reportsProto) {
    HashMap<PSLocation, Integer> reports = new HashMap<>();
    List<PSFailedReportProto> reportList = reportsProto.getPsFailedReportsList();
    int size = reportList.size();
    for (int i = 0; i < size; i++) {
        reports.put(new PSLocation(convertToId(reportList.get(i).getPsLoc().getPsId()), convert(reportList.get(i).getPsLoc().getLocation())), reportList.get(i).getFailedCounter());
    }
    return reports;
}
Also used : PSLocation(com.tencent.angel.ps.server.data.PSLocation) Int2IntOpenHashMap(it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) PSFailedReportProto(com.tencent.angel.protobuf.generated.MLProtos.PSFailedReportProto)

Aggregations

PSFailedReportProto (com.tencent.angel.protobuf.generated.MLProtos.PSFailedReportProto)1 PSLocation (com.tencent.angel.ps.server.data.PSLocation)1 Int2IntOpenHashMap (it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1