public abstract class OutputCommitter extends OutputCommitter
OutputCommitter
describes the commit of task output for a
Map-Reduce job.
The Map-Reduce framework relies on the OutputCommitter
of
the job to:
FileOutputCommitter
,
JobContext
,
TaskAttemptContext
Constructor and Description |
---|
OutputCommitter() |
Modifier and Type | Method and Description |
---|---|
void |
abortJob(JobContext jobContext,
int status)
For cleaning up the job's output after job failure.
|
void |
abortJob(JobContext context,
JobStatus.State runState)
This method implements the new interface by calling the old method.
|
abstract void |
abortTask(TaskAttemptContext taskContext)
Discard the task output
|
void |
abortTask(TaskAttemptContext taskContext)
This method implements the new interface by calling the old method.
|
void |
cleanupJob(JobContext jobContext)
Deprecated.
use
commitJob(JobContext) or
abortJob(JobContext, int) instead |
void |
cleanupJob(JobContext context)
Deprecated.
|
void |
commitJob(JobContext jobContext)
For committing job's output after successful job completion.
|
void |
commitJob(JobContext context)
This method implements the new interface by calling the old method.
|
abstract void |
commitTask(TaskAttemptContext taskContext)
To promote the task's temporary output to final output location
The task's output is moved to the job's output directory.
|
void |
commitTask(TaskAttemptContext taskContext)
This method implements the new interface by calling the old method.
|
abstract boolean |
needsTaskCommit(TaskAttemptContext taskContext)
Check whether task needs a commit
|
boolean |
needsTaskCommit(TaskAttemptContext taskContext)
This method implements the new interface by calling the old method.
|
abstract void |
setupJob(JobContext jobContext)
For the framework to setup the job output during initialization
|
void |
setupJob(JobContext jobContext)
This method implements the new interface by calling the old method.
|
abstract void |
setupTask(TaskAttemptContext taskContext)
Sets up output for the task.
|
void |
setupTask(TaskAttemptContext taskContext)
This method implements the new interface by calling the old method.
|
public abstract void setupJob(JobContext jobContext) throws java.io.IOException
jobContext
- Context of the job whose output is being written.java.io.IOException
- if temporary output could not be created@Deprecated public void cleanupJob(JobContext jobContext) throws java.io.IOException
java.io.IOException
public void commitJob(JobContext jobContext) throws java.io.IOException
JobStatus.SUCCEEDED
.jobContext
- Context of the job whose output is being written.java.io.IOException
public void abortJob(JobContext jobContext, int status) throws java.io.IOException
jobContext
- Context of the job whose output is being written.status
- Final run state of the job, should be
JobStatus.KILLED
or JobStatus.FAILED
java.io.IOException
public abstract void setupTask(TaskAttemptContext taskContext) throws java.io.IOException
taskContext
- Context of the task whose output is being written.java.io.IOException
public abstract boolean needsTaskCommit(TaskAttemptContext taskContext) throws java.io.IOException
taskContext
- java.io.IOException
public abstract void commitTask(TaskAttemptContext taskContext) throws java.io.IOException
taskContext
- Context of the task whose output is being written.java.io.IOException
- if commit is notpublic abstract void abortTask(TaskAttemptContext taskContext) throws java.io.IOException
taskContext
- java.io.IOException
public final void setupJob(JobContext jobContext) throws java.io.IOException
setupJob
in class OutputCommitter
jobContext
- Context of the job whose output is being written.java.io.IOException
- if temporary output could not be created@Deprecated public final void cleanupJob(JobContext context) throws java.io.IOException
cleanupJob
in class OutputCommitter
java.io.IOException
public final void commitJob(JobContext context) throws java.io.IOException
commitJob
in class OutputCommitter
context
- Context of the job whose output is being written.java.io.IOException
public final void abortJob(JobContext context, JobStatus.State runState) throws java.io.IOException
abortJob
in class OutputCommitter
context
- Context of the job whose output is being written.runState
- final run state of the job, should be either
JobStatus.State.KILLED
or JobStatus.State.FAILED
java.io.IOException
public final void setupTask(TaskAttemptContext taskContext) throws java.io.IOException
setupTask
in class OutputCommitter
taskContext
- Context of the task whose output is being written.java.io.IOException
public final boolean needsTaskCommit(TaskAttemptContext taskContext) throws java.io.IOException
needsTaskCommit
in class OutputCommitter
java.io.IOException
public final void commitTask(TaskAttemptContext taskContext) throws java.io.IOException
commitTask
in class OutputCommitter
taskContext
- Context of the task whose output is being written.java.io.IOException
- if commit is notpublic final void abortTask(TaskAttemptContext taskContext) throws java.io.IOException
abortTask
in class OutputCommitter
java.io.IOException
Copyright © 2009 The Apache Software Foundation