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 ReduceContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> extends TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
Reducer
.Modifier and Type | Class and Description |
---|---|
protected class |
ReduceContext.ValueIterable |
protected class |
ReduceContext.ValueIterator |
Modifier and Type | Field and Description |
---|---|
protected Progressable |
reporter |
COMBINE_CLASS_ATTR, conf, INPUT_FORMAT_CLASS_ATTR, MAP_CLASS_ATTR, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR
Constructor and Description |
---|
ReduceContext(Configuration conf,
TaskAttemptID taskid,
RawKeyValueIterator input,
Counter inputKeyCounter,
Counter inputValueCounter,
RecordWriter<KEYOUT,VALUEOUT> output,
OutputCommitter committer,
StatusReporter reporter,
RawComparator<KEYIN> comparator,
Class<KEYIN> keyClass,
Class<VALUEIN> valueClass) |
Modifier and Type | Method and Description |
---|---|
KEYIN |
getCurrentKey()
Get the current key.
|
VALUEIN |
getCurrentValue()
Get the current value.
|
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.
|
getCounter, getCounter, getOutputCommitter, progress, setStatus, write
getStatus, getTaskAttemptID
getCombinerClass, getConfiguration, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getReducerClass, getSortComparator, getWorkingDirectory
protected Progressable reporter
public ReduceContext(Configuration conf, TaskAttemptID taskid, RawKeyValueIterator input, Counter inputKeyCounter, Counter inputValueCounter, RecordWriter<KEYOUT,VALUEOUT> output, OutputCommitter committer, StatusReporter reporter, RawComparator<KEYIN> comparator, Class<KEYIN> keyClass, Class<VALUEIN> valueClass) throws InterruptedException, IOException
InterruptedException
IOException
public boolean nextKey() throws IOException, InterruptedException
IOException
InterruptedException
public boolean nextKeyValue() throws IOException, InterruptedException
nextKeyValue
in class TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
IOException
InterruptedException
public KEYIN getCurrentKey()
TaskInputOutputContext
getCurrentKey
in class TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
public VALUEIN getCurrentValue()
TaskInputOutputContext
getCurrentValue
in class TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
public Iterable<VALUEIN> getValues() throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2010 The Apache Software Foundation