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 2011/04/13 06:29:56 UTC
svn commit: r1091643 - in /hbase/trunk: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
Author: stack
Date: Wed Apr 13 04:29:56 2011
New Revision: 1091643
URL: http://svn.apache.org/viewvc?rev=1091643&view=rev
Log:
HBASE-3769 TableMapReduceUtil is inconsistent with other table-related classes that accept byte[] as a table name
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1091643&r1=1091642&r2=1091643&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Wed Apr 13 04:29:56 2011
@@ -151,6 +151,8 @@ Release 0.91.0 - Unreleased
HBASE-3764 Book.xml - adding 2 FAQs (SQL and arch question)
HBASE-3770 Make FilterList accept var arg Filters in its constructor
as a convenience (Erik Onnen via Stack)
+ HBASE-3769 TableMapReduceUtil is inconsistent with other table-related
+ classes that accept byte[] as a table name (Erik Onnen via Stack)
TASKS
HBASE-3559 Move report of split to master OFF the heartbeat channel
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java?rev=1091643&r1=1091642&r2=1091643&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java Wed Apr 13 04:29:56 2011
@@ -41,6 +41,7 @@ import org.apache.hadoop.hbase.client.HT
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.util.Base64;
+import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;
@@ -76,6 +77,29 @@ public class TableMapReduceUtil {
job, true);
}
+
+ /**
+ * Use this before submitting a TableMap job. It will appropriately set up
+ * the job.
+ *
+ * @param table Binary representation of the table name to read from.
+ * @param scan The scan instance with the columns, time range etc.
+ * @param mapper The mapper class to use.
+ * @param outputKeyClass The class of the output key.
+ * @param outputValueClass The class of the output value.
+ * @param job The current job to adjust. Make sure the passed job is
+ * carrying all necessary HBase configuration.
+ * @throws IOException When setting up the details fails.
+ */
+ public static void initTableMapperJob(byte[] table, Scan scan,
+ Class<? extends TableMapper> mapper,
+ Class<? extends WritableComparable> outputKeyClass,
+ Class<? extends Writable> outputValueClass, Job job)
+ throws IOException {
+ initTableMapperJob(Bytes.toString(table), scan, mapper, outputKeyClass, outputValueClass,
+ job, true);
+ }
+
/**
* Use this before submitting a TableMap job. It will appropriately set up
* the job.
@@ -111,6 +135,31 @@ public class TableMapReduceUtil {
}
/**
+ * Use this before submitting a TableMap job. It will appropriately set up
+ * the job.
+ *
+ * @param table Binary representation of the table name to read from.
+ * @param scan The scan instance with the columns, time range etc.
+ * @param mapper The mapper class to use.
+ * @param outputKeyClass The class of the output key.
+ * @param outputValueClass The class of the output value.
+ * @param job The current job to adjust. Make sure the passed job is
+ * carrying all necessary HBase configuration.
+ * @param addDependencyJars upload HBase jars and jars for any of the configured
+ * job classes via the distributed cache (tmpjars).
+ * @throws IOException When setting up the details fails.
+ */
+ public static void initTableMapperJob(byte[] table, Scan scan,
+ Class<? extends TableMapper> mapper,
+ Class<? extends WritableComparable> outputKeyClass,
+ Class<? extends Writable> outputValueClass, Job job,
+ boolean addDependencyJars)
+ throws IOException {
+ initTableMapperJob(Bytes.toString(table), scan, mapper, outputKeyClass,
+ outputValueClass, job, addDependencyJars);
+ }
+
+ /**
* Writes the given scan into a Base64 encoded string.
*
* @param scan The scan to write out.