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-12389 Reduce the number of versions configured for the ACL table
Date Wed, 05 Nov 2014 17:41:00 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 6588668f7 -> a9cad0485
  refs/heads/branch-1 2e826a4ad -> 41611547b
  refs/heads/master 9255d6fdc -> e1b82fe91


HBASE-12389 Reduce the number of versions configured for the ACL table


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

Branch: refs/heads/master
Commit: e1b82fe91f6ddaea524c1eeb551e1002d91e4c07
Parents: 9255d6f
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Nov 5 09:28:11 2014 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Nov 5 09:28:11 2014 -0800

----------------------------------------------------------------------
 .../security/access/AccessControlLists.java     | 35 +++++++++-----------
 .../hbase/security/access/AccessController.java |  2 +-
 2 files changed, 17 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e1b82fe9/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
index c49bc33..5ca1164 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessControlLists.java
@@ -56,7 +56,6 @@ import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp;
 import org.apache.hadoop.hbase.filter.QualifierFilter;
 import org.apache.hadoop.hbase.filter.RegexStringComparator;
-import org.apache.hadoop.hbase.io.compress.Compression;
 import org.apache.hadoop.hbase.master.MasterServices;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos;
@@ -110,20 +109,6 @@ public class AccessControlLists {
 
   public static final char NAMESPACE_PREFIX = '@';
 
-  /** Table descriptor for ACL internal table */
-  public static final HTableDescriptor ACL_TABLEDESC = new HTableDescriptor(ACL_TABLE_NAME);
-  static {
-    ACL_TABLEDESC.addFamily(
-        new HColumnDescriptor(ACL_LIST_FAMILY,
-            10, // Ten is arbitrary number.  Keep versions to help debugging.
-            Compression.Algorithm.NONE.getName(), true, true, 8 * 1024,
-            HConstants.FOREVER, BloomType.NONE.toString(),
-            HConstants.REPLICATION_SCOPE_LOCAL).
-            // Set cache data blocks in L1 if more than one cache tier deployed; e.g. this
will
-            // be the case if we are using CombinedBlockCache (Bucket Cache).
-            setCacheDataInL1(true));
-  }
-
   /**
    * Delimiter to separate user, column family, and qualifier in
    * _acl_ table info: column keys */
@@ -136,11 +121,23 @@ public class AccessControlLists {
   private static Log LOG = LogFactory.getLog(AccessControlLists.class);
 
   /**
-   * Check for existence of {@code _acl_} table and create it if it does not exist
-   * @param master reference to HMaster
+   * Create the ACL table
+   * @param master
+   * @throws IOException
    */
-  static void init(MasterServices master) throws IOException {
-    master.createTable(ACL_TABLEDESC, null);
+  static void createACLTable(MasterServices master) throws IOException {
+    master.createTable(new HTableDescriptor(ACL_TABLE_NAME)
+      .addFamily(new HColumnDescriptor(ACL_LIST_FAMILY)
+        .setMaxVersions(1)
+        .setInMemory(true)
+        .setBlockCacheEnabled(true)
+        .setBlocksize(8 * 1024)
+        .setBloomFilterType(BloomType.NONE)
+        .setScope(HConstants.REPLICATION_SCOPE_LOCAL)
+        // Set cache data blocks in L1 if more than one cache tier deployed; e.g. this will
+        // be the case if we are using CombinedBlockCache (Bucket Cache).
+        .setCacheDataInL1(true)),
+    null);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/e1b82fe9/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
index ab1b4a8..733f9dc 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
@@ -1070,7 +1070,7 @@ public class AccessController extends BaseMasterAndRegionObserver
     if (!MetaTableAccessor.tableExists(ctx.getEnvironment().getMasterServices()
       .getShortCircuitConnection(), AccessControlLists.ACL_TABLE_NAME)) {
       // initialize the ACL storage table
-      AccessControlLists.init(ctx.getEnvironment().getMasterServices());
+      AccessControlLists.createACLTable(ctx.getEnvironment().getMasterServices());
     } else {
       aclTabAvailable = true;
     }


Mime
View raw message