You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by li...@apache.org on 2013/08/03 20:18:19 UTC

svn commit: r1510048 - in /hbase/branches/0.89-fb/src: main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java

Author: liyin
Date: Sat Aug  3 18:18:19 2013
New Revision: 1510048

URL: http://svn.apache.org/r1510048
Log:
[master]Fix HFileOutputFormat writer access permission

Author: fan

Summary: Fix writer access permission

Test Plan: Unit test passes

Reviewers: liyintang

Reviewed By: liyintang

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D912791

Task ID: 2633302

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java?rev=1510048&r1=1510047&r2=1510048&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat.java Sat Aug  3 18:18:19 2013
@@ -89,7 +89,7 @@ public class HFileOutputFormat extends F
   static final String TABLE_NAME = "hbase.hfileoutputformat.tablename";
   static final String UTF8 = "UTF-8";
 
-  protected static RecordWriter<ImmutableBytesWritable, KeyValue> latestWriter = null;
+  private static RecordWriter<ImmutableBytesWritable, KeyValue> latestWriter = null;
 
   public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context)
   throws IOException, InterruptedException {
@@ -639,4 +639,10 @@ public class HFileOutputFormat extends F
     }
     // The rest of the stuff will be taken care of by the RecordWriter
   }
+
+  public static void closeWriter(TaskAttemptContext context) throws IOException, InterruptedException {
+    if (HFileOutputFormat.latestWriter != null) {
+      latestWriter.close(context);
+    }
+  }
 }

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java?rev=1510048&r1=1510047&r2=1510048&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java Sat Aug  3 18:18:19 2013
@@ -283,7 +283,7 @@ public class TestHFileOutputFormat  {
       Path workOutputPath = FileOutputFormat.getWorkOutputPath(context).makeQualified(fs);
 
       // Force flushing HFile into working directory
-      HFileOutputFormat.latestWriter.close(context);
+      HFileOutputFormat.closeWriter(context);
 
       new LoadIncrementalHFiles(conf).doBulkLoad(workOutputPath, table);
     }