use of org.apache.tez.dag.recovery.records.RecoveryProtos.DataEventDependencyInfoProto in project tez by apache.
the class TaskAttemptFinishedEvent method fromProto.
public void fromProto(TaskAttemptFinishedProto proto) throws IOException {
this.taskAttemptId = TezTaskAttemptID.fromString(proto.getTaskAttemptId());
this.state = TaskAttemptState.values()[proto.getState()];
this.creationTime = proto.getCreationTime();
this.allocationTime = proto.getAllocationTime();
this.startTime = proto.getStartTime();
this.finishTime = proto.getFinishTime();
if (proto.hasTaskFailureType()) {
this.taskFailureType = TezConverterUtils.failureTypeFromProto(proto.getTaskFailureType());
}
if (proto.hasCreationCausalTA()) {
this.creationCausalTA = TezTaskAttemptID.fromString(proto.getCreationCausalTA());
}
if (proto.hasDiagnostics()) {
this.diagnostics = proto.getDiagnostics();
}
if (proto.hasErrorEnum()) {
this.error = TaskAttemptTerminationCause.valueOf(proto.getErrorEnum());
}
if (proto.hasCounters()) {
this.tezCounters = DagTypeConverters.convertTezCountersFromProto(proto.getCounters());
}
if (proto.getDataEventsCount() > 0) {
this.dataEvents = Lists.newArrayListWithCapacity(proto.getDataEventsCount());
for (DataEventDependencyInfoProto protoEvent : proto.getDataEventsList()) {
this.dataEvents.add(DataEventDependencyInfo.fromProto(protoEvent));
}
}
if (proto.getTaGeneratedEventsCount() > 0) {
this.taGeneratedEvents = Lists.newArrayListWithCapacity(proto.getTaGeneratedEventsCount());
for (TezEventProto eventProto : proto.getTaGeneratedEventsList()) {
this.taGeneratedEvents.add(TezEventUtils.fromProto(eventProto));
}
}
if (proto.hasContainerId()) {
this.containerId = ConverterUtils.toContainerId(proto.getContainerId());
}
if (proto.hasNodeId()) {
this.nodeId = ConverterUtils.toNodeId(proto.getNodeId());
}
if (proto.hasNodeHttpAddress()) {
this.nodeHttpAddress = proto.getNodeHttpAddress();
}
}
Aggregations