hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-18885 HFileOutputFormat2 hardcodes default FileOutputCommitter
Date Wed, 27 Sep 2017 02:58:28 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 91e1f834b -> 843917c52


HBASE-18885 HFileOutputFormat2 hardcodes default FileOutputCommitter

Signed-off-by: tedyu <yuzhihong@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/843917c5
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/843917c5
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/843917c5

Branch: refs/heads/master
Commit: 843917c525507be1f20d3ada1b768e6e851924c6
Parents: 91e1f83
Author: shaofengshi <shaofengshi@apache.org>
Authored: Tue Sep 26 18:57:29 2017 +0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Sep 26 19:58:11 2017 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/843917c5/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
----------------------------------------------------------------------
diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
index e8b7d11..e757742 100644
--- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
+++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
@@ -82,6 +82,7 @@ import org.apache.hadoop.io.NullWritable;
 import org.apache.hadoop.io.SequenceFile;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.OutputCommitter;
 import org.apache.hadoop.mapreduce.OutputFormat;
 import org.apache.hadoop.mapreduce.RecordWriter;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
@@ -177,7 +178,7 @@ public class HFileOutputFormat2
   @Override
   public RecordWriter<ImmutableBytesWritable, Cell> getRecordWriter(
       final TaskAttemptContext context) throws IOException, InterruptedException {
-    return createRecordWriter(context);
+    return createRecordWriter(context, this.getOutputCommitter(context));
   }
 
   protected static byte[] getTableNameSuffixedWithFamily(byte[] tableName, byte[] family)
{
@@ -185,12 +186,11 @@ public class HFileOutputFormat2
   }
 
   static <V extends Cell> RecordWriter<ImmutableBytesWritable, V>
-      createRecordWriter(final TaskAttemptContext context)
+      createRecordWriter(final TaskAttemptContext context, final OutputCommitter committer)
           throws IOException {
 
     // Get the path of the temporary output file
-    final Path outputPath = FileOutputFormat.getOutputPath(context);
-    final Path outputDir = new FileOutputCommitter(outputPath, context).getWorkPath();
+    final Path outputDir = ((FileOutputCommitter)committer).getWorkPath();
     final Configuration conf = context.getConfiguration();
     final boolean writeMultipleTables = conf.getBoolean(MULTI_TABLE_HFILEOUTPUTFORMAT_CONF_KEY,
false) ;
     final String writeTableNames = conf.get(OUTPUT_TABLE_NAME_CONF_KEY);


Mime
View raw message