hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [1/3] git commit: HBASE-10692 The Multi TableMap job don't support the security HBase cluster (Liu Shaohui)
Date Tue, 27 May 2014 17:59:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.94 6ed3d0770 -> 0328fcd33
  refs/heads/0.98 2e0ad596f -> d3ecf7523
  refs/heads/master aa101ca97 -> d9739b9e3


HBASE-10692 The Multi TableMap job don't support the security HBase cluster (Liu Shaohui)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/d3ecf752
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d3ecf752
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d3ecf752

Branch: refs/heads/0.98
Commit: d3ecf7523d0de335f0f95b36447c891365e18c6b
Parents: 2e0ad59
Author: Andrew Purtell <apurtell@apache.org>
Authored: Tue May 27 10:25:33 2014 -0700
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Tue May 27 10:27:21 2014 -0700

----------------------------------------------------------------------
 .../hbase/mapreduce/TableMapReduceUtil.java     | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/d3ecf752/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
index c518c68..eb90482 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
@@ -359,6 +359,31 @@ public class TableMapReduceUtil {
       Class<? extends WritableComparable> outputKeyClass,
       Class<? extends Writable> outputValueClass, Job job,
       boolean addDependencyJars) throws IOException {
+    initTableMapperJob(scans, mapper, outputKeyClass, outputValueClass, job,
+      addDependencyJars, true);
+  }
+
+  /**
+   * Use this before submitting a Multi TableMap job. It will appropriately set
+   * up the job.
+   *
+   * @param scans The list of {@link Scan} objects to read from.
+   * @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).
+   * @param initCredentials whether to initialize hbase auth credentials for the job
+   * @throws IOException When setting up the details fails.
+   */
+  public static void initTableMapperJob(List<Scan> scans,
+      Class<? extends TableMapper> mapper,
+      Class<? extends WritableComparable> outputKeyClass,
+      Class<? extends Writable> outputValueClass, Job job,
+      boolean addDependencyJars, 
+      boolean initCredentials) throws IOException {
     job.setInputFormatClass(MultiTableInputFormat.class);
     if (outputValueClass != null) {
       job.setMapOutputValueClass(outputValueClass);
@@ -379,6 +404,10 @@ public class TableMapReduceUtil {
     if (addDependencyJars) {
       addDependencyJars(job);
     }
+
+    if (initCredentials) {
+      initCredentials(job);
+    }
   }
 
   public static void initCredentials(Job job) throws IOException {


Mime
View raw message