use of org.apache.tez.dag.recovery.records.RecoveryProtos.EdgeManagerDescriptorProto in project tez by apache.
the class VertexConfigurationDoneEvent method fromProto.
public void fromProto(VertexConfigurationDoneProto proto) {
this.vertexID = TezVertexID.fromString(proto.getVertexId());
this.reconfigureDoneTime = proto.getReconfigureDoneTime();
this.setParallelismCalledFlag = proto.getSetParallelismCalledFlag();
this.numTasks = proto.getNumTasks();
if (proto.hasVertexLocationHint()) {
this.vertexLocationHint = DagTypeConverters.convertVertexLocationHintFromProto(proto.getVertexLocationHint());
}
if (proto.getEdgeManagerDescriptorsCount() > 0) {
this.sourceEdgeProperties = new HashMap<String, EdgeProperty>(proto.getEdgeManagerDescriptorsCount());
for (EdgeManagerDescriptorProto edgeManagerProto : proto.getEdgeManagerDescriptorsList()) {
EdgeProperty edgeProperty = DagTypeConverters.convertFromProto(edgeManagerProto.getEdgeProperty());
sourceEdgeProperties.put(edgeManagerProto.getEdgeName(), edgeProperty);
}
}
if (proto.getRootInputSpecUpdatesCount() > 0) {
this.rootInputSpecUpdates = Maps.newHashMap();
for (RootInputSpecUpdateProto rootInputSpecUpdateProto : proto.getRootInputSpecUpdatesList()) {
InputSpecUpdate specUpdate;
if (rootInputSpecUpdateProto.getForAllWorkUnits()) {
specUpdate = InputSpecUpdate.createAllTaskInputSpecUpdate(rootInputSpecUpdateProto.getNumPhysicalInputs(0));
} else {
specUpdate = InputSpecUpdate.createPerTaskInputSpecUpdate(rootInputSpecUpdateProto.getNumPhysicalInputsList());
}
this.rootInputSpecUpdates.put(rootInputSpecUpdateProto.getInputName(), specUpdate);
}
}
}
Aggregations