org.apache.hadoop.mapreduce
Interface ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

Type Parameters:
KEYIN - the class of the input keys
VALUEIN - the class of the input values
KEYOUT - the class of the output keys
VALUEOUT - the class of the output values
All Superinterfaces:
JobContext, org.apache.hadoop.util.Progressable, TaskAttemptContext, TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
All Known Implementing Classes:
ReduceContextImpl, Reducer.Context, WrappedReducer.Context

public interface ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
extends TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>

The context passed to the Reducer.


Nested Class Summary
static interface ReduceContext.ValueIterator<VALUEIN>
          Iterator to iterate over values for a given group of records.
 
Field Summary
 
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
 
Method Summary
 java.lang.Iterable<VALUEIN> getValues()
          Iterate through the values for the current key, reusing the same value object, which is stored in the context.
 boolean nextKey()
          Start processing next unique key.
 
Methods inherited from interface org.apache.hadoop.mapreduce.TaskInputOutputContext
getCurrentKey, getCurrentValue, getOutputCommitter, nextKeyValue, write
 
Methods inherited from interface org.apache.hadoop.mapreduce.TaskAttemptContext
getCounter, getCounter, getStatus, getTaskAttemptID, setStatus
 
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
 

Method Detail

nextKey

boolean nextKey()
                throws java.io.IOException,
                       java.lang.InterruptedException
Start processing next unique key.

Throws:
java.io.IOException
java.lang.InterruptedException

getValues

java.lang.Iterable<VALUEIN> getValues()
                                      throws java.io.IOException,
                                             java.lang.InterruptedException
Iterate through the values for the current key, reusing the same value object, which is stored in the context.

Returns:
the series of values associated with the current key. All of the objects returned directly and indirectly from this method are reused.
Throws:
java.io.IOException
java.lang.InterruptedException


Copyright © 2009 The Apache Software Foundation