Search in sources :

Example 1 with PlanTaskLocationHint

use of org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint in project tez by apache.

the class DagTypeConverters method convertVertexLocationHintFromProto.

public static VertexLocationHint convertVertexLocationHintFromProto(VertexLocationHintProto proto) {
    List<TaskLocationHint> outputList = new ArrayList<TaskLocationHint>(proto.getTaskLocationHintsCount());
    for (PlanTaskLocationHint inputHint : proto.getTaskLocationHintsList()) {
        TaskLocationHint outputHint = TaskLocationHint.createTaskLocationHint(new HashSet<String>(inputHint.getHostList()), new HashSet<String>(inputHint.getRackList()));
        outputList.add(outputHint);
    }
    return VertexLocationHint.create(outputList);
}
Also used : PlanTaskLocationHint(org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint) PlanTaskLocationHint(org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint) ArrayList(java.util.ArrayList) ByteString(com.google.protobuf.ByteString)

Example 2 with PlanTaskLocationHint

use of org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint in project tez by apache.

the class DagTypeConverters method convertFromDAGPlan.

public static VertexLocationHint convertFromDAGPlan(List<PlanTaskLocationHint> locationHints) {
    List<TaskLocationHint> outputList = new ArrayList<TaskLocationHint>();
    for (PlanTaskLocationHint inputHint : locationHints) {
        TaskLocationHint outputHint = TaskLocationHint.createTaskLocationHint(new HashSet<String>(inputHint.getHostList()), new HashSet<String>(inputHint.getRackList()));
        outputList.add(outputHint);
    }
    return VertexLocationHint.create(outputList);
}
Also used : PlanTaskLocationHint(org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint) PlanTaskLocationHint(org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint) ArrayList(java.util.ArrayList) ByteString(com.google.protobuf.ByteString)

Aggregations

ByteString (com.google.protobuf.ByteString)2 ArrayList (java.util.ArrayList)2 PlanTaskLocationHint (org.apache.tez.dag.api.records.DAGProtos.PlanTaskLocationHint)2