hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1033804 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/Task.java
Date Thu, 11 Nov 2010 02:42:56 GMT
Author: matei
Date: Thu Nov 11 02:42:55 2010
New Revision: 1033804

URL: http://svn.apache.org/viewvc?rev=1033804&view=rev
Log:
MAPREDUCE-2141. Add an "extra data" field to Task for use by Mesos.


Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1033804&r1=1033803&r2=1033804&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Thu Nov 11 02:42:55 2010
@@ -23,6 +23,8 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
 
+    MAPREDUCE-2141. Add an "extra data" field to Task for use by Mesos. (matei)
+
     MAPREDUCE-2140. Regenerate fair scheduler design doc PDF. (matei)
 
     MAPREDUCE-1546. Redirect all job pages to corresponding history page

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java?rev=1033804&r1=1033803&r2=1033804&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/Task.java Thu Nov 11 02:42:55
2010
@@ -44,6 +44,7 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.LocalDirAllocator;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.FileSystem.Statistics;
+import org.apache.hadoop.io.BytesWritable;
 import org.apache.hadoop.io.DataInputBuffer;
 import org.apache.hadoop.io.RawComparator;
 import org.apache.hadoop.io.Text;
@@ -124,6 +125,11 @@ abstract public class Task implements Wr
   protected boolean jobCleanup = false;
   protected boolean jobSetup = false;
   protected boolean taskCleanup = false;
+ 
+  // An opaque data field used to attach extra data to each task. This is used
+  // by the Hadoop scheduler for Mesos to associate a Mesos task ID with each
+  // task and recover these IDs on the TaskTracker.
+  protected BytesWritable extraData = new BytesWritable(); 
   
   //skip ranges based on failed ranges from previous attempts
   private SortedRanges skipRanges = new SortedRanges();
@@ -409,6 +415,7 @@ abstract public class Task implements Wr
     out.writeBoolean(writeSkipRecs);
     out.writeBoolean(taskCleanup);
     Text.writeString(out, user);
+    extraData.write(out);
   }
   
   public void readFields(DataInput in) throws IOException {
@@ -433,6 +440,7 @@ abstract public class Task implements Wr
       setPhase(TaskStatus.Phase.CLEANUP);
     }
     user = Text.readString(in);
+    extraData.readFields(in);
   }
 
   @Override
@@ -1472,4 +1480,12 @@ abstract public class Task implements Wr
       reducer.run(reducerContext);
     } 
   }
+
+  BytesWritable getExtraData() {
+    return extraData;
+  }
+
+  void setExtraData(BytesWritable extraData) {
+    this.extraData = extraData;
+  }
 }



Mime
View raw message