Class MultiTableOutputFormat
java.lang.Object
org.apache.hadoop.mapreduce.OutputFormat<ImmutableBytesWritable,Mutation>
org.apache.hadoop.hbase.mapreduce.MultiTableOutputFormat
@Public
public class MultiTableOutputFormat
extends org.apache.hadoop.mapreduce.OutputFormat<ImmutableBytesWritable,Mutation>
Hadoop output format that writes to one or more HBase tables. The key is taken to be the table
name while the output value must be either a Put
or a Delete
instance.
All tables must already exist, and all Puts and Deletes must reference only valid column
families.
Write-ahead logging (WAL) for Puts can be disabled by setting WAL_PROPERTY
to
WAL_OFF
. Default value is WAL_ON
. Note that disabling write-ahead logging is
only appropriate for jobs where loss of data due to region server failure can be tolerated (for
example, because it is easy to rerun a bulk import).
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Record writer for outputting to multiple HTables. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkOutputSpecs
(org.apache.hadoop.mapreduce.JobContext context) org.apache.hadoop.mapreduce.OutputCommitter
getOutputCommitter
(org.apache.hadoop.mapreduce.TaskAttemptContext context) org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,
Mutation> getRecordWriter
(org.apache.hadoop.mapreduce.TaskAttemptContext context)
-
Field Details
-
WAL_PROPERTY
Set this toWAL_OFF
to turn off write-ahead logging (WAL)- See Also:
-
WAL_ON
Property value to use write-ahead logging- See Also:
-
WAL_OFF
Property value to disable write-ahead logging- See Also:
-
-
Constructor Details
-
MultiTableOutputFormat
public MultiTableOutputFormat()
-
-
Method Details
-
checkOutputSpecs
public void checkOutputSpecs(org.apache.hadoop.mapreduce.JobContext context) throws IOException, InterruptedException - Specified by:
checkOutputSpecs
in classorg.apache.hadoop.mapreduce.OutputFormat<ImmutableBytesWritable,
Mutation> - Throws:
IOException
InterruptedException
-
getOutputCommitter
public org.apache.hadoop.mapreduce.OutputCommitter getOutputCommitter(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException - Specified by:
getOutputCommitter
in classorg.apache.hadoop.mapreduce.OutputFormat<ImmutableBytesWritable,
Mutation> - Throws:
IOException
InterruptedException
-
getRecordWriter
public org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,Mutation> getRecordWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException, InterruptedException - Specified by:
getRecordWriter
in classorg.apache.hadoop.mapreduce.OutputFormat<ImmutableBytesWritable,
Mutation> - Throws:
IOException
InterruptedException
-