public class BigQueryOutputCommitter
extends org.apache.hadoop.mapreduce.OutputCommitter
| Constructor and Description |
|---|
BigQueryOutputCommitter(java.lang.String projectId,
com.google.api.services.bigquery.model.TableReference tempTableRef,
com.google.api.services.bigquery.model.TableReference finalTableRef,
org.apache.hadoop.conf.Configuration configuration)
Creates a bigquery output committer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortJob(org.apache.hadoop.mapreduce.JobContext jobContext,
int status)
For cleaning up the job's output after job failure.
|
void |
abortTask(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Deletes the work table.
|
void |
cleanupJob(org.apache.hadoop.mapreduce.JobContext context)
Deletes the temporary dataset, including all of the work tables.
|
void |
commitJob(org.apache.hadoop.mapreduce.JobContext jobContext)
For committing job's output after successful job completion.
|
void |
commitTask(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Moves the files from the working dataset to the job output table.
|
boolean |
needsTaskCommit(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Did this task write any files into the working dataset?
|
boolean |
needsTaskCommit(org.apache.hadoop.mapreduce.TaskAttemptID attemptId)
Did this task write any files into the working dataset?
|
void |
setupJob(org.apache.hadoop.mapreduce.JobContext context)
Creates the temporary dataset that will contain all of the task work tables.
|
void |
setupTask(org.apache.hadoop.mapreduce.TaskAttemptContext context)
No task setup required.
|
public BigQueryOutputCommitter(java.lang.String projectId,
com.google.api.services.bigquery.model.TableReference tempTableRef,
com.google.api.services.bigquery.model.TableReference finalTableRef,
org.apache.hadoop.conf.Configuration configuration)
throws java.io.IOException
projectId - the job's project id.tempTableRef - the fully-qualified temp table to write to.finalTableRef - the fully-qualified destination table on commit.configuration - the task's configurationjava.io.IOException - on IO Error.public void setupJob(org.apache.hadoop.mapreduce.JobContext context)
throws java.io.IOException
setupJob in class org.apache.hadoop.mapreduce.OutputCommittercontext - the job's context.java.io.IOException - on IO Error.public void cleanupJob(org.apache.hadoop.mapreduce.JobContext context)
throws java.io.IOException
cleanupJob in class org.apache.hadoop.mapreduce.OutputCommittercontext - the job's context.java.io.IOExceptionpublic void abortJob(org.apache.hadoop.mapreduce.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 - on IO Error.public void commitJob(org.apache.hadoop.mapreduce.JobContext jobContext)
throws java.io.IOException
commitJob in class org.apache.hadoop.mapreduce.OutputCommitterjobContext - Context of the job whose output is being written.java.io.IOException - on IO Error.public void setupTask(org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws java.io.IOException
setupTask in class org.apache.hadoop.mapreduce.OutputCommitterjava.io.IOException - on IO Error.public void commitTask(org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws java.io.IOException
commitTask in class org.apache.hadoop.mapreduce.OutputCommittercontext - the task context.java.io.IOException - on IO Error.public void abortTask(org.apache.hadoop.mapreduce.TaskAttemptContext context)
abortTask in class org.apache.hadoop.mapreduce.OutputCommittercontext - the task's context.public boolean needsTaskCommit(org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws java.io.IOException
needsTaskCommit in class org.apache.hadoop.mapreduce.OutputCommittercontext - the task's context.java.io.IOException - on IO Error.public boolean needsTaskCommit(org.apache.hadoop.mapreduce.TaskAttemptID attemptId)
throws java.io.IOException
attemptId - the task's context.java.io.IOException - on IO Error.Copyright © 2019. All rights reserved.