MapContext (Hadoop 1.2.1 API)
Date: 2013-07-22

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.mapreduce
Class MapContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

    java.lang.Object
      org.apache.hadoop.mapreduce.JobContext
          org.apache.hadoop.mapreduce.TaskAttemptContext
              org.apache.hadoop.mapreduce.TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
                  org.apache.hadoop.mapreduce.MapContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

Type Parameters:
  `KEYIN` - the key input type to the Mapper
  `VALUEIN` - the value input type to the Mapper
  `KEYOUT` - the key output type from the Mapper
  `VALUEOUT` - the value output type from the Mapper

All Implemented Interfaces:
  Progressable

Direct Known Subclasses:
  Mapper.Context

    public class MapContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

extends TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

The context that is given to the `Mapper`.

Field Summary

Fields inherited from class org.apache.hadoop.mapreduce.JobContext
`CACHE_ARCHIVES_VISIBILITIES, CACHE_FILE_VISIBILITIES, COMBINE_CLASS_ATTR, conf, credentials, INPUT_FORMAT_CLASS_ATTR, JOB_ACL_MODIFY_JOB, JOB_ACL_VIEW_JOB, JOB_CANCEL_DELEGATION_TOKEN, JOB_NAMENODES, MAP_CLASS_ATTR, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR, ugi, USER_LOG_RETAIN_HOURS`

Constructor Summary
`MapContext(Configuration conf, TaskAttemptID taskid, RecordReader<KEYIN,VALUEIN> reader, RecordWriter<KEYOUT,VALUEOUT> writer, OutputCommitter committer, StatusReporter reporter, InputSplit split)`

Method Summary
`KEYIN` | `getCurrentKey()` Get the current key.
`VALUEIN` | `getCurrentValue()` Get the current value.
`InputSplit` | `getInputSplit()` Get the input split for this map.
`boolean` | `nextKeyValue()` Advance to the next key, value pair, returning null if at end.

Methods inherited from class org.apache.hadoop.mapreduce.TaskInputOutputContext
`getCounter, getCounter, getOutputCommitter, getProgress, progress, setStatus, write`

Methods inherited from class org.apache.hadoop.mapreduce.TaskAttemptContext
`getStatus, getTaskAttemptID`

Methods inherited from class org.apache.hadoop.mapreduce.JobContext
`getCombinerClass, getConfiguration, getCredentials, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getReducerClass, getSortComparator, getWorkingDirectory`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MapContext

    public MapContext(Configuration conf,
                      TaskAttemptID taskid,
                      RecordReader<KEYIN,VALUEIN> reader,
                      RecordWriter<KEYOUT,VALUEOUT> writer,
                      OutputCommitter committer,
                      StatusReporter reporter,
                      InputSplit split)

Method Detail

### getInputSplit

    public InputSplit getInputSplit()

  Get the input split for this map.

### getCurrentKey

    public KEYIN getCurrentKey()
                        throws IOException,
                               InterruptedException

  Description copied from class: `TaskInputOutputContext`
  Get the current key.

  Specified by:
    `getCurrentKey` in class `TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>`
  Returns:
    the current key object or null if there isn't one
  Throws:
    `IOException`
    `InterruptedException`

### getCurrentValue

    public VALUEIN getCurrentValue()
                            throws IOException,
                                   InterruptedException

  Description copied from class: `TaskInputOutputContext`
  Get the current value.

  Specified by:
    `getCurrentValue` in class `TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>`
  Returns:
    the value object that was read into
  Throws:
    `IOException`
    `InterruptedException`

### nextKeyValue

    public boolean nextKeyValue()
                         throws IOException,
                                InterruptedException

  Description copied from class: `TaskInputOutputContext`
  Advance to the next key, value pair, returning null if at end.

  Specified by:
    `nextKeyValue` in class `TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>`
  Returns:
    the key object that was read into, or null if no more
  Throws:
    `IOException`
    `InterruptedException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation