sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2057: Skip delegation token generation flag during hbase import
Date Wed, 04 Feb 2015 20:47:12 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk 420fc3d53 -> 35ad630d7


SQOOP-2057: Skip delegation token generation flag during hbase import

(Abraham Elmahrek via Jarek Jarcec Cecho)


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

Branch: refs/heads/trunk
Commit: 35ad630d7724ba17be1ef6af5aee7c3bceba904f
Parents: 420fc3d
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Wed Feb 4 12:45:57 2015 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Wed Feb 4 12:45:57 2015 -0800

----------------------------------------------------------------------
 .../apache/sqoop/mapreduce/HBaseImportJob.java  | 21 +++-----------------
 1 file changed, 3 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/35ad630d/src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java b/src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
index ac8758b..39c2765 100644
--- a/src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
+++ b/src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
@@ -120,23 +120,8 @@ public class HBaseImportJob extends DataDrivenImportJob {
     conf.set(HBasePutProcessor.ROW_KEY_COLUMN_KEY, rowKeyCol);
   }
 
-  /**
-   * Hope for an existing authentication token.
-   * Test with basic metadata operation.
-   * Log exception if credentials exist, otherwise rethrow exception.
-   */
-  private boolean isAuthenticated(HBaseAdmin admin) {
-    try {
-      LOG.info("Checking for previous credentials by performing a metadata query.");
-      admin.tableExists("TEST");
-      LOG.info("Previous authentication credentials detected, so the job will use them.");
-    } catch (IOException e) {
-      LOG.info("No previous credentials found. Will attempt to authenticate.");
-      LOG.debug("Exception found when performing metadata query to check credentials.", e);
-      return false;
-    }
-
-    return true;
+  protected boolean skipDelegationTokens(Configuration conf) {
+    return conf.getBoolean("sqoop.hbase.security.token.skip", false);
   }
 
   @Override
@@ -177,7 +162,7 @@ public class HBaseImportJob extends DataDrivenImportJob {
 
     HBaseAdmin admin = new HBaseAdmin(conf);
 
-    if (!isAuthenticated(admin)) {
+    if (!skipDelegationTokens(conf)) {
       // Add authentication token to the job if we're running on secure cluster.
       //
       // We're currently supporting HBase version 0.90 that do not have security


Mime
View raw message