org.apache.hadoop.mapreduce.task
Class TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
java.lang.Object
org.apache.hadoop.mapreduce.task.JobContextImpl
org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl
org.apache.hadoop.mapreduce.task.TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- Type Parameters:
KEYIN
- the input key type for the taskVALUEIN
- the input value type for the taskKEYOUT
- the output key type for the taskVALUEOUT
- the output value type for the task
- All Implemented Interfaces:
- JobContext, TaskAttemptContext, TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>, org.apache.hadoop.util.Progressable
- Direct Known Subclasses:
- MapContextImpl, ReduceContextImpl
public abstract class TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- extends TaskAttemptContextImpl
- implements TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
A context object that allows input and output from the task. It is only
supplied to the Mapper
or Reducer
.
Fields inherited from interface org.apache.hadoop.mapreduce.JobContext |
CACHE_ARCHIVES_VISIBILITIES, CACHE_FILE_VISIBILITIES, COMBINE_CLASS_ATTR, INPUT_FORMAT_CLASS_ATTR, JAR_UNPACK_PATTERN, JOB_ACL_MODIFY_JOB, JOB_ACL_VIEW_JOB, JOB_CANCEL_DELEGATION_TOKEN, JOB_NAMENODES, MAP_CLASS_ATTR, MAP_MEMORY_PHYSICAL_MB, MAP_OUTPUT_COLLECTOR_CLASS_ATTR, MAPREDUCE_TASK_CLASSPATH_PRECEDENCE, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR, REDUCE_MEMORY_PHYSICAL_MB, SHUFFLE_CONSUMER_PLUGIN_ATTR, USER_LOG_RETAIN_HOURS |
Methods inherited from class org.apache.hadoop.mapreduce.task.JobContextImpl |
getArchiveClassPaths, getArchiveTimestamps, getCacheArchives, getCacheFiles, getCombinerClass, getCombinerKeyGroupingComparator, getConfiguration, getCredentials, getFileClassPaths, getFileTimestamps, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getJobSetupCleanupNeeded, getLocalCacheArchives, getLocalCacheFiles, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getMaxMapAttempts, getMaxReduceAttempts, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getProfileEnabled, getProfileParams, getProfileTaskRange, getReducerClass, getSortComparator, getSymlink, getUser, getWorkingDirectory, setJobID, userClassesTakesPrecedence |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.mapreduce.JobContext |
getArchiveClassPaths, getArchiveTimestamps, getCacheArchives, getCacheFiles, getCombinerClass, getCombinerKeyGroupingComparator, getConfiguration, getCredentials, getFileClassPaths, getFileTimestamps, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getJobSetupCleanupNeeded, getLocalCacheArchives, getLocalCacheFiles, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getMaxMapAttempts, getMaxReduceAttempts, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getProfileEnabled, getProfileParams, getReducerClass, getSortComparator, getSymlink, getUser, getWorkingDirectory, userClassesTakesPrecedence |
Methods inherited from interface org.apache.hadoop.util.Progressable |
progress |
TaskInputOutputContextImpl
public TaskInputOutputContextImpl(org.apache.hadoop.conf.Configuration conf,
TaskAttemptID taskid,
RecordWriter<KEYOUT,VALUEOUT> output,
OutputCommitter committer,
StatusReporter reporter)
nextKeyValue
public abstract boolean nextKeyValue()
throws java.io.IOException,
java.lang.InterruptedException
- Advance to the next key, value pair, returning null if at end.
- Specified by:
nextKeyValue
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- Returns:
- the key object that was read into, or null if no more
- Throws:
java.io.IOException
java.lang.InterruptedException
getCurrentKey
public abstract KEYIN getCurrentKey()
throws java.io.IOException,
java.lang.InterruptedException
- Get the current key.
- Specified by:
getCurrentKey
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- Returns:
- the current key object or null if there isn't one
- Throws:
java.io.IOException
java.lang.InterruptedException
getCurrentValue
public abstract VALUEIN getCurrentValue()
throws java.io.IOException,
java.lang.InterruptedException
- Get the current value.
- Specified by:
getCurrentValue
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- Returns:
- the value object that was read into
- Throws:
java.io.IOException
java.lang.InterruptedException
write
public void write(KEYOUT key,
VALUEOUT value)
throws java.io.IOException,
java.lang.InterruptedException
- Generate an output key/value pair.
- Specified by:
write
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- Throws:
java.io.IOException
java.lang.InterruptedException
getOutputCommitter
public OutputCommitter getOutputCommitter()
- Description copied from interface:
TaskInputOutputContext
- Get the
OutputCommitter
for the task-attempt.
- Specified by:
getOutputCommitter
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
- Returns:
- the
OutputCommitter
for the task-attempt
Copyright © 2009 The Apache Software Foundation