private void initialize() throws IOException {
    List<NamespaceDescriptor> namespaces = this.master.getClusterSchema().getNamespaces();
    for (NamespaceDescriptor namespace : namespaces) {
      addNamespace(namespace.getName());
      List<TableName> tables = this.master.listTableNamesByNamespace(namespace.getName());
      for (TableName table : tables) {
        if (table.isSystemTable()) {
          continue;
        }
        List<RegionInfo> regions =
          MetaTableAccessor.getTableRegions(this.master.getConnection(), table, true);
        addTable(table, regions.size());
      }
    }
    LOG.info("Finished updating state of {} namespaces.", nsStateCache.size());
    initialized = true;
  }
Initialize namespace state cache by scanning meta table.
hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java