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 MapperVALUEIN
- the value input type to the MapperKEYOUT
- the key output type from the MapperVALUEOUT
- 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
.
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 |
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 |
MapContext
public MapContext(Configuration conf,
TaskAttemptID taskid,
RecordReader<KEYIN,VALUEIN> reader,
RecordWriter<KEYOUT,VALUEOUT> writer,
OutputCommitter committer,
StatusReporter reporter,
InputSplit split)
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
Copyright © 2009 The Apache Software Foundation