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 taskpublic abstract class TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT> extends TaskAttemptContext implements Progressable
COMBINE_CLASS_ATTR, conf, INPUT_FORMAT_CLASS_ATTR, MAP_CLASS_ATTR, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR
Constructor and Description |
---|
TaskInputOutputContext(Configuration conf,
TaskAttemptID taskid,
RecordWriter<KEYOUT,VALUEOUT> output,
OutputCommitter committer,
StatusReporter reporter) |
Modifier and Type | Method and Description |
---|---|
Counter |
getCounter(Enum<?> counterName) |
Counter |
getCounter(String groupName,
String counterName) |
abstract KEYIN |
getCurrentKey()
Get the current key.
|
abstract VALUEIN |
getCurrentValue()
Get the current value.
|
OutputCommitter |
getOutputCommitter() |
abstract boolean |
nextKeyValue()
Advance to the next key, value pair, returning null if at end.
|
void |
progress()
Report progress.
|
void |
setStatus(String status)
Set the current status of the task to the given string.
|
void |
write(KEYOUT key,
VALUEOUT value)
Generate an output key/value pair.
|
getStatus, getTaskAttemptID
getCombinerClass, getConfiguration, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getReducerClass, getSortComparator, getWorkingDirectory
public TaskInputOutputContext(Configuration conf, TaskAttemptID taskid, RecordWriter<KEYOUT,VALUEOUT> output, OutputCommitter committer, StatusReporter reporter)
public abstract boolean nextKeyValue() throws IOException, InterruptedException
IOException
InterruptedException
public abstract KEYIN getCurrentKey() throws IOException, InterruptedException
IOException
InterruptedException
public abstract VALUEIN getCurrentValue() throws IOException, InterruptedException
IOException
InterruptedException
public void write(KEYOUT key, VALUEOUT value) throws IOException, InterruptedException
IOException
InterruptedException
public void progress()
TaskAttemptContext
progress
in interface Progressable
progress
in class TaskAttemptContext
public void setStatus(String status)
TaskAttemptContext
setStatus
in class TaskAttemptContext
public OutputCommitter getOutputCommitter()
Copyright © 2010 The Apache Software Foundation