Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
HMaster#getClusterSchema() has a lot of usage, for example:
hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java
void assignTableToGroup(TableDescriptor desc) throws IOException { String groupName = master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); ... }
getClusterSchema() might return null when cluster schema service is not ready yet. Actually, it won't be ready until HMaster#initClusterSchemaService() is finished. See this comment for details.
We need to add protections, like adding null check before calling getClusterSchema().getXXX(), or in HMaster#getClusterSchema(), add a loop to wait until this.clusterSchemaService is not null.