tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject git commit: TEZ-1038. Move TaskLocationHint outside of VertexLocationHint. (Alexander Pivovarov via hitesh)
Date Tue, 26 Aug 2014 22:02:42 GMT
Repository: tez
Updated Branches:
  refs/heads/master 5018b65b4 -> 4cb52efde


TEZ-1038. Move TaskLocationHint outside of VertexLocationHint. (Alexander Pivovarov via hitesh)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/4cb52efd
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/4cb52efd
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/4cb52efd

Branch: refs/heads/master
Commit: 4cb52efded0b407d4edcf5d6c7ce9fbf6ea59459
Parents: 5018b65
Author: Hitesh Shah <hitesh@apache.org>
Authored: Tue Aug 26 13:46:21 2014 -0700
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Tue Aug 26 15:02:31 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../main/java/org/apache/tez/dag/api/DAG.java   |   6 +-
 .../apache/tez/dag/api/DagTypeConverters.java   |  13 +-
 .../tez/dag/api/DataSourceDescriptor.java       |   2 +-
 .../apache/tez/dag/api/TaskLocationHint.java    | 143 +++++++++++++++++++
 .../java/org/apache/tez/dag/api/Vertex.java     |   2 +-
 .../apache/tez/dag/api/VertexLocationHint.java  | 104 --------------
 .../tez/dag/api/VertexManagerPluginContext.java |   2 +-
 .../java/org/apache/tez/dag/app/dag/Vertex.java |   2 +-
 .../tez/dag/app/dag/impl/TaskAttemptImpl.java   |  10 +-
 .../apache/tez/dag/app/dag/impl/VertexImpl.java |   6 +-
 .../app/rm/AMSchedulerEventTALaunchRequest.java |   2 +-
 .../dag/app/rm/TaskSchedulerEventHandler.java   |   8 +-
 .../tez/dag/app/dag/impl/TestTaskAttempt.java   |  38 ++---
 .../tez/dag/app/dag/impl/TestTaskImpl.java      |   4 +-
 .../tez/dag/app/dag/impl/TestVertexImpl.java    |   4 +-
 .../tez/dag/app/rm/TestContainerReuse.java      |   4 +-
 .../TestHistoryEventsProtoConversion.java       |   4 +-
 .../apache/tez/mapreduce/client/YARNRunner.java |   7 +-
 .../tez/mapreduce/hadoop/InputSplitInfo.java    |   2 +-
 .../mapreduce/hadoop/InputSplitInfoDisk.java    |   2 +-
 .../tez/mapreduce/hadoop/InputSplitInfoMem.java |   2 +-
 .../tez/mapreduce/hadoop/MRInputHelpers.java    |  51 +++----
 .../mapreduce/hadoop/TestMRInputHelpers.java    |  13 +-
 .../vertexmanager/InputReadyVertexManager.java  |   4 +-
 25 files changed, 240 insertions(+), 196 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9326aa4..fbc1a60 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -12,6 +12,7 @@ INCOMPATIBLE CHANGES
 Release 0.5.0: Unreleased
 
 INCOMPATIBLE CHANGES
+  TEZ-1038. Move TaskLocationHint outside of VertexLocationHint.
   TEZ-960. VertexManagerPluginContext::getTotalAVailableResource() changed to
   VertexManagerPluginContext::getTotalAvailableResource()
   TEZ-1025. Rename tez.am.max.task.attempts to tez.am.task.max.failed.attempts 

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java b/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
index 0a95ff3..d063e79 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/DAG.java
@@ -47,7 +47,7 @@ import org.apache.tez.dag.api.EdgeProperty.DataMovementType;
 import org.apache.tez.dag.api.EdgeProperty.DataSourceType;
 import org.apache.tez.dag.api.EdgeProperty.SchedulingType;
 import org.apache.tez.dag.api.VertexGroup.GroupInfo;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.records.DAGProtos.ConfigurationProto;
 import org.apache.tez.dag.api.records.DAGProtos.DAGPlan;
 import org.apache.tez.dag.api.records.DAGProtos.EdgePlan;
@@ -708,8 +708,8 @@ public class DAG {
               throw new TezUncheckedException(
                   "Container affinity may not be specified via the DAG API");
             }
-            if (hint.getDataLocalHosts() != null) {
-              taskLocationHintBuilder.addAllHost(hint.getDataLocalHosts());
+            if (hint.getHosts() != null) {
+              taskLocationHintBuilder.addAllHost(hint.getHosts());
             }
             if (hint.getRacks() != null) {
               taskLocationHintBuilder.addAllRack(hint.getRacks());

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/DagTypeConverters.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/DagTypeConverters.java b/tez-api/src/main/java/org/apache/tez/dag/api/DagTypeConverters.java
index 8794b7e..6594f02 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/DagTypeConverters.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/DagTypeConverters.java
@@ -50,7 +50,6 @@ import org.apache.tez.common.counters.TezCounters;
 import org.apache.tez.dag.api.EdgeProperty.DataMovementType;
 import org.apache.tez.dag.api.EdgeProperty.DataSourceType;
 import org.apache.tez.dag.api.EdgeProperty.SchedulingType;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
 import org.apache.tez.dag.api.client.StatusGetOpts;
 import org.apache.tez.dag.api.client.rpc.DAGClientAMProtocolRPC.TezSessionStatusProto;
 import org.apache.tez.dag.api.records.DAGProtos;
@@ -174,7 +173,7 @@ public class DagTypeConverters {
     List<TaskLocationHint> outputList = new ArrayList<TaskLocationHint>();
 
     for(PlanTaskLocationHint inputHint : locationHints){
-      TaskLocationHint outputHint = new TaskLocationHint(
+      TaskLocationHint outputHint = TaskLocationHint.createTaskLocationHint(
           new HashSet<String>(inputHint.getHostList()),
           new HashSet<String>(inputHint.getRackList()));
       outputList.add(outputHint);
@@ -585,9 +584,9 @@ public class DagTypeConverters {
     List<TaskLocationHint> outputList = new ArrayList<TaskLocationHint>(
       proto.getTaskLocationHintsCount());
     for(PlanTaskLocationHint inputHint : proto.getTaskLocationHintsList()){
-      TaskLocationHint outputHint = new TaskLocationHint(
-        new HashSet<String>(inputHint.getHostList()),
-        new HashSet<String>(inputHint.getRackList()));
+      TaskLocationHint outputHint = TaskLocationHint.createTaskLocationHint(
+          new HashSet<String>(inputHint.getHostList()),
+          new HashSet<String>(inputHint.getRackList()));
       outputList.add(outputHint);
     }
 
@@ -603,8 +602,8 @@ public class DagTypeConverters {
         vertexLocationHint.getTaskLocationHints()) {
         PlanTaskLocationHint.Builder taskLHBuilder =
           PlanTaskLocationHint.newBuilder();
-        if (taskLocationHint.getDataLocalHosts() != null) {
-          taskLHBuilder.addAllHost(taskLocationHint.getDataLocalHosts());
+        if (taskLocationHint.getHosts() != null) {
+          taskLHBuilder.addAllHost(taskLocationHint.getHosts());
         }
         if (taskLocationHint.getRacks() != null) {
           taskLHBuilder.addAllRack(taskLocationHint.getRacks());

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/DataSourceDescriptor.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/DataSourceDescriptor.java b/tez-api/src/main/java/org/apache/tez/dag/api/DataSourceDescriptor.java
index 8d03705..78ddefa 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/DataSourceDescriptor.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/DataSourceDescriptor.java
@@ -26,7 +26,7 @@ import org.apache.hadoop.classification.InterfaceAudience;
 import org.apache.hadoop.classification.InterfaceAudience.Public;
 import org.apache.hadoop.security.Credentials;
 import org.apache.hadoop.yarn.api.records.LocalResource;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.runtime.api.InputInitializer;
 import org.apache.tez.runtime.api.events.InputDataInformationEvent;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/TaskLocationHint.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/TaskLocationHint.java b/tez-api/src/main/java/org/apache/tez/dag/api/TaskLocationHint.java
new file mode 100644
index 0000000..02f7bf9
--- /dev/null
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/TaskLocationHint.java
@@ -0,0 +1,143 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tez.dag.api;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.hadoop.classification.InterfaceAudience.Public;
+import org.apache.hadoop.classification.InterfaceStability.Evolving;
+import org.apache.hadoop.yarn.api.records.ContainerId;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * Describes the placements hints for tasks.
+ * The system will make a best-effort attempt to run the tasks 
+ * close to the specified locations.
+ */
+@Public
+@Evolving
+public class TaskLocationHint {
+
+  // Container to which to affinitize
+  ContainerId containerId;
+  // Host names if any to be used
+  private Set<String> hosts;
+  // Rack names if any to be used
+  private Set<String> racks;
+
+  private TaskLocationHint(ContainerId containerId) {
+    Preconditions.checkNotNull(containerId);
+    this.containerId = containerId;
+  }
+
+  private TaskLocationHint(Set<String> hosts, Set<String> racks) {
+    if (hosts != null) {
+      this.hosts = Collections.unmodifiableSet(hosts);
+    } else {
+      this.hosts = null;
+    }
+    if (racks != null) {
+      this.racks = Collections.unmodifiableSet(racks);
+    } else {
+      this.racks = null;
+    }
+  }
+
+  /**
+   * Provide a location hint using a container to which the task may be affinitized
+   * Tez will try to run the task on that container or node local to it
+   */
+  public static TaskLocationHint createTaskLocationHint(ContainerId containerId) {
+    return new TaskLocationHint(containerId);
+  }
+
+  /**
+   * Provides a location hint with nodes and racks at which the task may be executed.
+   * Tez will try to execute the task at those locations
+   */
+  public static TaskLocationHint createTaskLocationHint(Set<String> hosts, Set<String> racks) {
+    return new TaskLocationHint(hosts, racks);
+  }
+
+  public ContainerId getAffinitizedContainer() {
+    return containerId;
+  }
+
+  public Set<String> getHosts() {
+    return hosts;
+  }
+
+  public Set<String> getRacks() {
+    return racks;
+  }
+
+  @Override
+  public int hashCode() {
+    final int prime = 9397;
+    int result = 1;
+    result = ( hosts != null) ?
+        prime * result + hosts.hashCode() :
+        result + prime;
+    result = ( racks != null) ?
+        prime * result + racks.hashCode() :
+        result + prime;
+    result = ( containerId != null) ?
+        prime * result + containerId.hashCode() :
+        result + prime;
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (obj == null) {
+      return false;
+    }
+    if (getClass() != obj.getClass()) {
+      return false;
+    }
+    TaskLocationHint other = (TaskLocationHint) obj;
+    if (hosts != null) {
+      if (!hosts.equals(other.hosts)) {
+        return false;
+      }
+    } else if (other.hosts != null) {
+      return false;
+    }
+    if (racks != null) {
+      if (!racks.equals(other.racks)) {
+        return false;
+      }
+    } else if (other.racks != null) {
+      return false;
+    }
+    if (containerId != null) {
+      if (!containerId.equals(other.containerId)) {
+        return false;
+      }
+    } else if (other.containerId != null) {
+      return false;
+    }
+    return true;
+  }
+}

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/Vertex.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/Vertex.java b/tez-api/src/main/java/org/apache/tez/dag/api/Vertex.java
index 1df548a..0dffbef 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/Vertex.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/Vertex.java
@@ -30,7 +30,7 @@ import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.tez.common.TezCommonUtils;
 import org.apache.tez.dag.api.VertexGroup.GroupInfo;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.runtime.api.LogicalIOProcessor;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/VertexLocationHint.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/VertexLocationHint.java b/tez-api/src/main/java/org/apache/tez/dag/api/VertexLocationHint.java
index 2af46ea..c020dd2 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/VertexLocationHint.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/VertexLocationHint.java
@@ -20,12 +20,8 @@ package org.apache.tez.dag.api;
 
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.hadoop.classification.InterfaceAudience.Public;
-import org.apache.hadoop.yarn.api.records.ContainerId;
-
-import com.google.common.base.Preconditions;
 
 /**
  * Describes the placements hints for tasks in a vertex.
@@ -86,104 +82,4 @@ public class VertexLocationHint  {
     }
     return true;
   }
-
-  public static class TaskLocationHint {
-
-    // Container to which to affinitize
-    ContainerId containerId;
-    // Host names if any to be used
-    private Set<String> hosts;
-    // Rack names if any to be used
-    private Set<String> racks;
-
-    /**
-     * Provide a container to which the task may be affinitized
-     * Tez will try to run the task on that container or node local to it
-     */
-    public TaskLocationHint(ContainerId containerId) {
-      Preconditions.checkNotNull(containerId);
-      this.containerId = containerId;
-    }
-    
-    /**
-     * Provides nodes and racks at which the task may be executed.
-     * Tez will try to execute the task at those locations
-     */
-    public TaskLocationHint(Set<String> hosts, Set<String> racks) {
-      if (hosts != null) {
-        this.hosts = Collections.unmodifiableSet(hosts);
-      } else {
-        this.hosts = null;
-      }
-      if (racks != null) {
-        this.racks = Collections.unmodifiableSet(racks);
-      } else {
-        this.racks = null;
-      }
-    }
-
-    public ContainerId getAffinitizedContainer() {
-      return containerId;
-    }
-    
-    public Set<String> getDataLocalHosts() {
-      return hosts;
-    }
-
-    public Set<String> getRacks() {
-      return racks;
-    }
-
-    @Override
-    public int hashCode() {
-      final int prime = 9397;
-      int result = 1;
-      result = ( hosts != null) ?
-          prime * result + hosts.hashCode() :
-          result + prime;
-      result = ( racks != null) ?
-          prime * result + racks.hashCode() :
-          result + prime;
-      result = ( containerId != null) ?
-          prime * result + containerId.hashCode() :
-          result + prime;
-      return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-      if (this == obj) {
-        return true;
-      }
-      if (obj == null) {
-        return false;
-      }
-      if (getClass() != obj.getClass()) {
-        return false;
-      }
-      TaskLocationHint other = (TaskLocationHint) obj;
-      if (hosts != null) {
-        if (!hosts.equals(other.hosts)) {
-          return false;
-        }
-      } else if (other.hosts != null) {
-        return false;
-      }
-      if (racks != null) {
-        if (!racks.equals(other.racks)) {
-          return false;
-        }
-      } else if (other.racks != null) {
-        return false;
-      }
-      if (containerId != null) {
-        if (!containerId.equals(other.containerId)) {
-          return false;
-        }
-      } else if (other.containerId != null) {
-        return false;
-      }
-      return true;
-    }
-  }
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginContext.java
----------------------------------------------------------------------
diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginContext.java b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginContext.java
index 0d0a680..5bd8768 100644
--- a/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginContext.java
+++ b/tez-api/src/main/java/org/apache/tez/dag/api/VertexManagerPluginContext.java
@@ -29,7 +29,7 @@ import org.apache.hadoop.classification.InterfaceAudience.Public;
 import org.apache.hadoop.classification.InterfaceStability.Unstable;
 import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.api.records.Resource;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.runtime.api.InputSpecUpdate;
 import org.apache.tez.runtime.api.events.InputDataInformationEvent;
 

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/main/java/org/apache/tez/dag/app/dag/Vertex.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/Vertex.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/Vertex.java
index 6c48a93..23eb95e 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/Vertex.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/Vertex.java
@@ -34,7 +34,7 @@ import org.apache.tez.dag.api.OutputDescriptor;
 import org.apache.tez.dag.api.ProcessorDescriptor;
 import org.apache.tez.dag.api.RootInputLeafOutput;
 import org.apache.tez.dag.api.VertexLocationHint;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint;
 import org.apache.tez.dag.api.client.StatusGetOpts;
 import org.apache.tez.dag.api.records.DAGProtos.RootInputLeafOutputProto;

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskAttemptImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskAttemptImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskAttemptImpl.java
index 4d6715c..e63dbf5 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskAttemptImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskAttemptImpl.java
@@ -54,7 +54,7 @@ import org.apache.tez.common.counters.DAGCounter;
 import org.apache.tez.common.counters.TezCounters;
 import org.apache.tez.dag.api.ProcessorDescriptor;
 import org.apache.tez.dag.api.TezUncheckedException;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptReport;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.app.AppContext;
@@ -1081,12 +1081,12 @@ public class TaskAttemptImpl implements TaskAttempt,
         if (locationHint.getRacks() != null) {
           racks.addAll(locationHint.getRacks());
         }
-        if (locationHint.getDataLocalHosts() != null) {
-          for (String host : locationHint.getDataLocalHosts()) {
+        if (locationHint.getHosts() != null) {
+          for (String host : locationHint.getHosts()) {
             racks.add(RackResolver.resolve(host).getNetworkLocation());
           }
-          requestHosts = ta.resolveHosts(locationHint.getDataLocalHosts()
-              .toArray(new String[locationHint.getDataLocalHosts().size()]));
+          requestHosts = ta.resolveHosts(locationHint.getHosts()
+              .toArray(new String[locationHint.getHosts().size()]));
         }
       }
 

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
index 045c56b..361260e 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/VertexImpl.java
@@ -69,7 +69,7 @@ import org.apache.tez.dag.api.RootInputLeafOutput;
 import org.apache.tez.dag.api.TezUncheckedException;
 import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.dag.api.VertexLocationHint;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint;
 import org.apache.tez.dag.api.VertexManagerPluginDescriptor;
 import org.apache.tez.dag.api.client.ProgressBuilder;
@@ -3709,11 +3709,11 @@ public class VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
     for (TaskLocationHint taskLocationHint : locationHint
         .getTaskLocationHints()) {
       StringBuilder sb = new StringBuilder();
-      if (taskLocationHint.getDataLocalHosts() == null) {
+      if (taskLocationHint.getHosts() == null) {
         sb.append("No Hosts");
       } else {
         sb.append("Hosts: ");
-        for (String host : taskLocationHint.getDataLocalHosts()) {
+        for (String host : taskLocationHint.getHosts()) {
           hosts.add(host);
           sb.append(host).append(", ");
         }

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/main/java/org/apache/tez/dag/app/rm/AMSchedulerEventTALaunchRequest.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/AMSchedulerEventTALaunchRequest.java b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/AMSchedulerEventTALaunchRequest.java
index d484cd1..d7ebed9 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/AMSchedulerEventTALaunchRequest.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/AMSchedulerEventTALaunchRequest.java
@@ -19,7 +19,7 @@ package org.apache.tez.dag.app.rm;
 
 import org.apache.hadoop.yarn.api.records.Priority;
 import org.apache.hadoop.yarn.api.records.Resource;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.app.ContainerContext;
 import org.apache.tez.dag.app.dag.TaskAttempt;
 import org.apache.tez.dag.records.TezTaskAttemptID;

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
index 77b6e0e..b1b551a 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/rm/TaskSchedulerEventHandler.java
@@ -41,7 +41,7 @@ import org.apache.hadoop.yarn.event.Event;
 import org.apache.hadoop.yarn.event.EventHandler;
 import org.apache.tez.dag.api.TezConfiguration;
 import org.apache.tez.dag.api.TezUncheckedException;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.client.DAGClientServer;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.app.AppContext;
@@ -270,9 +270,9 @@ public class TaskSchedulerEventHandler extends AbstractService
             event);
         return;
       } else {
-        hosts = (locationHint.getDataLocalHosts() != null) ? locationHint
-            .getDataLocalHosts().toArray(
-                new String[locationHint.getDataLocalHosts().size()]) : null;
+        hosts = (locationHint.getHosts() != null) ? locationHint
+            .getHosts().toArray(
+                new String[locationHint.getHosts().size()]) : null;
         racks = (locationHint.getRacks() != null) ? locationHint.getRacks()
             .toArray(new String[locationHint.getRacks().size()]) : null;
       }

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
index d0c8f88..3633a85 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
@@ -56,7 +56,7 @@ import org.apache.hadoop.yarn.event.Event;
 import org.apache.hadoop.yarn.event.EventHandler;
 import org.apache.hadoop.yarn.util.Clock;
 import org.apache.hadoop.yarn.util.SystemClock;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.app.AppContext;
 import org.apache.tez.dag.app.ClusterInfo;
@@ -130,7 +130,7 @@ public class TestTaskAttempt {
     hosts.add("host1");
     hosts.add("host2");
     hosts.add("host3");
-    TaskLocationHint locationHint = new TaskLocationHint(hosts, null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(hosts, null);
 
     TezTaskID taskID = TezTaskID.getInstance(
         TezVertexID.getInstance(TezDAGID.getInstance("1", 1, 1), 1), 1);
@@ -171,7 +171,7 @@ public class TestTaskAttempt {
     String hosts[] = new String[] { "127.0.0.1", "host2", "host3" };
     Set<String> resolved = new TreeSet<String>(
         Arrays.asList(new String[]{ "host1", "host2", "host3" }));
-    TaskLocationHint locationHint = new TaskLocationHint(
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
         new TreeSet<String>(Arrays.asList(hosts)), null);
 
     TezTaskID taskID = TezTaskID.getInstance(
@@ -314,8 +314,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     AppContext mockAppContext = mock(AppContext.class);
@@ -364,8 +364,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);
@@ -455,8 +455,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);
@@ -517,8 +517,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);
@@ -604,8 +604,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);
@@ -690,8 +690,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);
@@ -784,8 +784,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);
@@ -874,8 +874,8 @@ public class TestTaskAttempt {
     taskConf.setClass("fs.file.impl", StubbedFS.class, FileSystem.class);
     taskConf.setBoolean("fs.file.impl.disable.cache", true);
 
-    TaskLocationHint locationHint = new TaskLocationHint(
-        new HashSet<String>(Arrays.asList(new String[] {"127.0.0.1"})), null);
+    TaskLocationHint locationHint = TaskLocationHint.createTaskLocationHint(
+        new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})), null);
     Resource resource = Resource.newInstance(1024, 1);
 
     NodeId nid = NodeId.newInstance("127.0.0.1", 0);

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskImpl.java
index 0fb593f..c1fcfc6 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskImpl.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskImpl.java
@@ -46,7 +46,7 @@ import org.apache.hadoop.yarn.event.Event;
 import org.apache.hadoop.yarn.event.EventHandler;
 import org.apache.hadoop.yarn.util.Clock;
 import org.apache.hadoop.yarn.util.SystemClock;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.api.oldrecords.TaskState;
 import org.apache.tez.dag.app.AppContext;
@@ -124,7 +124,7 @@ public class TestTaskImpl {
     taskHeartbeatHandler = mock(TaskHeartbeatHandler.class);
     credentials = new Credentials();
     clock = new SystemClock();
-    locationHint = new TaskLocationHint(null, null);
+    locationHint = TaskLocationHint.createTaskLocationHint(null, null);
 
     appId = ApplicationId.newInstance(System.currentTimeMillis(), 1);
     dagId = TezDAGID.getInstance(appId, 1);

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
index 7d698cc..6e2bd9d 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestVertexImpl.java
@@ -77,7 +77,7 @@ import org.apache.tez.dag.api.TezConfiguration;
 import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.dag.api.VertexLocationHint;
 import org.apache.tez.dag.api.EdgeProperty.DataMovementType;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.VertexManagerPlugin;
 import org.apache.tez.dag.api.VertexManagerPluginContext;
 import org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint;
@@ -3154,7 +3154,7 @@ public class TestVertexImpl {
     List<TaskLocationHint> locationHints = Lists
         .newArrayListWithCapacity(numTasks);
     for (int i = 0; i < numTasks; i++) {
-      TaskLocationHint taskLocationHint = new TaskLocationHint(
+      TaskLocationHint taskLocationHint = TaskLocationHint.createTaskLocationHint(
           Sets.newSet("host" + i), null);
       locationHints.add(taskLocationHint);
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
index bc4d94b..1118ee9 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/rm/TestContainerReuse.java
@@ -57,7 +57,7 @@ import org.apache.tez.dag.api.InputDescriptor;
 import org.apache.tez.dag.api.OutputDescriptor;
 import org.apache.tez.dag.api.ProcessorDescriptor;
 import org.apache.tez.dag.api.TezConfiguration;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.app.AppContext;
 import org.apache.tez.dag.app.ClusterInfo;
@@ -1105,7 +1105,7 @@ public class TestContainerReuse {
     if (hosts != null || racks != null) {
       Set<String> hostsSet = Sets.newHashSet(hosts);
       Set<String> racksSet = Sets.newHashSet(racks);
-      locationHint = new TaskLocationHint(hostsSet, racksSet);
+      locationHint = TaskLocationHint.createTaskLocationHint(hostsSet, racksSet);
     }
     AMSchedulerEventTALaunchRequest lr = new AMSchedulerEventTALaunchRequest(
       taID, capability, new TaskSpec(taID, "dagName", "vertexName", -1,

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java
index 8948bc3..72d0c25 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java
@@ -31,7 +31,7 @@ import org.apache.tez.common.counters.TezCounters;
 import org.apache.tez.dag.api.EdgeManagerPluginDescriptor;
 import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.dag.api.VertexLocationHint;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.api.oldrecords.TaskState;
 import org.apache.tez.dag.api.records.DAGProtos.DAGPlan;
@@ -312,7 +312,7 @@ public class TestHistoryEventsProtoConversion {
           new VertexParallelismUpdatedEvent(
               TezVertexID.getInstance(
                   TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 111),
-              100, VertexLocationHint.create(Arrays.asList(new TaskLocationHint(
+              100, VertexLocationHint.create(Arrays.asList(TaskLocationHint.createTaskLocationHint(
               new HashSet<String>(Arrays.asList("h1")),
               new HashSet<String>(Arrays.asList("r1"))))),
               sourceEdgeManagers, null);

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
index 515e910..d6c8057 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/client/YARNRunner.java
@@ -96,7 +96,7 @@ import org.apache.tez.dag.api.TezUncheckedException;
 import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.dag.api.Vertex;
 import org.apache.tez.dag.api.VertexLocationHint;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.client.DAGStatus;
 import org.apache.tez.dag.api.client.MRDAGClient;
 import org.apache.tez.dag.library.vertexmanager.ShuffleVertexManager;
@@ -346,9 +346,10 @@ public class YARNRunner implements ClientProtocol {
         new ArrayList<TaskLocationHint>(splitsCount);
     for (int i = 0; i < splitsCount; ++i) {
       TaskLocationHint locationHint =
-          new TaskLocationHint(
+          TaskLocationHint.createTaskLocationHint(
               new HashSet<String>(
-                  Arrays.asList(splitsInfo[i].getLocations())), null);
+                  Arrays.asList(splitsInfo[i].getLocations())), null
+          );
       locationHints.add(locationHint);
     }
     return locationHints;

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfo.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfo.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfo.java
index cb362ac..dfc152d 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfo.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfo.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.classification.InterfaceAudience.Private;
 import org.apache.hadoop.classification.InterfaceStability.Unstable;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.security.Credentials;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.mapreduce.protos.MRRuntimeProtos.MRSplitsProto;
 
 // TODO Fix this to be more usable. Interface is broken since half the methods apply to only a specific type.

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoDisk.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoDisk.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoDisk.java
index 5aeda3d..5cc0d8e 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoDisk.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoDisk.java
@@ -23,7 +23,7 @@ import java.util.List;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapreduce.InputSplit;
 import org.apache.hadoop.security.Credentials;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.mapreduce.protos.MRRuntimeProtos.MRSplitsProto;
 
 /**

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoMem.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoMem.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoMem.java
index b3fcdf2..d7873fc 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoMem.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/InputSplitInfoMem.java
@@ -25,7 +25,7 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.serializer.SerializationFactory;
 import org.apache.hadoop.security.Credentials;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.mapreduce.protos.MRRuntimeProtos.MRSplitsProto;
 
 import com.google.common.base.Preconditions;

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
index 9d6d56a..ca02809 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MRInputHelpers.java
@@ -63,6 +63,7 @@ import org.apache.hadoop.yarn.util.ConverterUtils;
 import org.apache.tez.common.TezUtils;
 import org.apache.tez.dag.api.DataSourceDescriptor;
 import org.apache.tez.dag.api.InputDescriptor;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.TezUncheckedException;
 import org.apache.tez.dag.api.UserPayload;
 import org.apache.tez.dag.api.VertexLocationHint;
@@ -301,14 +302,14 @@ public class MRInputHelpers {
     return splitInfoMem;
   }
 
-  private static List<VertexLocationHint.TaskLocationHint> createTaskLocationHintsFromSplits(
+  private static List<TaskLocationHint> createTaskLocationHintsFromSplits(
       org.apache.hadoop.mapreduce.InputSplit[] newFormatSplits) {
-    Iterable<VertexLocationHint.TaskLocationHint> iterable = Iterables
+    Iterable<TaskLocationHint> iterable = Iterables
         .transform(Arrays.asList(newFormatSplits),
-            new Function<org.apache.hadoop.mapreduce.InputSplit, VertexLocationHint.TaskLocationHint>() {
+            new Function<org.apache.hadoop.mapreduce.InputSplit, TaskLocationHint>() {
               @Override
 
-              public VertexLocationHint.TaskLocationHint apply(
+              public TaskLocationHint apply(
                   org.apache.hadoop.mapreduce.InputSplit input) {
                 try {
                   if (input instanceof TezGroupedSplit) {
@@ -316,17 +317,17 @@ public class MRInputHelpers {
                         ((org.apache.hadoop.mapreduce.split.TezGroupedSplit) input).getRack();
                     if (rack == null) {
                       if (input.getLocations() != null) {
-                        return new VertexLocationHint.TaskLocationHint(
+                        return TaskLocationHint.createTaskLocationHint(
                             new HashSet<String>(Arrays.asList(input.getLocations())), null);
                       } else {
-                        return new VertexLocationHint.TaskLocationHint(null, null);
+                        return TaskLocationHint.createTaskLocationHint(null, null);
                       }
                     } else {
-                      return new VertexLocationHint.TaskLocationHint(null,
+                      return TaskLocationHint.createTaskLocationHint(null,
                           Collections.singleton(rack));
                     }
                   } else {
-                    return new VertexLocationHint.TaskLocationHint(
+                    return TaskLocationHint.createTaskLocationHint(
                         new HashSet<String>(Arrays.asList(input.getLocations())), null);
                   }
                 } catch (IOException e) {
@@ -339,27 +340,27 @@ public class MRInputHelpers {
     return Lists.newArrayList(iterable);
   }
 
-  private static List<VertexLocationHint.TaskLocationHint> createTaskLocationHintsFromSplits(
+  private static List<TaskLocationHint> createTaskLocationHintsFromSplits(
       org.apache.hadoop.mapred.InputSplit[] oldFormatSplits) {
-    Iterable<VertexLocationHint.TaskLocationHint> iterable = Iterables.transform(Arrays.asList(oldFormatSplits),
-        new Function<org.apache.hadoop.mapred.InputSplit, VertexLocationHint.TaskLocationHint>() {
+    Iterable<TaskLocationHint> iterable = Iterables.transform(Arrays.asList(oldFormatSplits),
+        new Function<org.apache.hadoop.mapred.InputSplit, TaskLocationHint>() {
           @Override
-          public VertexLocationHint.TaskLocationHint apply(org.apache.hadoop.mapred.InputSplit input) {
+          public TaskLocationHint apply(org.apache.hadoop.mapred.InputSplit input) {
             try {
               if (input instanceof org.apache.hadoop.mapred.split.TezGroupedSplit) {
                 String rack = ((org.apache.hadoop.mapred.split.TezGroupedSplit) input).getRack();
                 if (rack == null) {
                   if (input.getLocations() != null) {
-                    return new VertexLocationHint.TaskLocationHint(new HashSet<String>(Arrays.asList(
+                    return TaskLocationHint.createTaskLocationHint(new HashSet<String>(Arrays.asList(
                         input.getLocations())), null);
                   } else {
-                    return new VertexLocationHint.TaskLocationHint(null, null);
+                    return TaskLocationHint.createTaskLocationHint(null, null);
                   }
                 } else {
-                  return new VertexLocationHint.TaskLocationHint(null, Collections.singleton(rack));
+                  return TaskLocationHint.createTaskLocationHint(null, Collections.singleton(rack));
                 }
               } else {
-                return new VertexLocationHint.TaskLocationHint(
+                return TaskLocationHint.createTaskLocationHint(
                     new HashSet<String>(Arrays.asList(input.getLocations())),
                     null);
               }
@@ -520,12 +521,13 @@ public class MRInputHelpers {
     JobSplitWriter.createSplitFiles(inputSplitDir, conf,
         inputSplitDir.getFileSystem(conf), splits);
 
-    List<VertexLocationHint.TaskLocationHint> locationHints =
-        new ArrayList<VertexLocationHint.TaskLocationHint>(splits.length);
+    List<TaskLocationHint> locationHints =
+        new ArrayList<TaskLocationHint>(splits.length);
     for (int i = 0; i < splits.length; ++i) {
       locationHints.add(
-          new VertexLocationHint.TaskLocationHint(new HashSet<String>(
-              Arrays.asList(splits[i].getLocations())), null));
+          TaskLocationHint.createTaskLocationHint(new HashSet<String>(
+              Arrays.asList(splits[i].getLocations())), null)
+      );
     }
 
     return new InputSplitInfoDisk(
@@ -554,12 +556,13 @@ public class MRInputHelpers {
     JobSplitWriter.createSplitFiles(inputSplitDir, jobConf,
         inputSplitDir.getFileSystem(jobConf), splits);
 
-    List<VertexLocationHint.TaskLocationHint> locationHints =
-        new ArrayList<VertexLocationHint.TaskLocationHint>(splits.length);
+    List<TaskLocationHint> locationHints =
+        new ArrayList<TaskLocationHint>(splits.length);
     for (int i = 0; i < splits.length; ++i) {
       locationHints.add(
-          new VertexLocationHint.TaskLocationHint(new HashSet<String>(
-              Arrays.asList(splits[i].getLocations())), null));
+          TaskLocationHint.createTaskLocationHint(new HashSet<String>(
+              Arrays.asList(splits[i].getLocations())), null)
+      );
     }
 
     return new InputSplitInfoDisk(

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRInputHelpers.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRInputHelpers.java b/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRInputHelpers.java
index c5f81a9..e2bd1bb 100644
--- a/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRInputHelpers.java
+++ b/tez-mapreduce/src/test/java/org/apache/tez/mapreduce/hadoop/TestMRInputHelpers.java
@@ -42,7 +42,7 @@ import org.apache.hadoop.mapreduce.split.SplitMetaInfoReader;
 import org.apache.hadoop.yarn.api.records.LocalResource;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.tez.dag.api.DataSourceDescriptor;
-import org.apache.tez.dag.api.VertexLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -187,18 +187,19 @@ public class TestMRInputHelpers {
   }
 
   private void verifyLocationHints(Path inputSplitsDir,
-                                   List<VertexLocationHint.TaskLocationHint> actual) throws Exception {
+                                   List<TaskLocationHint> actual) throws Exception {
     JobID jobId = new JobID("dummy", 1);
     JobSplit.TaskSplitMetaInfo[] splitsInfo =
         SplitMetaInfoReader.readSplitMetaInfo(jobId, remoteFs,
             conf, inputSplitsDir);
     int splitsCount = splitsInfo.length;
-    List<VertexLocationHint.TaskLocationHint> locationHints =
-        new ArrayList<VertexLocationHint.TaskLocationHint>(splitsCount);
+    List<TaskLocationHint> locationHints =
+        new ArrayList<TaskLocationHint>(splitsCount);
     for (int i = 0; i < splitsCount; ++i) {
       locationHints.add(
-          new VertexLocationHint.TaskLocationHint(new HashSet<String>(
-              Arrays.asList(splitsInfo[i].getLocations())), null));
+          TaskLocationHint.createTaskLocationHint(new HashSet<String>(
+              Arrays.asList(splitsInfo[i].getLocations())), null)
+      );
     }
 
     Assert.assertEquals(locationHints, actual);

http://git-wip-us.apache.org/repos/asf/tez/blob/4cb52efd/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
----------------------------------------------------------------------
diff --git a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
index de487be..6633933 100644
--- a/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
+++ b/tez-runtime-library/src/main/java/org/apache/tez/dag/library/vertexmanager/InputReadyVertexManager.java
@@ -29,7 +29,7 @@ import org.apache.tez.dag.api.EdgeProperty;
 import org.apache.tez.dag.api.EdgeProperty.DataMovementType;
 import org.apache.tez.dag.api.InputDescriptor;
 import org.apache.tez.dag.api.TezUncheckedException;
-import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
+import org.apache.tez.dag.api.TaskLocationHint;
 import org.apache.tez.dag.api.VertexManagerPlugin;
 import org.apache.tez.dag.api.VertexManagerPluginContext;
 import org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint;
@@ -192,7 +192,7 @@ public class InputReadyVertexManager extends VertexManagerPlugin {
           taskIsStarted[i] = true;
           TaskLocationHint locationHint = null;
           if (oneToOneLocationHints[i] != null) {
-            locationHint = new TaskLocationHint(oneToOneLocationHints[i].getId());
+            locationHint = TaskLocationHint.createTaskLocationHint(oneToOneLocationHints[i].getId());
           }
           LOG.info("Starting task " + i + " for vertex: "
               + getContext().getVertexName() + " with location: "


Mime
View raw message