Index: src/mapred/org/apache/hadoop/mapreduce/Counter.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/Counter.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/Counter.java	(revision 0)
@@ -0,0 +1,64 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+import java.io.DataInput;
+import java.io.DataOutput;
+
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableUtils;
+
+public class Counter implements Writable {
+
+  private String displayName;
+  private long value;
+    
+  Counter() { 
+    value = 0L;
+  }
+
+  Counter(String displayName, long value) {
+    this.displayName = displayName;
+    this.value = value;
+  }
+    
+  /**
+   * Read the binary representation of the counter
+   */
+  public synchronized void readFields(DataInput in) throws IOException {
+    displayName = Text.readString(in);
+    value = WritableUtils.readVLong(in);
+  }
+    
+  /**
+   * Write the binary representation of the counter
+   */
+  public synchronized void write(DataOutput out) throws IOException {
+    Text.writeString(out, displayName);
+    WritableUtils.writeVLong(out, value);
+  }
+    
+  /**
+   * Get the name of the counter.
+   * @return the user facing name of the counter
+   */
+  public String getDisplayName() {
+    return displayName;
+  }
+    
+  /**
+   * What is the current value of this counter?
+   * @return the current value
+   */
+  public synchronized long getValue() {
+    return value;
+  }
+    
+  /**
+   * Increment this counter by the given value
+   * @param incr the value to increase this counter by
+   */
+  public synchronized void increment(long incr) {
+    value += incr;
+  }
+}
Index: src/mapred/org/apache/hadoop/mapreduce/JobConf.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/JobConf.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/JobConf.java	(revision 0)
@@ -0,0 +1,4 @@
+package org.apache.hadoop.mapreduce;
+
+public class JobConf extends org.apache.hadoop.mapred.JobConf {
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/RecordReader.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/RecordReader.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/RecordReader.java	(revision 0)
@@ -0,0 +1,17 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+
+public abstract class RecordReader<KEYIN, VALUEIN> {
+  
+  public abstract KEYIN createKey();
+  public abstract VALUEIN createValue();
+  public abstract boolean next(KEYIN key, VALUEIN value) throws IOException;
+  public abstract KEYIN getKey();
+  public abstract VALUEIN getValue();
+  
+  public abstract long getPos() throws IOException;
+  public abstract float getProgress() throws IOException;
+  
+  public abstract void close() throws IOException;
+}
Index: src/mapred/org/apache/hadoop/mapreduce/MapContext.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/MapContext.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/MapContext.java	(revision 0)
@@ -0,0 +1,11 @@
+package org.apache.hadoop.mapreduce;
+
+public abstract class MapContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> 
+  extends Context<KEYIN,VALUEIN,KEYOUT,VALUEOUT> {
+
+  /**
+   * Get the input split for this map.
+   */
+  public abstract InputSplit getInputSplit();
+}
+     
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/Context.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/Context.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/Context.java	(revision 0)
@@ -0,0 +1,66 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+import org.apache.hadoop.util.Progressable;
+
+public abstract class Context<KEYIN, VALUEIN, KEYOUT, VALUEOUT> 
+    implements Progressable {
+
+  /**
+   * Return the current input key. The object will likely be re-used.
+   * Will be null if there is no input.
+   */
+  public abstract KEYIN getKey();
+
+  /**
+   * Return the current input value. The object will likely be re-used.
+   * Will be null if there is no input.
+   */
+  public abstract VALUEIN getValue();
+
+  /**
+   * Generate an output key/value pair.
+   */
+  public abstract void collect(KEYOUT key, VALUEOUT value) throws IOException;
+
+  /**
+   * Get the unique name for this task attempt.
+   */
+  public abstract String getTaskAttemptId();
+
+  /**
+   * Advance to the next key, returning false if at end. Only needed if
+   * the application needs to control the iteration (eg. MapRunables)
+   * Updates both the current input key and value, if it returns true.
+   */
+  public abstract boolean nextKey() throws IOException;
+
+  /**
+   * Get the input key class, even if there are no inputs.
+   */
+  public abstract Class<? extends KEYIN> getInputKeyClass();
+
+  /**
+   * Get the input value class, even if there are no inputs.
+   */
+  public abstract Class<? extends VALUEIN> getInputValueClass();
+
+  public abstract JobConf getJobConf();
+
+  /**
+   * Set the current status of the task to the given string.
+   */
+  public abstract void setStatus(String msg) throws IOException;
+
+  /**
+   * Lookup a counter by an enum.
+   */
+  public abstract Counter getCounter(Enum<?> counterName);
+
+  /**
+   * Lookup a counter by groupname and id. The enum-based interface is
+   * prefered.
+   */
+  public abstract Counter getCounter(String groupName, int id, 
+                                     String counterName);
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/Mapper.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/Mapper.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/Mapper.java	(revision 0)
@@ -0,0 +1,15 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+
+public abstract class Mapper<C extends MapContext> implements Closeable<C> {
+
+  /**
+   * Will be called once per an input key
+   */
+  public abstract void map(C context) throws IOException;
+
+  public void close(C context) throws IOException {
+    // NOTHING
+  }
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/lib/IdentityReducer.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/lib/IdentityReducer.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/lib/IdentityReducer.java	(revision 0)
@@ -0,0 +1,16 @@
+package org.apache.hadoop.mapreduce.lib;
+
+import java.io.IOException;
+
+import org.apache.hadoop.mapreduce.ReduceContext;
+import org.apache.hadoop.mapreduce.Reducer;
+
+public class IdentityReducer<Key,Value, 
+                             C extends ReduceContext<Key,Value,Key,Value>>
+  extends Reducer<C> {
+
+  public void reduce(C context) throws IOException {
+    context.collect(context.getKey(), context.getValue());
+  }
+
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/lib/TokenCounterMapper.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/lib/TokenCounterMapper.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/lib/TokenCounterMapper.java	(revision 0)
@@ -0,0 +1,25 @@
+package org.apache.hadoop.mapreduce.lib;
+
+import java.io.IOException;
+import java.util.StringTokenizer;
+
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.MapContext;
+import org.apache.hadoop.mapreduce.Mapper;
+
+public class TokenCounterMapper<C extends MapContext<?, Text, 
+                                                     Text, IntWritable>> 
+  extends Mapper<C> {
+    
+  private final static IntWritable one = new IntWritable(1);
+  private Text word = new Text();
+    
+  public void map(C context) throws IOException {
+    StringTokenizer itr = new StringTokenizer(context.getValue().toString());
+    while (itr.hasMoreTokens()) {
+      word.set(itr.nextToken());
+      context.collect(word, one);
+    }
+  }
+}
Index: src/mapred/org/apache/hadoop/mapreduce/lib/IntSumReducer.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/lib/IntSumReducer.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/lib/IntSumReducer.java	(revision 0)
@@ -0,0 +1,24 @@
+package org.apache.hadoop.mapreduce.lib;
+
+import java.io.IOException;
+
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.mapreduce.ReduceContext;
+import org.apache.hadoop.mapreduce.Reducer;
+
+public class IntSumReducer<Key,C extends ReduceContext<Key,IntWritable,
+                                                       Key,IntWritable>>
+    extends Reducer<C> {
+
+  private IntWritable result = new IntWritable();
+
+  public void reduce(C context) throws IOException {
+    int sum = 0;
+    for (IntWritable val : context) {
+      sum += val.get();
+    }
+    result.set(sum);
+    context.collect(context.getKey(), result);
+  }
+
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/lib/IdentityMapper.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/lib/IdentityMapper.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/lib/IdentityMapper.java	(revision 0)
@@ -0,0 +1,16 @@
+package org.apache.hadoop.mapreduce.lib;
+
+import java.io.IOException;
+
+import org.apache.hadoop.mapreduce.MapContext;
+import org.apache.hadoop.mapreduce.Mapper;
+
+public class IdentityMapper<Key,Value, 
+                            C extends MapContext<Key,Value,Key,Value>>
+  extends Mapper<C> {
+
+  public void map(C context) throws IOException {
+    context.collect(context.getKey(), context.getValue());
+  }
+
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/lib/LongSumReducer.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/lib/LongSumReducer.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/lib/LongSumReducer.java	(revision 0)
@@ -0,0 +1,23 @@
+package org.apache.hadoop.mapreduce.lib;
+
+import java.io.IOException;
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.mapreduce.ReduceContext;
+import org.apache.hadoop.mapreduce.Reducer;
+
+public class LongSumReducer<Key,C extends ReduceContext<Key,LongWritable,
+                                                        Key,LongWritable>>
+    extends Reducer<C> {
+
+  private LongWritable result = new LongWritable();
+
+  public void reduce(C context) throws IOException {
+    long sum = 0;
+    for (LongWritable val : context) {
+      sum += val.get();
+    }
+    result.set(sum);
+    context.collect(context.getKey(), result);
+  }
+
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/Closeable.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/Closeable.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/Closeable.java	(revision 0)
@@ -0,0 +1,7 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+
+public interface Closeable<C extends Context> {
+  void close(C context) throws IOException;
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/Reducer.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/Reducer.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/Reducer.java	(revision 0)
@@ -0,0 +1,15 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+
+public abstract class Reducer<C extends ReduceContext> implements Closeable<C> {
+
+  /**
+   * Will be called once per an input key.
+   */
+  public abstract void reduce(C context) throws IOException;
+
+  public void close(C context) throws IOException {
+    // NOTHING
+  }
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/InputSplit.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/InputSplit.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/InputSplit.java	(revision 0)
@@ -0,0 +1,9 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+
+public interface InputSplit {
+  long getLength() throws IOException;
+  String[] getLocations() throws IOException;
+  Class<? extends Mapper> getMapperClass() throws IOException;
+}
\ No newline at end of file
Index: src/mapred/org/apache/hadoop/mapreduce/ReduceContext.java
===================================================================
--- src/mapred/org/apache/hadoop/mapreduce/ReduceContext.java	(revision 0)
+++ src/mapred/org/apache/hadoop/mapreduce/ReduceContext.java	(revision 0)
@@ -0,0 +1,19 @@
+package org.apache.hadoop.mapreduce;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+public abstract class ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
+    extends Context<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
+    implements Iterable<VALUEIN> {
+
+  /**
+   * Advance to the next value within the same key.
+   */
+  public abstract boolean nextValue() throws IOException;
+
+  /**
+   * Iterate through the values.
+   */
+  public abstract Iterator<VALUEIN> getValues() throws IOException;
+}
\ No newline at end of file
