tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bi...@apache.org
Subject git commit: TEZ-437. Make newmapreduce.TaskAttemptContextImpl use TezTaskContext (bikas)
Date Thu, 12 Sep 2013 17:45:13 GMT
Updated Branches:
  refs/heads/TEZ-398 7974742bf -> 8731540a9


TEZ-437. Make newmapreduce.TaskAttemptContextImpl use TezTaskContext (bikas)


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

Branch: refs/heads/TEZ-398
Commit: 8731540a966cbd9bd31080be6f1b885ce98849de
Parents: 7974742
Author: Bikas Saha <bikas@apache.org>
Authored: Thu Sep 12 10:43:59 2013 -0700
Committer: Bikas Saha <bikas@apache.org>
Committed: Thu Sep 12 10:43:59 2013 -0700

----------------------------------------------------------------------
 .../newmapreduce/TaskAttemptContextImpl.java    | 25 ++++++++++----------
 .../tez/mapreduce/newinput/SimpleInput.java     |  2 +-
 2 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/8731540a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/newmapreduce/TaskAttemptContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/newmapreduce/TaskAttemptContextImpl.java
b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/newmapreduce/TaskAttemptContextImpl.java
index 5b70b31..fa9d770 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/newmapreduce/TaskAttemptContextImpl.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/newmapreduce/TaskAttemptContextImpl.java
@@ -24,7 +24,7 @@ import org.apache.hadoop.mapred.TaskAttemptID;
 import org.apache.hadoop.mapred.TaskID;
 import org.apache.hadoop.mapreduce.Counter;
 import org.apache.hadoop.mapreduce.TaskType;
-import org.apache.tez.engine.newapi.TezInputContext;
+import org.apache.tez.engine.newapi.TezTaskContext;
 import org.apache.tez.mapreduce.common.Utils;
 
 // NOTE: NEWTEZ: This is a copy of org.apache.tez.mapreduce.hadoop.mapred (not mapreduce).
mapred likely does not need it's own copy of this class.
@@ -34,19 +34,18 @@ import org.apache.tez.mapreduce.common.Utils;
 @InterfaceStability.Unstable
 public class TaskAttemptContextImpl
        extends org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl {
-  private TezInputContext inputContext;
+  private TezTaskContext taskContext;
 
   // FIXME we need to use DAG Id but we are using App Id
-  public TaskAttemptContextImpl(Configuration conf, TezInputContext inputContext) {
-    // TODO NEWTEZ Figure out how to compute the TaskType - MAP or REDUCE. For
-    // SimpleInput, it likely doesn't matter - but setting it to MAP
-    // TODO NEWTEZ Can the jt Identifier string be inputContext.getUniqueId ?
+  public TaskAttemptContextImpl(Configuration conf,
+      TezTaskContext taskContext, boolean isMap) {
+    // TODO NEWTEZ Can the jt Identifier string be taskContext.getUniqueId ?
     super(conf, new TaskAttemptID(
-        new TaskID(String.valueOf(inputContext.getApplicationId()
-            .getClusterTimestamp()), inputContext.getApplicationId().getId(),
-            TaskType.MAP, inputContext.getTaskIndex()),
-        inputContext.getAttemptNumber()));
-    this.inputContext = inputContext;
+        new TaskID(String.valueOf(taskContext.getApplicationId()
+            .getClusterTimestamp()), taskContext.getApplicationId().getId(),
+            TaskType.MAP, taskContext.getTaskIndex()),
+        taskContext.getAttemptNumber()));
+    this.taskContext = taskContext;
     
   }
   
@@ -58,12 +57,12 @@ public class TaskAttemptContextImpl
 
   @Override
   public Counter getCounter(Enum<?> counterName) {
-    return Utils.getMRCounter(inputContext.getCounters().findCounter(counterName));
+    return Utils.getMRCounter(taskContext.getCounters().findCounter(counterName));
   }
 
   @Override
   public Counter getCounter(String groupName, String counterName) {
-    return Utils.getMRCounter(inputContext.getCounters().findCounter(groupName, counterName));
+    return Utils.getMRCounter(taskContext.getCounters().findCounter(groupName, counterName));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/8731540a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/newinput/SimpleInput.java
----------------------------------------------------------------------
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/newinput/SimpleInput.java
b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/newinput/SimpleInput.java
index 616ce35..4e4006a 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/newinput/SimpleInput.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/newinput/SimpleInput.java
@@ -265,7 +265,7 @@ public class SimpleInput implements LogicalInput {
 
   
   private TaskAttemptContext createTaskAttemptContext() {
-    return new TaskAttemptContextImpl(this.jobConf, inputContext);
+    return new TaskAttemptContextImpl(this.jobConf, inputContext, true);
   }
   
 


Mime
View raw message