hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject git commit: HBASE-11449 IntegrationTestIngestWithACL fails to use different users after HBASE-10810 (Ram)
Date Thu, 03 Jul 2014 06:35:10 GMT
Repository: hbase
Updated Branches:
  refs/heads/master b79d6bf72 -> 80f0a522f


HBASE-11449 IntegrationTestIngestWithACL fails to use different users
after HBASE-10810 (Ram)


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

Branch: refs/heads/master
Commit: 80f0a522f945ca06b9e4e096c77a3ea489369c27
Parents: b79d6bf
Author: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Authored: Thu Jul 3 12:03:59 2014 +0530
Committer: Ramkrishna <ramkrishna.s.vasudevan@intel.com>
Committed: Thu Jul 3 12:03:59 2014 +0530

----------------------------------------------------------------------
 .../hbase/IntegrationTestIngestWithACL.java     |  1 +
 .../apache/hadoop/hbase/util/LoadTestTool.java  | 20 +++++---------------
 .../hbase/util/MultiThreadedReaderWithACL.java  |  4 ++--
 .../hbase/util/MultiThreadedUpdaterWithACL.java |  5 +++--
 .../hbase/util/MultiThreadedWriterWithACL.java  |  3 ++-
 5 files changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/80f0a522/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
index 94681cc..296fb80 100644
--- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
+++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java
@@ -58,6 +58,7 @@ public class IntegrationTestIngestWithACL extends IntegrationTestIngest
{
     conf.setInt(HFile.FORMAT_VERSION_KEY, 3);
     conf.set("hbase.coprocessor.master.classes", AccessController.class.getName());
     conf.set("hbase.coprocessor.region.classes", AccessController.class.getName());
+    conf.setBoolean("hbase.security.access.early_out", false);
     // conf.set("hbase.superuser", "admin");
     super.setUpCluster();
   }

http://git-wip-us.apache.org/repos/asf/hbase/blob/80f0a522/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
index d193a9c..ce3da34 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/LoadTestTool.java
@@ -206,7 +206,7 @@ public class LoadTestTool extends AbstractHBaseTool {
 
   private String superUser;
 
-  private String userNames = "user1, user2, user3, user4";
+  private String userNames;
   //This file is used to read authentication information in secure clusters.
   private String authnFileName;
 
@@ -559,7 +559,7 @@ public class LoadTestTool extends AbstractHBaseTool {
           minColsPerKey, maxColsPerKey, COLUMN_FAMILY);
     }
 
-    if (User.isHBaseSecurityEnabled(conf) && userOwner != null) {
+    if (userOwner != null) {
       LOG.info("Granting permissions for user " + userOwner.getShortName());
       AccessControlProtos.Permission.Action[] actions = {
         AccessControlProtos.Permission.Action.ADMIN, AccessControlProtos.Permission.Action.CREATE,
@@ -576,20 +576,10 @@ public class LoadTestTool extends AbstractHBaseTool {
       // This will be comma separated list of expressions.
       String users[] = userNames.split(",");
       User user = null;
-      if (User.isHBaseSecurityEnabled(conf)) {
-        for (String userStr : users) {
+      for (String userStr : users) {
+        if (User.isHBaseSecurityEnabled(conf)) {
           user = User.create(loginAndReturnUGI(conf, userStr));
-          LOG.info("Granting READ permission for the user " + user.getShortName());
-          AccessControlProtos.Permission.Action[] actions = { AccessControlProtos.Permission.Action.READ
};
-          try {
-            AccessControlClient.grant(conf, tableName, user.getShortName(), null, null, actions);
-          } catch (Throwable e) {
-            LOG.fatal("Error in granting READ permission for the user " + user.getShortName(),
e);
-            return EXIT_FAILURE;
-          }
-	}
-      } else {
-        for (String userStr : users) {
+        } else {
           user = User.createUserForTesting(conf, userStr, new String[0]);
         }
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/80f0a522/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
index 030ad1d..5c70908 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedReaderWithACL.java
@@ -26,6 +26,7 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.security.User;
@@ -99,7 +100,7 @@ public class MultiThreadedReaderWithACL extends MultiThreadedReader {
             int specialPermCellInsertionFactor = Integer.parseInt(dataGenerator.getArgs()[2]);
             int mod = ((int) keyToRead % userNames.length);
             if (userVsTable.get(userNames[mod]) == null) {
-              localTable = connection.getTable(tableName);
+              localTable = new HTable(conf, tableName);
               userVsTable.put(userNames[mod], localTable);
               result = localTable.get(get);
             } else {
@@ -107,7 +108,6 @@ public class MultiThreadedReaderWithACL extends MultiThreadedReader {
               result = localTable.get(get);
             }
             boolean isNullExpected = ((((int) keyToRead % specialPermCellInsertionFactor))
== 0);
-            LOG.info("Read happening from ACL " + isNullExpected);
             long end = System.nanoTime();
             verifyResultsAndUpdateMetrics(verify, get, end - start, result, localTable, isNullExpected);
           } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/80f0a522/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdaterWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdaterWithACL.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdaterWithACL.java
index 2fd826e..7c6f716 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdaterWithACL.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdaterWithACL.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Increment;
 import org.apache.hadoop.hbase.client.Mutation;
@@ -116,7 +117,7 @@ public class MultiThreadedUpdaterWithACL extends MultiThreadedUpdater
{
           try {
             int mod = ((int) rowKeyBase % userNames.length);
             if (userVsTable.get(userNames[mod]) == null) {
-              localTable = connection.getTable(tableName);
+              localTable = new HTable(conf, tableName);
               userVsTable.put(userNames[mod], localTable);
               res = localTable.get(get);
             } else {
@@ -225,7 +226,7 @@ public class MultiThreadedUpdaterWithACL extends MultiThreadedUpdater
{
       public Object run() throws Exception {
         try {
           if (table == null) {
-            table = connection.getTable(tableName);
+            table = new HTable(conf, tableName);
           }
           if (m instanceof Increment) {
             table.increment((Increment) m);

http://git-wip-us.apache.org/repos/asf/hbase/blob/80f0a522/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedWriterWithACL.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedWriterWithACL.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedWriterWithACL.java
index 707e123..ba452c2 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedWriterWithACL.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedWriterWithACL.java
@@ -26,6 +26,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTable;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException;
@@ -125,7 +126,7 @@ public class MultiThreadedWriterWithACL extends MultiThreadedWriter {
       public Object run() throws Exception {
         try {
           if (table == null) {
-            table = connection.getTable(tableName);
+            table = new HTable(conf, tableName);
           }
           table.put(put);
         } catch (IOException e) {


Mime
View raw message