Search in sources :

Example 1 with TezEventProto

use of org.apache.tez.dag.recovery.records.RecoveryProtos.TezEventProto 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();
    }
}
Also used : DataEventDependencyInfoProto(org.apache.tez.dag.recovery.records.RecoveryProtos.DataEventDependencyInfoProto) TezEventProto(org.apache.tez.dag.recovery.records.RecoveryProtos.TezEventProto)

Example 2 with TezEventProto

use of org.apache.tez.dag.recovery.records.RecoveryProtos.TezEventProto in project tez by apache.

the class VertexInitializedEvent method fromProto.

public void fromProto(RecoveryProtos.VertexInitializedProto proto) throws IOException {
    this.vertexID = TezVertexID.fromString(proto.getVertexId());
    this.vertexName = proto.getVertexName();
    this.initRequestedTime = proto.getInitRequestedTime();
    this.initedTime = proto.getInitTime();
    this.numTasks = proto.getNumTasks();
    if (proto.getInputsCount() > 0) {
        this.additionalInputs = new LinkedHashMap<String, RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor>>();
        for (RootInputLeafOutputProto inputProto : proto.getInputsList()) {
            RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor> input = new RootInputLeafOutput<InputDescriptor, InputInitializerDescriptor>(inputProto.getName(), DagTypeConverters.convertInputDescriptorFromDAGPlan(inputProto.getIODescriptor()), inputProto.hasControllerDescriptor() ? DagTypeConverters.convertInputInitializerDescriptorFromDAGPlan(inputProto.getControllerDescriptor()) : null);
            additionalInputs.put(input.getName(), input);
        }
    }
    int eventCount = proto.getInitGeneratedEventsCount();
    if (eventCount > 0) {
        this.initGeneratedEvents = Lists.newArrayListWithCapacity(eventCount);
    }
    for (TezEventProto eventProto : proto.getInitGeneratedEventsList()) {
        this.initGeneratedEvents.add(TezEventUtils.fromProto(eventProto));
    }
}
Also used : RootInputLeafOutput(org.apache.tez.dag.api.RootInputLeafOutput) InputDescriptor(org.apache.tez.dag.api.InputDescriptor) RootInputLeafOutputProto(org.apache.tez.dag.api.records.DAGProtos.RootInputLeafOutputProto) InputInitializerDescriptor(org.apache.tez.dag.api.InputInitializerDescriptor) TezEventProto(org.apache.tez.dag.recovery.records.RecoveryProtos.TezEventProto)

Aggregations

TezEventProto (org.apache.tez.dag.recovery.records.RecoveryProtos.TezEventProto)2 InputDescriptor (org.apache.tez.dag.api.InputDescriptor)1 InputInitializerDescriptor (org.apache.tez.dag.api.InputInitializerDescriptor)1 RootInputLeafOutput (org.apache.tez.dag.api.RootInputLeafOutput)1 RootInputLeafOutputProto (org.apache.tez.dag.api.records.DAGProtos.RootInputLeafOutputProto)1 DataEventDependencyInfoProto (org.apache.tez.dag.recovery.records.RecoveryProtos.DataEventDependencyInfoProto)1