[ https://issues.apache.org/jira/browse/HBASE-22089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
kevin su reassigned HBASE-22089: -------------------------------- Assignee: kevin su > HMaster#getClusterSchema() could return null and cause NPE > ---------------------------------------------------------- > > Key: HBASE-22089 > URL: https://issues.apache.org/jira/browse/HBASE-22089 > Project: HBase > Issue Type: Improvement > Components: master > Reporter: Xiang Li > Assignee: kevin su > Priority: Minor > > HMaster#getClusterSchema() has a lot of usage, for example: > {code:title=hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminEndpoint.java|borderStyle=solid} > void assignTableToGroup(TableDescriptor desc) throws IOException { > String groupName = > > master.getClusterSchema().getNamespace(desc.getTableName().getNamespaceAsString()) > .getConfigurationValue(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP); > ... > } > {code} > 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|https://issues.apache.org/jira/browse/HBASE-20690?focusedCommentId=16784549&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16784549] > 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. -- This message was sent by Atlassian JIRA (v7.6.3#76005)