|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapreduce.JobContext org.apache.hadoop.mapreduce.TaskAttemptContext org.apache.hadoop.mapreduce.TaskInputOutputContext<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
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>
A context object that allows input and output from the task. It is only
supplied to the Mapper
or Reducer
.
Field Summary |
---|
Fields inherited from class org.apache.hadoop.mapreduce.JobContext |
---|
CACHE_ARCHIVES_VISIBILITIES, CACHE_FILE_VISIBILITIES, COMBINE_CLASS_ATTR, conf, credentials, INPUT_FORMAT_CLASS_ATTR, JOB_ACL_MODIFY_JOB, JOB_ACL_VIEW_JOB, JOB_CANCEL_DELEGATION_TOKEN, JOB_NAMENODES, MAP_CLASS_ATTR, OUTPUT_FORMAT_CLASS_ATTR, PARTITIONER_CLASS_ATTR, REDUCE_CLASS_ATTR, ugi, USER_LOG_RETAIN_HOURS |
Constructor Summary | |
---|---|
TaskInputOutputContext(Configuration conf,
TaskAttemptID taskid,
RecordWriter<KEYOUT,VALUEOUT> output,
OutputCommitter committer,
StatusReporter reporter)
|
Method Summary | |
---|---|
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()
|
float |
getProgress()
|
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. |
Methods inherited from class org.apache.hadoop.mapreduce.TaskAttemptContext |
---|
getStatus, getTaskAttemptID |
Methods inherited from class org.apache.hadoop.mapreduce.JobContext |
---|
getCombinerClass, getConfiguration, getCredentials, getGroupingComparator, getInputFormatClass, getJar, getJobID, getJobName, getMapOutputKeyClass, getMapOutputValueClass, getMapperClass, getNumReduceTasks, getOutputFormatClass, getOutputKeyClass, getOutputValueClass, getPartitionerClass, getReducerClass, getSortComparator, getWorkingDirectory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskInputOutputContext(Configuration conf, TaskAttemptID taskid, RecordWriter<KEYOUT,VALUEOUT> output, OutputCommitter committer, StatusReporter reporter)
Method Detail |
---|
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 Counter getCounter(Enum<?> counterName)
public Counter getCounter(String groupName, String counterName)
public void progress()
TaskAttemptContext
progress
in interface Progressable
progress
in class TaskAttemptContext
public float getProgress()
public void setStatus(String status)
TaskAttemptContext
setStatus
in class TaskAttemptContext
public OutputCommitter getOutputCommitter()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |