Hadoop Common
  1. Hadoop Common
  2. HADOOP-1230

Replace parameters with context objects in Mapper, Reducer, Partitioner, InputFormat, and OutputFormat classes

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.20.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Replaced parameters with context obejcts in Mapper, Reducer, Partitioner, InputFormat, and OutputFormat classes.

      Description

      This is a big change, but it will future-proof our API's. To maintain backwards compatibility, I'd suggest that we move over to a new package name (org.apache.hadoop.mapreduce) and deprecate the old interfaces and package. Basically, it will replace:

      package org.apache.hadoop.mapred;
      public interface Mapper extends JobConfigurable, Closeable

      { void map(WritableComparable key, Writable value, OutputCollector output, Reporter reporter) throws IOException; }

      with:

      package org.apache.hadoop.mapreduce;
      public interface Mapper extends Closable

      { void map(MapContext context) throws IOException; }

      where MapContext has the methods like getKey(), getValue(), collect(Key, Value), progress(), etc.

      1. h1230.patch
        285 kB
        Owen O'Malley
      2. h1230.patch
        281 kB
        Owen O'Malley
      3. h1230.patch
        278 kB
        Owen O'Malley
      4. h1230.patch
        258 kB
        Owen O'Malley
      5. h1230.patch
        208 kB
        Owen O'Malley
      6. context-objs-3.patch
        13 kB
        Tom White
      7. context-objs-2.patch
        12 kB
        Owen O'Malley
      8. context-objs.patch
        13 kB
        Owen O'Malley

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Owen O'Malley
              Reporter:
              Owen O'Malley
            • Votes:
              1 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development