HBASE-13964 Skip region normalization for tables under namespace quota
This commit is contained in:
parent
2df3236a4e
commit
edef3d64bc
|
@ -1288,7 +1288,12 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
|
||||||
|
|
||||||
Collections.shuffle(allEnabledTables);
|
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).
|
if (table.isSystemTable() || !getTableDescriptors().getDescriptor(table).
|
||||||
getHTableDescriptor().isNormalizationEnabled()) {
|
getHTableDescriptor().isNormalizationEnabled()) {
|
||||||
LOG.debug("Skipping normalization for table: " + table + ", as it's either system"
|
LOG.debug("Skipping normalization for table: " + table + ", as it's either system"
|
||||||
|
|
|
@ -31,8 +31,6 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.hbase.master.MasterServices;
|
import org.apache.hadoop.hbase.master.MasterServices;
|
||||||
import org.apache.hadoop.hbase.quotas.QuotaExceededException;
|
import org.apache.hadoop.hbase.quotas.QuotaExceededException;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class NamespaceAuditor performs checks to ensure operations like table creation
|
* The Class NamespaceAuditor performs checks to ensure operations like table creation
|
||||||
* and region splitting preserve namespace quota. The namespace quota can be specified
|
* 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
|
* @param namespace The name of the namespace
|
||||||
* @return An instance of NamespaceTableAndRegionInfo
|
* @return An instance of NamespaceTableAndRegionInfo
|
||||||
*/
|
*/
|
||||||
@VisibleForTesting
|
public NamespaceTableAndRegionInfo getState(String namespace) {
|
||||||
NamespaceTableAndRegionInfo getState(String namespace) {
|
|
||||||
if (stateManager.isInitialized()) {
|
if (stateManager.isInitialized()) {
|
||||||
return stateManager.getState(namespace);
|
return stateManager.getState(namespace);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue