Search in sources :

Example 1 with EdgeManagerDescriptorProto

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);
        }
    }
}
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

EdgeProperty (org.apache.tez.dag.api.EdgeProperty)1 EdgeManagerDescriptorProto (org.apache.tez.dag.recovery.records.RecoveryProtos.EdgeManagerDescriptorProto)1 RootInputSpecUpdateProto (org.apache.tez.dag.recovery.records.RecoveryProtos.RootInputSpecUpdateProto)1 InputSpecUpdate (org.apache.tez.runtime.api.InputSpecUpdate)1