Search in sources :

Example 6 with InputSpecUpdate

use of org.apache.tez.runtime.api.InputSpecUpdate 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);
        }
    }
}
Also used : RootInputSpecUpdateProto(org.apache.tez.dag.recovery.records.RecoveryProtos.RootInputSpecUpdateProto) EdgeProperty(org.apache.tez.dag.api.EdgeProperty) InputSpecUpdate(org.apache.tez.runtime.api.InputSpecUpdate) EdgeManagerDescriptorProto(org.apache.tez.dag.recovery.records.RecoveryProtos.EdgeManagerDescriptorProto)

Aggregations

InputSpecUpdate (org.apache.tez.runtime.api.InputSpecUpdate)6 HashMap (java.util.HashMap)5 EdgeProperty (org.apache.tez.dag.api.EdgeProperty)3 ArrayList (java.util.ArrayList)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 TaskLocationHint (org.apache.tez.dag.api.TaskLocationHint)2 VertexLocationHint (org.apache.tez.dag.api.VertexLocationHint)2 TaskRecoveryData (org.apache.tez.dag.app.RecoveryParser.TaskRecoveryData)2 VertexRecoveryData (org.apache.tez.dag.app.RecoveryParser.VertexRecoveryData)2 DAGInitializedEvent (org.apache.tez.dag.history.events.DAGInitializedEvent)2 DAGStartedEvent (org.apache.tez.dag.history.events.DAGStartedEvent)2 VertexConfigurationDoneEvent (org.apache.tez.dag.history.events.VertexConfigurationDoneEvent)2 VertexInitializedEvent (org.apache.tez.dag.history.events.VertexInitializedEvent)2 VertexStartedEvent (org.apache.tez.dag.history.events.VertexStartedEvent)2 TezTaskID (org.apache.tez.dag.records.TezTaskID)2 TezEvent (org.apache.tez.runtime.api.impl.TezEvent)2 IOException (java.io.IOException)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 InvalidStateTransitonException (org.apache.hadoop.yarn.state.InvalidStateTransitonException)1