You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by ga...@apache.org on 2011/05/05 05:51:09 UTC

svn commit: r1099674 - in /pig/branches/branch-0.9: CHANGES.txt src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java

Author: gates
Date: Thu May  5 03:51:08 2011
New Revision: 1099674

URL: http://svn.apache.org/viewvc?rev=1099674&view=rev
Log:
PIG-2008: Cache outputFormat in HBaseStorage

Modified:
    pig/branches/branch-0.9/CHANGES.txt
    pig/branches/branch-0.9/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java

Modified: pig/branches/branch-0.9/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/CHANGES.txt?rev=1099674&r1=1099673&r2=1099674&view=diff
==============================================================================
--- pig/branches/branch-0.9/CHANGES.txt (original)
+++ pig/branches/branch-0.9/CHANGES.txt Thu May  5 03:51:08 2011
@@ -174,6 +174,8 @@ PIG-1696: Performance: Use System.arrayc
 
 BUG FIXES
 
+PIG-2008: Cache outputFormat in HBaseStorage (thedatachef via gates)
+
 PIG-2028: Speed up multiquery unit tests (rding)
 
 PIG-1990: support casting of complex types with empty inner schema

Modified: pig/branches/branch-0.9/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.9/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java?rev=1099674&r1=1099673&r2=1099674&view=diff
==============================================================================
--- pig/branches/branch-0.9/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java (original)
+++ pig/branches/branch-0.9/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java Thu May  5 03:51:08 2011
@@ -134,6 +134,7 @@ public class HBaseStorage extends LoadFu
     private Configuration m_conf;
     private RecordReader reader;
     private RecordWriter writer;
+    private TableOutputFormat outputFormat = null;
     private Scan scan;
     private String contextSignature = null;
 
@@ -509,9 +510,11 @@ public class HBaseStorage extends LoadFu
     
     @Override
     public OutputFormat getOutputFormat() throws IOException {
-        TableOutputFormat outputFormat = new TableOutputFormat();
-        HBaseConfiguration.addHbaseResources(m_conf);
-        outputFormat.setConf(m_conf);
+        if (outputFormat == null) {
+            this.outputFormat = new TableOutputFormat();
+            HBaseConfiguration.addHbaseResources(m_conf);
+            this.outputFormat.setConf(m_conf);            
+        }
         return outputFormat;
     }