private void tryMigrateNamespaceTable() throws IOException, InterruptedException {
    Optional<MigrateNamespaceTableProcedure> opt = masterServices.getProcedures().stream()
      .filter(p -> p instanceof MigrateNamespaceTableProcedure)
      .map(p -> (MigrateNamespaceTableProcedure) p).findAny();
    if (!opt.isPresent()) {
      // the procedure is not present, check whether have the ns family in meta table
      TableDescriptor metaTableDesc =
        masterServices.getTableDescriptors().get(TableName.META_TABLE_NAME);
      if (metaTableDesc.hasColumnFamily(HConstants.NAMESPACE_FAMILY)) {
        // normal case, upgrading is done or the cluster is created with 3.x code
        migrationDone = true;
      } else {
        // submit the migration procedure
        MigrateNamespaceTableProcedure proc = new MigrateNamespaceTableProcedure();
        masterServices.getMasterProcedureExecutor().submitProcedure(proc);
      }
    } else {
      if (opt.get().isFinished()) {
        // the procedure is already done
        migrationDone = true;
      }
      // we have already submitted the procedure, continue
    }
  }
This is a helper class used internally to manage the namespace metadata that is stored in the ns
family in meta table.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java