HBASE-13964 Skip region normalization for tables under namespace quota

This commit is contained in:
tedyu 2015-06-25 03:34:28 -07:00
parent 2df3236a4e
commit edef3d64bc
2 changed files with 7 additions and 6 deletions

View File

@ -1288,7 +1288,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().getDescriptor(table).
getHTableDescriptor().isNormalizationEnabled()) {
LOG.debug("Skipping normalization for table: " + table + ", as it's either system"

View File

@ -31,8 +31,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
@ -142,12 +140,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);
}