hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-13964 Skip region normalization for tables under namespace quota
Date Thu, 25 Jun 2015 10:35:48 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.2 bc7dfe9ed -> c680e2f40


HBASE-13964 Skip region normalization for tables under namespace quota


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

Branch: refs/heads/branch-1.2
Commit: c680e2f40927407a0699b0b1ce687867bc2bb398
Parents: bc7dfe9
Author: tedyu <yuzhihong@gmail.com>
Authored: Thu Jun 25 03:35:43 2015 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Thu Jun 25 03:35:43 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/master/HMaster.java | 7 ++++++-
 .../org/apache/hadoop/hbase/namespace/NamespaceAuditor.java   | 6 +-----
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c680e2f4/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index b282676..3955211 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -1321,7 +1321,12 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
 
       Collections.shuffle(allEnabledTables);
 
-      for(TableName table : allEnabledTables) {
+      for (TableName table : allEnabledTables) {
+        if (quotaManager.getNamespaceQuotaManager() != null &&
+            quotaManager.getNamespaceQuotaManager().getState(table.getNamespaceAsString())
!= null){
+          LOG.debug("Skipping normalizing " + table + " since its namespace has quota");
+          continue;
+        }
         if (table.isSystemTable() || !getTableDescriptors().get(table).isNormalizationEnabled())
{
           LOG.debug("Skipping normalization for table: " + table + ", as it's either system"
             + " table or doesn't have auto normalization turned on");

http://git-wip-us.apache.org/repos/asf/hbase/blob/c680e2f4/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceAuditor.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceAuditor.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceAuditor.java
index 2d8529a..7956e48 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceAuditor.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceAuditor.java
@@ -24,8 +24,6 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.master.MasterServices;
 import org.apache.hadoop.hbase.quotas.QuotaExceededException;
 
-import com.google.common.annotations.VisibleForTesting;
-
 /**
  * The Class NamespaceAuditor performs checks to ensure operations like table creation and
region
  * splitting preserve namespace quota. The namespace quota can be specified while namespace
@@ -131,12 +129,10 @@ public class NamespaceAuditor {
   }
 
   /**
-   * Used only for unit tests.
    * @param namespace The name of the namespace
    * @return An instance of NamespaceTableAndRegionInfo
    */
-  @VisibleForTesting
-  NamespaceTableAndRegionInfo getState(String namespace) {
+  public NamespaceTableAndRegionInfo getState(String namespace) {
     if (stateManager.isInitialized()) {
       return stateManager.getState(namespace);
     }


Mime
View raw message