public class FileOutputCommitter extends OutputCommitter
OutputCommitter that commits files specified
in job output directory i.e. ${mapred.output.dir}.| Modifier and Type | Field and Description |
|---|---|
static String |
SUCCEEDED_FILE_NAME |
protected static String |
TEMP_DIR_NAME
Temporary directory name
|
| Constructor and Description |
|---|
FileOutputCommitter(org.apache.hadoop.fs.Path outputPath,
TaskAttemptContext context)
Create a file output committer
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortJob(JobContext context,
JobStatus.State state)
Delete the temporary directory, including all of the work directories.
|
void |
abortTask(TaskAttemptContext context)
Delete the work directory
|
void |
cleanupJob(JobContext context)
Deprecated.
|
void |
commitJob(JobContext context)
Delete the temporary directory, including all of the work directories.
|
void |
commitTask(TaskAttemptContext context)
Move the files from the work directory to the job output directory
|
org.apache.hadoop.fs.Path |
getWorkPath()
Get the directory that the task should write results into
|
boolean |
needsTaskCommit(TaskAttemptContext context)
Did this task write any files in the work directory?
|
void |
setupJob(JobContext context)
Create the temporary directory that is the root of all of the task
work directories.
|
void |
setupTask(TaskAttemptContext context)
No task setup required.
|
protected static final String TEMP_DIR_NAME
public static final String SUCCEEDED_FILE_NAME
public FileOutputCommitter(org.apache.hadoop.fs.Path outputPath,
TaskAttemptContext context)
throws IOException
outputPath - the job's output pathcontext - the task's contextIOExceptionpublic void setupJob(JobContext context) throws IOException
setupJob in class OutputCommittercontext - the job's contextIOException - if temporary output could not be createdpublic void commitJob(JobContext context) throws IOException
commitJob in class OutputCommittercontext - the job's context.IOException@Deprecated public void cleanupJob(JobContext context) throws IOException
OutputCommittercleanupJob in class OutputCommitterIOExceptionpublic void abortJob(JobContext context, JobStatus.State state) throws IOException
abortJob in class OutputCommittercontext - the job's contextstate - final run state of the job, should be FAILED or KILLEDIOExceptionpublic void setupTask(TaskAttemptContext context) throws IOException
setupTask in class OutputCommittercontext - Context of the task whose output is being written.IOExceptionpublic void commitTask(TaskAttemptContext context) throws IOException
commitTask in class OutputCommittercontext - the task contextIOException - if commit is notpublic void abortTask(TaskAttemptContext context) throws IOException
abortTask in class OutputCommitterIOExceptionpublic boolean needsTaskCommit(TaskAttemptContext context) throws IOException
needsTaskCommit in class OutputCommittercontext - the task's contextIOExceptionpublic org.apache.hadoop.fs.Path getWorkPath()
throws IOException
IOExceptionCopyright © 2009 The Apache Software Foundation