HBASE-18885 HFileOutputFormat2 hardcodes default FileOutputCommitter
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
ede916af5a
commit
e97738f0c2
|
@ -82,6 +82,7 @@ import org.apache.hadoop.io.NullWritable;
|
||||||
import org.apache.hadoop.io.SequenceFile;
|
import org.apache.hadoop.io.SequenceFile;
|
||||||
import org.apache.hadoop.io.Text;
|
import org.apache.hadoop.io.Text;
|
||||||
import org.apache.hadoop.mapreduce.Job;
|
import org.apache.hadoop.mapreduce.Job;
|
||||||
|
import org.apache.hadoop.mapreduce.OutputCommitter;
|
||||||
import org.apache.hadoop.mapreduce.OutputFormat;
|
import org.apache.hadoop.mapreduce.OutputFormat;
|
||||||
import org.apache.hadoop.mapreduce.RecordWriter;
|
import org.apache.hadoop.mapreduce.RecordWriter;
|
||||||
import org.apache.hadoop.mapreduce.TaskAttemptContext;
|
import org.apache.hadoop.mapreduce.TaskAttemptContext;
|
||||||
|
@ -177,7 +178,7 @@ public class HFileOutputFormat2
|
||||||
@Override
|
@Override
|
||||||
public RecordWriter<ImmutableBytesWritable, Cell> getRecordWriter(
|
public RecordWriter<ImmutableBytesWritable, Cell> getRecordWriter(
|
||||||
final TaskAttemptContext context) throws IOException, InterruptedException {
|
final TaskAttemptContext context) throws IOException, InterruptedException {
|
||||||
return createRecordWriter(context);
|
return createRecordWriter(context, this.getOutputCommitter(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static byte[] getTableNameSuffixedWithFamily(byte[] tableName, byte[] family) {
|
protected static byte[] getTableNameSuffixedWithFamily(byte[] tableName, byte[] family) {
|
||||||
|
@ -185,12 +186,11 @@ public class HFileOutputFormat2
|
||||||
}
|
}
|
||||||
|
|
||||||
static <V extends Cell> RecordWriter<ImmutableBytesWritable, V>
|
static <V extends Cell> RecordWriter<ImmutableBytesWritable, V>
|
||||||
createRecordWriter(final TaskAttemptContext context)
|
createRecordWriter(final TaskAttemptContext context, final OutputCommitter committer)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
// Get the path of the temporary output file
|
// Get the path of the temporary output file
|
||||||
final Path outputPath = FileOutputFormat.getOutputPath(context);
|
final Path outputDir = ((FileOutputCommitter)committer).getWorkPath();
|
||||||
final Path outputDir = new FileOutputCommitter(outputPath, context).getWorkPath();
|
|
||||||
final Configuration conf = context.getConfiguration();
|
final Configuration conf = context.getConfiguration();
|
||||||
final boolean writeMultipleTables = conf.getBoolean(MULTI_TABLE_HFILEOUTPUTFORMAT_CONF_KEY, false) ;
|
final boolean writeMultipleTables = conf.getBoolean(MULTI_TABLE_HFILEOUTPUTFORMAT_CONF_KEY, false) ;
|
||||||
final String writeTableNames = conf.get(OUTPUT_TABLE_NAME_CONF_KEY);
|
final String writeTableNames = conf.get(OUTPUT_TABLE_NAME_CONF_KEY);
|
||||||
|
|
Loading…
Reference in New Issue