@InterfaceAudience.Public @InterfaceStability.Unstable public class BindingPathOutputCommitter extends PathOutputCommitter
NAME). When this class is instantiated, it will
use the factory mechanism to locate the configured committer for the
destination.
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
The classname for use in configurations.
|
| Constructor and Description |
|---|
BindingPathOutputCommitter(Path outputPath,
TaskAttemptContext context)
Instantiate.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortJob(JobContext jobContext,
org.apache.hadoop.mapreduce.JobStatus.State state)
For aborting an unsuccessful job's output.
|
void |
abortTask(TaskAttemptContext taskContext)
Discard the task output.
|
void |
cleanupJob(JobContext jobContext)
For cleaning up the job's output after job completion.
|
void |
commitJob(JobContext jobContext)
For committing job's output after successful job completion.
|
void |
commitTask(TaskAttemptContext taskContext)
To promote the task's temporary output to final output location.
|
PathOutputCommitter |
getCommitter()
Get the inner committer.
|
Path |
getOutputPath()
Get the final directory where work will be placed once the job
is committed.
|
Path |
getWorkPath()
Get the directory that the task should write results into.
|
boolean |
hasOutputPath()
Predicate: is there an output path?
|
boolean |
isCommitJobRepeatable(JobContext jobContext)
Returns true if an in-progress job commit can be retried.
|
boolean |
isRecoverySupported()
Is task output recovery supported for restarting jobs?
If task output recovery is supported, job restart can be done more
efficiently.
|
boolean |
isRecoverySupported(JobContext jobContext)
Is task output recovery supported for restarting jobs?
If task output recovery is supported, job restart can be done more
efficiently.
|
boolean |
needsTaskCommit(TaskAttemptContext taskContext)
Check whether task needs a commit.
|
void |
recoverTask(TaskAttemptContext taskContext)
Recover the task output.
|
void |
setupJob(JobContext jobContext)
For the framework to setup the job output during initialization.
|
void |
setupTask(TaskAttemptContext taskContext)
Sets up output for the task.
|
String |
toString() |
public static final String NAME
public BindingPathOutputCommitter(Path outputPath, TaskAttemptContext context) throws IOException
outputPath - output path (may be null)context - task contextIOException - on any failure.public Path getOutputPath()
PathOutputCommittergetOutputPath in class PathOutputCommitterpublic Path getWorkPath() throws IOException
PathOutputCommittergetWorkPath in class PathOutputCommitterIOException - IO problempublic void setupJob(JobContext jobContext) throws IOException
OutputCommittersetupJob in class OutputCommitterjobContext - Context of the job whose output is being written.IOException - if temporary output could not be createdpublic void setupTask(TaskAttemptContext taskContext) throws IOException
OutputCommittersetupTask in class OutputCommittertaskContext - Context of the task whose output is being written.IOExceptionpublic boolean needsTaskCommit(TaskAttemptContext taskContext) throws IOException
OutputCommitterneedsTaskCommit in class OutputCommitterIOExceptionpublic void commitTask(TaskAttemptContext taskContext) throws IOException
OutputCommitterOutputCommitter.needsTaskCommit(TaskAttemptContext) returns true and this
task is the task that the AM determines finished first, this method
is called to commit an individual task's output. This is to mark
that tasks output as complete, as OutputCommitter.commitJob(JobContext) will
also be called later on if the entire job finished successfully. This
is called from a task's process. This may be called multiple times for the
same task, but different task attempts. It should be very rare for this to
be called multiple times and requires odd networking failures to make this
happen. In the future the Hadoop framework may eliminate this race.commitTask in class OutputCommittertaskContext - Context of the task whose output is being written.IOException - if commit is not successful.public void abortTask(TaskAttemptContext taskContext) throws IOException
OutputCommitterabortTask in class OutputCommitterIOExceptionpublic void cleanupJob(JobContext jobContext) throws IOException
OutputCommittercleanupJob in class OutputCommitterjobContext - Context of the job whose output is being written.IOExceptionpublic void commitJob(JobContext jobContext) throws IOException
OutputCommittercommitJob in class OutputCommitterjobContext - Context of the job whose output is being written.IOExceptionpublic void abortJob(JobContext jobContext, org.apache.hadoop.mapreduce.JobStatus.State state) throws IOException
OutputCommitterJobStatus.State.FAILED or
JobStatus.State.KILLED. This is called from the application
master process for the entire job. This may be called multiple times.abortJob in class OutputCommitterjobContext - Context of the job whose output is being written.state - final runstate of the jobIOExceptionpublic boolean isRecoverySupported()
OutputCommitterisRecoverySupported in class OutputCommittertrue if task output recovery is supported,
false otherwiseOutputCommitter.recoverTask(TaskAttemptContext)public boolean isCommitJobRepeatable(JobContext jobContext) throws IOException
OutputCommitterisCommitJobRepeatable in class OutputCommitterjobContext - Context of the job whose output is being written.true repeatable job commit is supported,
false otherwiseIOExceptionpublic boolean isRecoverySupported(JobContext jobContext) throws IOException
OutputCommitterisRecoverySupported in class OutputCommitterjobContext - Context of the job whose output is being written.true if task output recovery is supported,
false otherwiseIOExceptionOutputCommitter.recoverTask(TaskAttemptContext)public void recoverTask(TaskAttemptContext taskContext) throws IOException
OutputCommitterMRJobConfig.APPLICATION_ATTEMPT_ID key in
JobContext.getConfiguration() for the
OutputCommitter. This is called from the application master
process, but it is called individually for each task.
If an exception is thrown the task will be attempted again.
This may be called multiple times for the same task. But from different
application attempts.recoverTask in class OutputCommittertaskContext - Context of the task whose output is being recoveredIOExceptionpublic boolean hasOutputPath()
PathOutputCommitterhasOutputPath in class PathOutputCommitterpublic String toString()
toString in class PathOutputCommitterpublic PathOutputCommitter getCommitter()
Copyright © 2019 Apache Software Foundation. All rights reserved.