@PublicApi @ThreadSafe public final class KeyValueOutputCommitter extends org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
FileOutputCommitter
where creating, completing, or deleting a KeyValueSystem
in different phases of a job's or task's lifecycle is considered.
This committer must be used along with KeyValueOutputFormat
to merge the key-value stores
created by each Reducer into one key-value store under the MapReduce output directory.
Constructor and Description |
---|
KeyValueOutputCommitter(org.apache.hadoop.fs.Path outputPath,
org.apache.hadoop.mapreduce.TaskAttemptContext taskContext)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
abortTask(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext)
Deletes the completed key-value stores under the task's temporary output directory, and then
calls
FileOutputCommitter.abortTask(TaskAttemptContext) . |
void |
commitTask(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext)
Merges the completed key-value store under the task's temporary output directory to the
key-value store at job output directory, then calls
FileOutputCommitter.commitTask(TaskAttemptContext) . |
static String |
getPendingDirName() |
boolean |
needsTaskCommit(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) |
abortJob, abortTask, cleanupJob, commitJob, commitTask, getCommittedTaskPath, getCommittedTaskPath, getCommittedTaskPath, getJobAttemptPath, getJobAttemptPath, getJobAttemptPath, getTaskAttemptPath, getTaskAttemptPath, getWorkPath, isRecoverySupported, needsTaskCommit, recoverTask, setupJob, setupTask
public KeyValueOutputCommitter(org.apache.hadoop.fs.Path outputPath, org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) throws IOException
outputPath
- the job's output path, or null if the output committer is a nooptaskContext
- the task's contextIOException
public boolean needsTaskCommit(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) throws IOException
needsTaskCommit
in class org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
taskContext
- MapReduce task configurationIOException
public void commitTask(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext) throws IOException
FileOutputCommitter.commitTask(TaskAttemptContext)
.commitTask
in class org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
IOException
public void abortTask(org.apache.hadoop.mapreduce.TaskAttemptContext taskContext)
FileOutputCommitter.abortTask(TaskAttemptContext)
.abortTask
in class org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
public static String getPendingDirName()
Copyright © 2023. All Rights Reserved.