protected static class MultiTableOutputFormat.MultiTableRecordWriter extends org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,Mutation>
Modifier and Type | Field and Description |
---|---|
(package private) org.apache.hadoop.conf.Configuration |
conf |
(package private) Connection |
connection |
private static org.slf4j.Logger |
LOG |
(package private) Map<ImmutableBytesWritable,BufferedMutator> |
mutatorMap |
(package private) boolean |
useWriteAheadLogging |
Constructor and Description |
---|
MultiTableRecordWriter(org.apache.hadoop.conf.Configuration conf,
boolean useWriteAheadLogging) |
Modifier and Type | Method and Description |
---|---|
void |
close(org.apache.hadoop.mapreduce.TaskAttemptContext context) |
(package private) BufferedMutator |
getBufferedMutator(ImmutableBytesWritable tableName) |
void |
write(ImmutableBytesWritable tableName,
Mutation action)
Writes an action (Put or Delete) to the specified table.
|
private static final org.slf4j.Logger LOG
Connection connection
Map<ImmutableBytesWritable,BufferedMutator> mutatorMap
org.apache.hadoop.conf.Configuration conf
boolean useWriteAheadLogging
public MultiTableRecordWriter(org.apache.hadoop.conf.Configuration conf, boolean useWriteAheadLogging) throws IOException
conf
- HBaseConfiguration to useduseWriteAheadLogging
- whether to use write ahead logging. This can be turned off (
false) to improve performance when bulk loading data.IOException
BufferedMutator getBufferedMutator(ImmutableBytesWritable tableName) throws IOException
tableName
- the name of the table, as a stringIOException
- if there is a problem opening a tablepublic void close(org.apache.hadoop.mapreduce.TaskAttemptContext context) throws IOException
close
in class org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,Mutation>
IOException
public void write(ImmutableBytesWritable tableName, Mutation action) throws IOException
write
in class org.apache.hadoop.mapreduce.RecordWriter<ImmutableBytesWritable,Mutation>
tableName
- the table being updated.action
- the update, either a put or a delete.IllegalArgumentException
- if the action is not a put or a delete.IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.