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

svn commit: r929006 - in /hadoop/hbase/trunk: CHANGES.txt core/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java

Author: stack
Date: Tue Mar 30 06:18:37 2010
New Revision: 929006

URL: http://svn.apache.org/viewvc?rev=929006&view=rev
Log:
HBASE-2374 TableInputFormat - Configurable parameter to add column families 

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=929006&r1=929005&r2=929006&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Mar 30 06:18:37 2010
@@ -467,6 +467,8 @@ Release 0.21.0 - Unreleased
    HBASE-2389  HTable - delete / put unnecessary sync (Kay Kay via Stack)
    HBASE-2385  Debug Message "Received report from unknown server" should be
                INFO or WARN
+   HBASE-2374  TableInputFormat - Configurable parameter to add column families
+               (Kay Kay via Stack)
 
   NEW FEATURES
    HBASE-1961  HBase EC2 scripts

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java?rev=929006&r1=929005&r2=929006&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java (original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java Tue Mar 30 06:18:37 2010
@@ -28,6 +28,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.Scan;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.util.StringUtils;
 
 /**
@@ -40,8 +41,12 @@ implements Configurable {
   
   /** Job parameter that specifies the input table. */
   public static final String INPUT_TABLE = "hbase.mapreduce.inputtable";
-  /** Base-64 encoded scanner. All other SCAN_ confs are ignored if this is specified. */
+  /** Base-64 encoded scanner. All other SCAN_ confs are ignored if this is specified.
+   * See {@link TableMapReduceUtil#convertScanToString(Scan)} for more details.
+   */
   public static final String SCAN = "hbase.mapreduce.scan";
+  /** Column Family to Scan */
+  public static final String SCAN_COLUMN_FAMILY = "hbase.mapreduce.scan.column.family";
   /** Space delimited list of columns to scan. */
   public static final String SCAN_COLUMNS = "hbase.mapreduce.scan.columns";
   /** The timestamp used to filter columns with a specific timestamp. */
@@ -105,6 +110,10 @@ implements Configurable {
           scan.addColumns(conf.get(SCAN_COLUMNS));
         }
         
+        if (conf.get(SCAN_COLUMN_FAMILY) != null) { 
+          scan.addFamily(Bytes.toBytes(conf.get(SCAN_COLUMN_FAMILY)));
+        }
+        
         if (conf.get(SCAN_TIMESTAMP) != null) {
           scan.setTimeStamp(Long.parseLong(conf.get(SCAN_TIMESTAMP)));
         }