hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia7...@apache.org
Subject hbase git commit: HBASE-18885 HFileOutputFormat2 hardcodes default FileOutputCommitter
Date Thu, 28 Sep 2017 07:03:18 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.3 b41dbd37e -> 53f1e2480


HBASE-18885 HFileOutputFormat2 hardcodes default FileOutputCommitter

Signed-off-by: Chia-Ping Tsai <chia7712@gmail.com>


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

Branch: refs/heads/branch-1.3
Commit: 53f1e24809073c5e7259d2f566bc464b4e94952b
Parents: b41dbd3
Author: shaofengshi <shaofengshi@apache.org>
Authored: Wed Sep 27 11:48:04 2017 +0800
Committer: Chia-Ping Tsai <chia7712@gmail.com>
Committed: Thu Sep 28 15:00:38 2017 +0800

----------------------------------------------------------------------
 .../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/53f1e248/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/53f1e248/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