HBASE-14885 NullPointerException in HMaster#normalizeRegions() due to missing TableDescriptor

This commit is contained in:
tedyu 2015-11-25 16:06:27 -08:00
parent efb5917f22
commit e73a9594c2
1 changed files with 5 additions and 2 deletions

View File

@ -69,6 +69,7 @@ import org.apache.hadoop.hbase.ProcedureInfo;
import org.apache.hadoop.hbase.Server;
import org.apache.hadoop.hbase.ServerLoad;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableDescriptor;
import org.apache.hadoop.hbase.TableDescriptors;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.TableNotDisabledException;
@ -1357,8 +1358,10 @@ public class HMaster extends HRegionServer implements MasterServices, Server {
LOG.debug("Skipping normalizing " + table + " since its namespace has quota");
continue;
}
if (table.isSystemTable() || !getTableDescriptors().getDescriptor(table).
getHTableDescriptor().isNormalizationEnabled()) {
TableDescriptor tblDesc = getTableDescriptors().getDescriptor(table);
if (table.isSystemTable() || (tblDesc != null &&
tblDesc.getHTableDescriptor() != null &&
!tblDesc.getHTableDescriptor().isNormalizationEnabled())) {
LOG.debug("Skipping normalization for table: " + table + ", as it's either system"
+ " table or doesn't have auto normalization turned on");
continue;