FileOutputCommitter (Hadoop 0.20.1+169.88 API)
Date: 2010-05-20

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.hadoop.mapreduce.lib.output
Class FileOutputCommitter

    java.lang.Object
      org.apache.hadoop.mapreduce.OutputCommitter
          org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter

    public class FileOutputCommitter

extends OutputCommitter

An `OutputCommitter` that commits files specified in job output directory i.e. ${mapred.output.dir}.

Field Summary
`protected static String` | `TEMP_DIR_NAME` Temporary directory name

Constructor Summary
`FileOutputCommitter(Path outputPath, TaskAttemptContext context)` Create a file output committer

Method Summary
`void` | `abortTask(TaskAttemptContext context)` Delete the work directory
`void` | `cleanupJob(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
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TEMP_DIR_NAME

    protected static final String TEMP_DIR_NAME

  Temporary directory name

  See Also:
    Constant Field Values

Constructor Detail

### FileOutputCommitter

    public FileOutputCommitter(Path outputPath,
                               TaskAttemptContext context)
                        throws IOException

  Create a file output committer

  Parameters:
    `outputPath` - the job's output path
    `context` - the task's context
  Throws:
    `IOException`

Method Detail

### setupJob

    public void setupJob(JobContext context)
                  throws IOException

  Create the temporary directory that is the root of all of the task work directories.

  Specified by:
    `setupJob` in class `OutputCommitter`
  Parameters:
    `context` - the job's context
  Throws:
    `IOException` - if temporary output could not be created

### cleanupJob

    public void cleanupJob(JobContext context)
                    throws IOException

  Delete the temporary directory, including all of the work directories.

  Specified by:
    `cleanupJob` in class `OutputCommitter`
  Parameters:
    `context` - the job's context
  Throws:
    `IOException`

### setupTask

    public void setupTask(TaskAttemptContext context)
                   throws IOException

  No task setup required.

  Specified by:
    `setupTask` in class `OutputCommitter`
  Parameters:
    `context` - Context of the task whose output is being written.
  Throws:
    `IOException`

### commitTask

    public void commitTask(TaskAttemptContext context)
                    throws IOException

  Move the files from the work directory to the job output directory

  Specified by:
    `commitTask` in class `OutputCommitter`
  Parameters:
    `context` - the task context
  Throws:
    `IOException` - if commit is not

### abortTask

    public void abortTask(TaskAttemptContext context)

  Delete the work directory

  Specified by:
    `abortTask` in class `OutputCommitter`

### needsTaskCommit

    public boolean needsTaskCommit(TaskAttemptContext context)
                            throws IOException

  Did this task write any files in the work directory?

  Specified by:
    `needsTaskCommit` in class `OutputCommitter`
  Parameters:
    `context` - the task's context
  Returns:
    true/false
  Throws:
    `IOException`

### getWorkPath

    public Path getWorkPath()
                     throws IOException

  Get the directory that the task should write results into

  Returns:
    the work directory
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation