KEYIN
- the class of the input keysVALUEIN
- the class of the input valuesKEYOUT
- the class of the output keysVALUEOUT
- the class of the output valuespublic class ReduceContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT> extends TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT> implements ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
Reducer
.Modifier and Type | Class and Description |
---|---|
protected class |
ReduceContextImpl.ValueIterable |
protected class |
ReduceContextImpl.ValueIterator |
TaskAttemptContextImpl.DummyReporter
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.util.Progressable |
reporter |
credentials, ugi
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
Constructor and Description |
---|
ReduceContextImpl(org.apache.hadoop.conf.Configuration conf,
TaskAttemptID taskid,
RawKeyValueIterator input,
Counter inputKeyCounter,
Counter inputValueCounter,
RecordWriter<KEYOUT,VALUEOUT> output,
OutputCommitter committer,
StatusReporter reporter,
org.apache.hadoop.io.RawComparator<KEYIN> comparator,
java.lang.Class<KEYIN> keyClass,
java.lang.Class<VALUEIN> valueClass) |
Modifier and Type | Method and Description |
---|---|
KEYIN |
getCurrentKey()
Get the current key.
|
VALUEIN |
getCurrentValue()
Get the current value.
|
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.
|
boolean |
nextKeyValue()
Advance to the next key/value pair.
|
getOutputCommitter, write
getCounter, getCounter, getStatus, getTaskAttemptID, progress, setStatus, setStatusString
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOutputCommitter, write
getCounter, getCounter, getStatus, getTaskAttemptID, setStatus
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
public ReduceContextImpl(org.apache.hadoop.conf.Configuration conf, TaskAttemptID taskid, RawKeyValueIterator input, Counter inputKeyCounter, Counter inputValueCounter, RecordWriter<KEYOUT,VALUEOUT> output, OutputCommitter committer, StatusReporter reporter, org.apache.hadoop.io.RawComparator<KEYIN> comparator, java.lang.Class<KEYIN> keyClass, java.lang.Class<VALUEIN> valueClass) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public boolean nextKey() throws java.io.IOException, java.lang.InterruptedException
public boolean nextKeyValue() throws java.io.IOException, java.lang.InterruptedException
nextKeyValue
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
nextKeyValue
in class TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
java.io.IOException
java.lang.InterruptedException
public KEYIN getCurrentKey()
TaskInputOutputContextImpl
getCurrentKey
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
getCurrentKey
in class TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
public VALUEIN getCurrentValue()
TaskInputOutputContextImpl
getCurrentValue
in interface TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
getCurrentValue
in class TaskInputOutputContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
public java.lang.Iterable<VALUEIN> getValues() throws java.io.IOException, java.lang.InterruptedException
Copyright © 2009 The Apache Software Foundation