You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/05/27 19:59:58 UTC

[1/3] git commit: HBASE-10692 The Multi TableMap job don't support the security HBase cluster (Liu Shaohui)

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 <ap...@apache.org>
Authored: Tue May 27 10:25:33 2014 -0700
Committer: Andrew Purtell <ap...@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 {


[2/3] git commit: HBASE-10692 The Multi TableMap job don't support the security HBase cluster (Liu Shaohui)

Posted by ap...@apache.org.
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/0328fcd3
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/0328fcd3
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/0328fcd3

Branch: refs/heads/0.94
Commit: 0328fcd33f0e9d07c307f39db84ef4c6740cbd27
Parents: 6ed3d07
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue May 27 10:25:33 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue May 27 10:29:42 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0328fcd3/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java b/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
index 462bc90..a6b2eb0 100644
--- a/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
+++ b/src/main/java/org/apache/hadoop/hbase/mapreduce/TableMapReduceUtil.java
@@ -288,6 +288,7 @@ public class TableMapReduceUtil {
     if (addDependencyJars) {
       addDependencyJars(job);
     }
+    initCredentials(job);
   }
 
   /**


[3/3] git commit: HBASE-10692 The Multi TableMap job don't support the security HBase cluster (Liu Shaohui)

Posted by ap...@apache.org.
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/d9739b9e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/d9739b9e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/d9739b9e

Branch: refs/heads/master
Commit: d9739b9e3f749d4190e5b8766dd0b5f6f6a9844c
Parents: aa101ca
Author: Andrew Purtell <ap...@apache.org>
Authored: Tue May 27 10:59:40 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue May 27 10:59:40 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/d9739b9e/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 3e79049..5153474 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
@@ -358,6 +358,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);
@@ -378,6 +403,10 @@ public class TableMapReduceUtil {
     if (addDependencyJars) {
       addDependencyJars(job);
     }
+
+    if (initCredentials) {
+      initCredentials(job);
+    }
   }
 
   public static void initCredentials(Job job) throws IOException {