use of org.apache.tez.dag.recovery.records.RecoveryProtos.TaskAttemptFinishedProto in project tez by apache.
the class TaskAttemptFinishedEvent method toProto.
public TaskAttemptFinishedProto toProto() throws IOException {
TaskAttemptFinishedProto.Builder builder = TaskAttemptFinishedProto.newBuilder();
builder.setTaskAttemptId(taskAttemptId.toString()).setState(state.ordinal()).setCreationTime(creationTime).setAllocationTime(allocationTime).setStartTime(startTime).setFinishTime(finishTime);
if (taskFailureType != null) {
builder.setTaskFailureType(TezConverterUtils.failureTypeToProto(taskFailureType));
}
if (creationCausalTA != null) {
builder.setCreationCausalTA(creationCausalTA.toString());
}
if (diagnostics != null) {
builder.setDiagnostics(diagnostics);
}
if (error != null) {
builder.setErrorEnum(error.name());
}
if (tezCounters != null) {
builder.setCounters(DagTypeConverters.convertTezCountersToProto(tezCounters));
}
if (dataEvents != null && !dataEvents.isEmpty()) {
for (DataEventDependencyInfo info : dataEvents) {
builder.addDataEvents(DataEventDependencyInfo.toProto(info));
}
}
if (taGeneratedEvents != null && !taGeneratedEvents.isEmpty()) {
for (TezEvent event : taGeneratedEvents) {
builder.addTaGeneratedEvents(TezEventUtils.toProto(event));
}
}
if (containerId != null) {
builder.setContainerId(containerId.toString());
}
if (nodeId != null) {
builder.setNodeId(nodeId.toString());
}
if (nodeHttpAddress != null) {
builder.setNodeHttpAddress(nodeHttpAddress);
}
return builder.build();
}
use of org.apache.tez.dag.recovery.records.RecoveryProtos.TaskAttemptFinishedProto in project tez by apache.
the class TaskAttemptFinishedEvent method fromProtoStream.
@Override
public void fromProtoStream(InputStream inputStream) throws IOException {
TaskAttemptFinishedProto proto = TaskAttemptFinishedProto.parseDelimitedFrom(inputStream);
if (proto == null) {
throw new IOException("No data found in stream");
}
fromProto(proto);
}
Aggregations