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 09:31:55 UTC
svn commit: r929026 - in /hadoop/hbase/branches/0.20: CHANGES.txt
src/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
Author: stack
Date: Tue Mar 30 07:31:55 2010
New Revision: 929026
URL: http://svn.apache.org/viewvc?rev=929026&view=rev
Log:
HBASE-2374 TableInputFormat - Configurable parameter to add column families
Modified:
hadoop/hbase/branches/0.20/CHANGES.txt
hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=929026&r1=929025&r2=929026&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Tue Mar 30 07:31:55 2010
@@ -95,6 +95,8 @@ Release 0.20.4 - 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-2257 [stargate] multiuser mode
Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java?rev=929026&r1=929025&r2=929026&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/mapreduce/TableInputFormat.java Tue Mar 30 07:31:55 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)));
}