hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [3/3] git commit: HBASE-12389 Reduce the number of versions configured for the ACL table
Date Wed, 05 Nov 2014 17:41:02 GMT
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/a9cad048
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/a9cad048
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/a9cad048

Branch: refs/heads/0.98
Commit: a9cad048518405bfd02d1dc9bbf9cd1c2f591a78
Parents: 6588668
Author: Andrew Purtell <apurtell@apache.org>
Authored: Wed Nov 5 09:28:36 2014 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Wed Nov 5 09:28:36 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/a9cad048/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 6af8b19..9a5c26b 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
@@ -55,7 +55,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;
@@ -109,17 +108,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));
-  }
-
   /**
    * Delimiter to separate user, column family, and qualifier in
    * _acl_ table info: column keys */
@@ -132,11 +120,20 @@ 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 {
+    HTableDescriptor desc = new HTableDescriptor(ACL_TABLE_NAME);
+    desc.addFamily(new HColumnDescriptor(ACL_LIST_FAMILY)
+      .setMaxVersions(1)
+      .setInMemory(true)
+      .setBlockCacheEnabled(true)
+      .setBlocksize(8 * 1024)
+      .setBloomFilterType(BloomType.NONE)
+      .setScope(HConstants.REPLICATION_SCOPE_LOCAL));
+    master.createTable(desc, null);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/a9cad048/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 10ae21d..edaf963 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
@@ -1089,7 +1089,7 @@ public class AccessController extends BaseMasterAndRegionObserver
     if (!MetaReader.tableExists(ctx.getEnvironment().getMasterServices().getCatalogTracker(),
         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