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 14:00:40 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.4 f391fc44d -> bb8c716fe


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/bb8c716f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bb8c716f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bb8c716f

Branch: refs/heads/branch-1.4
Commit: bb8c716fe5c2c6927f466b5d922327156e60c93f
Parents: f391fc4
Author: shaofengshi <shaofengshi@apache.org>
Authored: Wed Sep 27 11:48:04 2017 +0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Wed Sep 27 07:00:18 2017 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java | 2 +-
 .../apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bb8c716f/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
index ceb7768..b3ded4b 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
@@ -69,7 +69,7 @@ public class HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable,
   @Override
   public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(
       final TaskAttemptContext context) throws IOException, InterruptedException {
-    return HFileOutputFormat2.createRecordWriter(context);
+    return HFileOutputFormat2.createRecordWriter(context, this.getOutputCommitter(context));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/bb8c716f/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
index 616bb72..76746d1 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java
@@ -70,6 +70,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;
@@ -126,16 +127,15 @@ public class HFileOutputFormat2
   @Override
   public RecordWriter<ImmutableBytesWritable, Cell> getRecordWriter(
       final TaskAttemptContext context) throws IOException, InterruptedException {
-    return createRecordWriter(context);
+    return createRecordWriter(context, this.getOutputCommitter(context));
   }
 
   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 FileSystem fs = outputdir.getFileSystem(conf);
     // These configs. are from hbase-*.xml


Mime
View raw message