use of com.tencent.angel.protobuf.generated.WorkerMasterServiceProtos.WorkerGroupMetaInfoProto in project angel by Tencent.
the class ProtobufUtil method buildWorkerGroupMeta.
private static WorkerGroupMetaInfoProto buildWorkerGroupMeta(AMWorkerGroup group, SplitClassification splits, Configuration conf) throws IOException {
WorkerGroupMetaInfoProto.Builder builder = WorkerGroupMetaInfoProto.newBuilder();
builder.setWorkerGroupId(convertToIdProto(group.getId()));
builder.setLeaderId(convertToIdProto(group.getLeader()));
for (AMWorker w : group.getWorkerSet()) {
builder.addWorkers(buildWorkerMetaProto(w));
}
if (splits != null) {
List<SplitInfo> splitInfoList = SerdeUtils.serilizeSplits(splits, conf);
SplitInfoProto.Builder splitBuilder = SplitInfoProto.newBuilder();
for (SplitInfo split : splitInfoList) {
builder.addSplits(splitBuilder.setSplitClass(split.getSplitClass()).setSplit(ByteString.copyFrom(split.getSplit())).build());
}
}
return builder.build();
}
Aggregations