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