Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-1230

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.20.0
    • None
    • None
    • Reviewed
    • 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.

      Attachments

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

        Issue Links

          Activity

            People

              omalley Owen O'Malley
              omalley Owen O'Malley
              Votes:
              1 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: